AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Help] How do I get entity ID by string? (https://forums.alliedmods.net/showthread.php?t=254905)

axelnieves2012 01-08-2015 01:00

[Help] How do I get entity ID by string?
 
Hello, I need to get an entity ID by typing its model path. For example, how do I get "models/parachute.mdl" 's entity ID?

Thanks

RateX 01-08-2015 04:10

Re: [Help] How do I get entity ID by string?
 
https://wiki.alliedmods.net/Finding_...d_ent_by_model

axelnieves2012 01-09-2015 01:44

Re: [Help] How do I get entity ID by string?
 
Quote:

Originally Posted by RateX (Post 2246324)

Hello!!!! emm i have already read that. I ask for help because i dont understand. That tutorial is very poor and incomplete.

What function should I use?
What is "target" and "targetname"?????

That page has no example. It says:
PHP Code:

find_ent_by_model(-1,"classname_to_find","model_to_find"

but it doesn't tell how "model_to_find" must be input (it could be "parachute", "parachute.mdl", "models/parachute.mdl"). A real working example would be appreciated instead of "model_to_find", "class_to_find", "target_to_find", blablabla. It is useless :down: :down: :down:

I need an example like:
PHP Code:

find_ent_by_model(-1,"primaryweapon""models/w_ak47.mdl"

(i dont know if it should be "models/w_ak47.mdl", "weapon_ak47", "w_ak47", etc. That's why that guide is poor.)
Why first parmeter is -1 ?


Thanks a lot mate

RateX 01-09-2015 03:57

Re: [Help] How do I get entity ID by string?
 
Quote:

What function should I use?
What is "target" and "targetname"?????
What are you talking about?
Quote:

That page has no example. It says:

but it doesn't tell how "model_to_find" must be input (it could be "parachute", "parachute.mdl", "models/parachute.mdl"). A real working example would be appreciated instead of "model_to_find", "class_to_find", "target_to_find", blablabla. It is useless
Did you search on the forum?
Some classnames: http://twhl.info/wiki.php?sub=2, http://twhl.info/wiki.php?sub=1
The rest can be found in already made plugins.
Quote:

Why first parmeter is -1 ?
This is the start entity, the funtion will loop through all entity when called.

HamletEagle 01-09-2015 10:58

Re: [Help] How do I get entity ID by string?
 
Quote:

Originally Posted by axelnieves2012 (Post 2246733)
Hello!!!! emm i have already read that. I ask for help because i dont understand. That tutorial is very poor and incomplete.

What function should I use?
What is "target" and "targetname"?????

That page has no example. It says:
PHP Code:

find_ent_by_model(-1,"classname_to_find","model_to_find"

but it doesn't tell how "model_to_find" must be input (it could be "parachute", "parachute.mdl", "models/parachute.mdl"). A real working example would be appreciated instead of "model_to_find", "class_to_find", "target_to_find", blablabla. It is useless :down: :down: :down:

I need an example like:
PHP Code:

find_ent_by_model(-1,"primaryweapon""models/w_ak47.mdl"

(i dont know if it should be "models/w_ak47.mdl", "weapon_ak47", "w_ak47", etc. That's why that guide is poor.)
Why first parmeter is -1 ?


Thanks a lot mate

Then start testing and stop being lazy, you will find the answer.


All times are GMT -4. The time now is 15:31.

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