Raised This Month: $ Target: $400
 0% 

[SOLVED][NPC] Is it possible to add aura on it?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Excalibur.007
Veteran Member
Join Date: Sep 2009
Location: Singapore
Old 03-05-2010 , 05:32   [SOLVED][NPC] Is it possible to add aura on it?
Reply With Quote #1

Solved. Thanks Arkshine & Lazarev

Last edited by Excalibur.007; 03-05-2010 at 06:09.
Excalibur.007 is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 03-05-2010 , 05:43   Re: [NPC] Is it possible to add aura on it?
Reply With Quote #2

NPC is an entity and get_user_origin works only with players.

If you take a look at that tutorial in your link then there is already used some way to get / set entity origin (the 3rd code block)...
__________________
Impossible is Nothing
Sylwester is offline
Excalibur.007
Veteran Member
Join Date: Sep 2009
Location: Singapore
Old 03-05-2010 , 05:52   Re: [NPC] Is it possible to add aura on it?
Reply With Quote #3

Hmm
I still don't understand how to get a origin of a entity i tried with this
PHP Code:
entity_get_vectorentEV_VEC_originorigin 
but it returns a float(Meaning I will get 4 tag mismatch for the origin)
EDIT: Same goes for pev_origin
Excalibur.007 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 03-05-2010 , 06:00   Re: [NPC] Is it possible to add aura on it?
Reply With Quote #4

If you retrieve a float, use engfunc( EngFunc_WriteCoord, origin[ 0 ] ) for example.
__________________
Arkshine is offline
lazarev
Veteran Member
Join Date: Sep 2008
Old 03-05-2010 , 06:00   Re: [NPC] Is it possible to add aura on it?
Reply With Quote #5

240 radius is uber big you will get low fps & lags, 40 is fine =)
PHP Code:
public fwdThinkiEntity 
{
    if( !
pev_validiEntity ) ) return FMRES_IGNORED;
    static 
szClassname32 ];
    
peviEntitypev_classnameszClassname31 );
    
    if( 
equalszClassnamegszClassName ) )
    {
        new 
Float:vOrigin];
        
peviEntitypev_originvOrigin );
        
        
message_begin(MSG_BROADCASTSVC_TEMPENTITY);
        
write_byte(TE_DLIGHT);
        
engfunc(EngFunc_WriteCoordvOrigin[0]);
        
engfunc(EngFunc_WriteCoordvOrigin[1]);
        
engfunc(EngFunc_WriteCoordvOrigin[2]);
        
write_byte(20);        // radius in 10's
        
write_byte(255);        // R
        
write_byte(255);        // G
        
write_byte(255);        // B
        
write_byte(3);      // life
        
write_byte(10);        // decay rate
        
message_end();

        
set_peviEntitypev_nextthinkget_gametime() + 0.1 );
    }
    return 
FMRES_IGNORED;


Last edited by lazarev; 03-05-2010 at 06:03.
lazarev is offline
Excalibur.007
Veteran Member
Join Date: Sep 2009
Location: Singapore
Old 03-05-2010 , 06:01   Re: [NPC] Is it possible to add aura on it?
Reply With Quote #6

Thanks arkshine & lazarev. It works
Solved.

Last edited by Excalibur.007; 03-05-2010 at 06:09.
Excalibur.007 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 08:47.


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