AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [SOLVED][NPC] Is it possible to add aura on it? (https://forums.alliedmods.net/showthread.php?t=120459)

Excalibur.007 03-05-2010 05:32

[SOLVED][NPC] Is it possible to add aura on it?
 
Solved. Thanks Arkshine & Lazarev

Sylwester 03-05-2010 05:43

Re: [NPC] Is it possible to add aura on it?
 
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)...

Excalibur.007 03-05-2010 05:52

Re: [NPC] Is it possible to add aura on it?
 
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

Arkshine 03-05-2010 06:00

Re: [NPC] Is it possible to add aura on it?
 
If you retrieve a float, use engfunc( EngFunc_WriteCoord, origin[ 0 ] ) for example.

lazarev 03-05-2010 06:00

Re: [NPC] Is it possible to add aura on it?
 
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;



Excalibur.007 03-05-2010 06:01

Re: [NPC] Is it possible to add aura on it?
 
Thanks arkshine & lazarev. It works :)
Solved.


All times are GMT -4. The time now is 08:47.

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