Raised This Month: $ Target: $400
 0% 

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


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
axelnieves2012
Senior Member
Join Date: Oct 2014
Location: Argentina
Old 01-08-2015 , 01:00   [Help] How do I get entity ID by string?
Reply With Quote #1

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
axelnieves2012 is offline
RateX
Veteran Member
Join Date: Jun 2012
Location: 0o. SEA .o0
Old 01-08-2015 , 04:10   Re: [Help] How do I get entity ID by string?
Reply With Quote #2

https://wiki.alliedmods.net/Finding_...d_ent_by_model
RateX is offline
axelnieves2012
Senior Member
Join Date: Oct 2014
Location: Argentina
Old 01-09-2015 , 01:44   Re: [Help] How do I get entity ID by string?
Reply With Quote #3

Quote:
Originally Posted by RateX View Post
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

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

Last edited by axelnieves2012; 01-09-2015 at 01:46.
axelnieves2012 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-09-2015 , 10:58   Re: [Help] How do I get entity ID by string?
Reply With Quote #4

Quote:
Originally Posted by axelnieves2012 View Post
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

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.
__________________
HamletEagle is offline
RateX
Veteran Member
Join Date: Jun 2012
Location: 0o. SEA .o0
Old 01-09-2015 , 03:57   Re: [Help] How do I get entity ID by string?
Reply With Quote #5

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.
RateX is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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