Raised This Month: $51 Target: $400
 12% 

Spawn a Info_Target


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 07-22-2010 , 05:28   Spawn a Info_Target
Reply With Quote #1

hello guys,

i try to spawn a info_target with a model but the i cant see the model then i type /a..

PHP Code:
public lol(id)
{
            new 
origin[3]
            
get_user_origin(idorigin0)
            
            
            new 
ent engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target")) 

            if(!
pev_valid(ent)) return 

            engfunc
(EngFunc_SetModelent"models\akirby.mdl"
            
engfunc(EngFunc_SetOriginentorigin)
            
            return 
PLUGIN_CONTINUE

my second question is: How can i set a classname? I need it, because i wanna do something when the player touches the model...








Edit. I also tried this version:
PHP Code:
new const classname[] = "kirby"
new const model[] = "models/akirby.mdl"

            
new float:origin[3]
            
get_user_origin(idorigin0)
            
            new 
iKirby create_entity("info_target")
            
            if(!
is_valid_ent(iKirby))
                return 
PLUGIN_CONTINUE;
                
            
entity_set_stringiKirbyEV_SZ_classnameclassname);
            
entity_set_intiKirbyEV_INT_solidSOLID_TRIGGER );
            
entity_set_vectoriKirbyEV_VEC_originorigin);
            
entity_set_modeliKirbymodel);    
            return 
PLUGIN_CONTINUE;


public 
plugin_precache()
    
precache_model(model
but the model also dont spawn...
__________________
Quote:
#define true ((rand() % 2)? true: false) //Happy debugging suckers

Last edited by mottzi; 07-22-2010 at 05:34.
mottzi is offline
Send a message via MSN to mottzi
Peoples Army
SourceMod Donor
Join Date: Mar 2007
Old 07-22-2010 , 07:01   Re: Spawn a Info_Target
Reply With Quote #2

Ok well first , to make sure that your entity is actually being created , after your create entity code , add something like this

PHP Code:


client_print
(client ,print_chat"%i"ent); 
That should print out the id of the entity you created
__________________
Peoples Army 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 10:06.


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