Post: Entity Models/Numbers and Ways to Delete
08-31-2015, 04:21 PM #1
ItzMatriix
Are you high?
(adsbygoogle = window.adsbygoogle || []).push({}); Ok so i know this may be common sense to some people, but i know that it definately is not for everyone. Also this can probably be found around the forums but im going to put it all together.

So this is useful for finding Entity Models and also finding Entity Numbers. So say you are making a gamemode that requires a little bit of extra space. Where like say you have this parking lot that you want to use, however, there are a bunch of cars in the way. This will let you delete all of those cars automatically from Init or where ever you want to call it from, rather than using a forge function to delete them manually.

    
TraceModel()
{
self endon("disconnect");
self endon("death");
for(;Winky Winky
{
if(self adsButtonPressed() && self actionslotonebuttonpressed())
{
trace = bullettrace(self gettagorigin("j_head"),self gettagorigin("j_head")+anglestoforward(self getplayerangles())*1000000,true,self);
self iPrintln("Model: ^2" + trace["entity"].model);
self iPrintln("Number: ^5" + trace["entity"] getEntityNumber());
wait 0.2;
}
wait 0.05;
}
}

DeleteByModel(Model)
{
ents = getEntArray();
for ( index = 0; index < ents.size; index++ )
{
if(isSubStr(ents[index].model, Model))
ents[index] delete();
}
}

DeleteByNumber(Number)
{
ents = getEntArray();
for ( index = 0; index < ents.size; index++ )
{
if(ents[index] getEntityNumber() == Number)
ents[index] delete();
}
}


So first what you want to do is use the TraceModel function to get the entities Number and Model. Not all entities will have a model that will show up, but most will have a number. Once you go up to the car or whatever you want to remove, you press Ads and Dpad Up. This will print the Model and Number on screen. Then you can delete by your choice. If there are multiple ents with the same model you want to remove, you can use the DeleteByModel.
    
init()
{
level thread onPlayerConnect();
level thread DeleteByModel("ENTER MODEL NAME HERE");
}

This would them remove all the entities from the map with that Model Name

If you want to remove something where the model does not show up, or only a specific ent, you can use the DeleteByNumber.
    
init()
{
level thread onPlayerConnect();
level thread DeleteByNumber(ENTITY NUMBER HERE);
}


This is just a quicker and easier way for game mode makers and others to remove stuff from the map.

**NOTE**
Even after removing some cars/ents from the map, sometimes it will leave an invisible barrier, I am not sure how to remove that.

Also, You can use "trace["entity"].classname" for some things as well. This would return like "script_model" or "script_brushmodel", so you can figure out what you can do with that on your own.
(adsbygoogle = window.adsbygoogle || []).push({});

The following 3 users say thank you to ItzMatriix for this useful post:

FRINZ, HiddenHour, iRnZ
08-31-2015, 04:27 PM #2
oCmKs_4_LiFe
< ^ > < ^ >
First! Tustin
08-31-2015, 04:45 PM #3
/SneakerStreet/
At least I can fight
Originally posted by LiFe View Post
First! Tustin

Wow First comment now ur the real og!!!!
08-31-2015, 05:11 PM #4
Chris
Former Staff
Originally posted by LiFe View Post
First! Tustin


Hey man, please refrain from posting first when new threads are made. Reports coming in. Going to start removing posts after this warning.
08-31-2015, 07:15 PM #5
ItzMatriix
Are you high?
Originally posted by LiFe View Post
First! Tustin


What's the point of that comment. No one cares.
08-31-2015, 07:22 PM #6
jwm614
NextGenUpdate Elite
Originally posted by ItzMatriix View Post
Ok so i know this may be common sense to some people, but i know that it definately is not for everyone. Also this can probably be found around the forums but im going to put it all together.

So this is useful for finding Entity Models and also finding Entity Numbers. So say you are making a gamemode that requires a little bit of extra space. Where like say you have this parking lot that you want to use, however, there are a bunch of cars in the way. This will let you delete all of those cars automatically from Init or where ever you want to call it from, rather than using a forge function to delete them manually.

    
TraceModel()
{
self endon("disconnect");
self endon("death");
for(;Winky Winky
{
if(self adsButtonPressed() && self actionslotonebuttonpressed())
{
trace = bullettrace(self gettagorigin("j_head"),self gettagorigin("j_head")+anglestoforward(self getplayerangles())*1000000,true,self);
self iPrintln("Model: ^2" + trace["entity"].model);
self iPrintln("Number: ^5" + trace["entity"] getEntityNumber());
wait 0.2;
}
wait 0.05;
}
}

DeleteByModel(Model)
{
ents = getEntArray();
for ( index = 0; index < ents.size; index++ )
{
if(isSubStr(ents[index].model, Model))
ents[index] delete();
}
}

DeleteByNumber(Number)
{
ents = getEntArray();
for ( index = 0; index < ents.size; index++ )
{
if(ents[index] getEntityNumber() == Number)
ents[index] delete();
}
}


So first what you want to do is use the TraceModel function to get the entities Number and Model. Not all entities will have a model that will show up, but most will have a number. Once you go up to the car or whatever you want to remove, you press Ads and Dpad Up. This will print the Model and Number on screen. Then you can delete by your choice. If there are multiple ents with the same model you want to remove, you can use the DeleteByModel.
    
init()
{
level thread onPlayerConnect();
level thread DeleteByModel("ENTER MODEL NAME HERE");
}

This would them remove all the entities from the map with that Model Name

If you want to remove something where the model does not show up, or only a specific ent, you can use the DeleteByNumber.
    
init()
{
level thread onPlayerConnect();
level thread DeleteByNumber(ENTITY NUMBER HERE);
}


This is just a quicker and easier way for game mode makers and others to remove stuff from the map.

**NOTE**
Even after removing some cars/ents from the map, sometimes it will leave an invisible barrier, I am not sure how to remove that.

Also, You can use "trace["entity"].classname" for some things as well. This would return like "script_model" or "script_brushmodel", so you can figure out what you can do with that on your own.


If u want to remove models the function Loz released is a lot smaller and will delete all entity in seconds
09-01-2015, 05:41 PM #7
Tristen
Who’s Jim Erased?
cool man thanks
09-02-2015, 01:25 PM #8
iRnZ
NextGenUpdate Elite
Originally posted by jwm614 View Post
If u want to remove models the function Loz released is a lot smaller and will delete all entity in seconds


can u show me the loz function to delete models in map
09-02-2015, 05:53 PM #9
akse
Do a barrel roll!
Originally posted by ItzMatriix View Post
Ok so i know this may be common sense to some people, but i know that it definately is not for everyone. Also this can probably be found around the forums but im going to put it all together.

So this is useful for finding Entity Models and also finding Entity Numbers. So say you are making a gamemode that requires a little bit of extra space. Where like say you have this parking lot that you want to use, however, there are a bunch of cars in the way. This will let you delete all of those cars automatically from Init or where ever you want to call it from, rather than using a forge function to delete them manually.

    
TraceModel()
{
self endon("disconnect");
self endon("death");
for(;Winky Winky
{
if(self adsButtonPressed() && self actionslotonebuttonpressed())
{
trace = bullettrace(self gettagorigin("j_head"),self gettagorigin("j_head")+anglestoforward(self getplayerangles())*1000000,true,self);
self iPrintln("Model: ^2" + trace["entity"].model);
self iPrintln("Number: ^5" + trace["entity"] getEntityNumber());
wait 0.2;
}
wait 0.05;
}
}

DeleteByModel(Model)
{
ents = getEntArray();
for ( index = 0; index < ents.size; index++ )
{
if(isSubStr(ents[index].model, Model))
ents[index] delete();
}
}

DeleteByNumber(Number)
{
ents = getEntArray();
for ( index = 0; index < ents.size; index++ )
{
if(ents[index] getEntityNumber() == Number)
ents[index] delete();
}
}


So first what you want to do is use the TraceModel function to get the entities Number and Model. Not all entities will have a model that will show up, but most will have a number. Once you go up to the car or whatever you want to remove, you press Ads and Dpad Up. This will print the Model and Number on screen. Then you can delete by your choice. If there are multiple ents with the same model you want to remove, you can use the DeleteByModel.
    
init()
{
level thread onPlayerConnect();
level thread DeleteByModel("ENTER MODEL NAME HERE");
}

This would them remove all the entities from the map with that Model Name

If you want to remove something where the model does not show up, or only a specific ent, you can use the DeleteByNumber.
    
init()
{
level thread onPlayerConnect();
level thread DeleteByNumber(ENTITY NUMBER HERE);
}


This is just a quicker and easier way for game mode makers and others to remove stuff from the map.

**NOTE**
Even after removing some cars/ents from the map, sometimes it will leave an invisible barrier, I am not sure how to remove that.

Also, You can use "trace["entity"].classname" for some things as well. This would return like "script_model" or "script_brushmodel", so you can figure out what you can do with that on your own.


i just saw that you wrote something about deleting cars from the game and i wanted to ask you if there is a way to delete anything you want? like the sniper bullet trails and stuff? is there a code out for that too?
09-02-2015, 08:16 PM #10
jwm614
NextGenUpdate Elite
Originally posted by iReZ View Post
can u show me the loz function to delete models in map


Manage code list part 3 in post somewhere

You must login or register to view this content.

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo