Raised This Month: $ Target: $400
 0% 

how to find an index of entities in the map?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
JerryJerryAdios
Member
Join Date: Jun 2015
Location: the universe
Old 06-13-2015 , 01:53   how to find an index of entities in the map?
Reply With Quote #1

Hello guys, i'd like to find an entity index of a model in the game, but i have tried different ways doing this, the results were all failed.

do you have a good idea to do this? i will appreciate for your helps! thanks!

my problem: i want to find the Dragon's entity index(there are picture and my code below)

the model path is: esf/models/evolution/shenlong.mdl (i'm sure the path is alright!)

my code:
PHP Code:
#include <amxmodx>
#include <engine>
#include <fakemeta>

#define PLUGIN_NAME "plugin"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "author" 

public plugin_init()
{
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR);
    
register_clcmd("tt","test")
}

public 
test(id//when the model has spawned in the map, i will input the command "tt" to search the entity

    new 
iEnt
    
if( ( iEnt engfuncEngFunc_FindEntityByStringiEnt"model""models/evolution/shenlong.mdl" ) ) > )
    {        
    
set_pev(idpev_health50.0)
    }
/* This is another way, but it's also no use.
    new Float:vOrigin[3]; 
    entity_get_vector( id, EV_VEC_origin, vOrigin ); 

    new ent = find_ent_in_sphere( -1, vOrigin, 1164.0 ); 

    while( ent > 0 ) 
    { 
    new szModel[32]; 
    entity_get_string( ent, EV_SZ_model, szModel, 31 ); 
    if( containi( szModel, "shenlong.mdl" ) != -1 ) 
    { 
    set_pev(id, pev_health, 50.0)
    entity_set_float(ent, EV_FL_framerate, 1.0);
    entity_set_int(ent, EV_INT_sequence, 4);

    set_pev( ent, pev_controller, 125 )    
    set_pev( ent, pev_controller_0, 125 )
    set_pev( ent, pev_controller_1, 125 )
    set_pev( ent, pev_controller_2, 125 )
    set_pev( ent, pev_controller_3, 125 )
    } 
    ent = find_ent_in_sphere( ent, vOrigin, 1164.0 ); 
    } 
*/
return PLUGIN_CONTINUE;

this is that Dragon model:


Thanks again
__________________
This is a Super Awesome Asking Guy! Don't mind alright? Just be cool!
JerryJerryAdios is offline
Send a message via Skype™ to JerryJerryAdios
Decak
Senior Member
Join Date: Sep 2012
Old 06-13-2015 , 05:05   Re: how to find an index of entities in the map?
Reply With Quote #2

http://amxmodx.org/doc/index.html?pa...t_by_model.htm ??
Decak is offline
JerryJerryAdios
Member
Join Date: Jun 2015
Location: the universe
Old 06-13-2015 , 06:14   Re: how to find an index of entities in the map?
Reply With Quote #3

Quote:
Originally Posted by Decak View Post
[url]@Decak
thanks dude, but it's still no use
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>

#define PLUGIN_NAME "plugin"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "author" 

public plugin_init()
{
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR);
register_clcmd("tt","testt")
}

public 
testt(id)
{
    new 
ent find_ent_by_model (-1"model""models/evolution/shenlong.mdl")
    
set_peventpev_scale10.0)

__________________
This is a Super Awesome Asking Guy! Don't mind alright? Just be cool!
JerryJerryAdios is offline
Send a message via Skype™ to JerryJerryAdios
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 06-13-2015 , 06:59   Re: how to find an index of entities in the map?
Reply With Quote #4

Scaling (ingame) is only possible on sprites.
__________________
Retired.

Last edited by Xalus; 06-13-2015 at 06:59.
Xalus is offline
JerryJerryAdios
Member
Join Date: Jun 2015
Location: the universe
Old 06-13-2015 , 08:45   Re: how to find an index of entities in the map?
Reply With Quote #5

Quote:
Originally Posted by Xalus View Post
Scaling (ingame) is only possible on sprites.
um...in ESF, pev_scale is possible on models
__________________
This is a Super Awesome Asking Guy! Don't mind alright? Just be cool!

Last edited by JerryJerryAdios; 06-13-2015 at 11:21.
JerryJerryAdios is offline
Send a message via Skype™ to JerryJerryAdios
DavidJr
Senior Member
Join Date: Apr 2012
Old 06-13-2015 , 09:20   Re: how to find an index of entities in the map?
Reply With Quote #6

Try with

Code:
new iEnt = fm_find_ent_by_model(-1, "model", "models/evolution/shenlong.mdl");
__________________
What are you looking for here?
DavidJr is offline
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 06-14-2015 , 05:25   Re: how to find an index of entities in the map?
Reply With Quote #7

Quote:
Originally Posted by JerryJerryAdios View Post
um...in ESF, pev_scale is possible on models
No idea what ESF is but, okay. Didn't know.
__________________
Retired.
Xalus is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 06-14-2015 , 10:57   Re: how to find an index of entities in the map?
Reply With Quote #8

Quote:
Originally Posted by Xalus View Post
No idea what ESF is but, okay. Didn't know.
http://esforces.com/
Another HL mod supported by AMXX.
klippy is offline
Reply



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 20:48.


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