AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   find ent by model (https://forums.alliedmods.net/showthread.php?t=5921)

Kurai-Domi 09-16-2004 12:20

find ent by model
 
i want to find an entity,but i only know the modelname not the classname, how can i do this?

Johnny got his gun 09-18-2004 06:22

How come you don't know the classname?

Ingram 09-18-2004 11:56

well if hes looking for an actual model its probably env_model, cycler, or a player

Votorx 09-18-2004 16:30

Eh well if you don't know the model then you can go through each ent in the game and get and compare the model names, then whichever one matches your model, that's the ent you were looking for.

Ingram 09-18-2004 20:22

i think u'd be better off running through every ent, and checking it than running this command like 50 times

Votorx 09-18-2004 21:24

Did I not just say that? -.-

Johnny got his gun 09-19-2004 06:56

Yep something like

Code:
new const MAXENTS = get_global_int(GL_maxEntities) for(new ent = 1; ent < MAXENTS; ent++) {     if (!is_valid_ent(ent))         continue     // check model here }


All times are GMT -4. The time now is 17:18.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.