Raised This Month: $ Target: $400
 0% 

Spawn a Info_Target


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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 00:13.


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