AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Repeat sprite and follow player (https://forums.alliedmods.net/showthread.php?t=306938)

wicho 04-19-2018 12:06

Repeat sprite and follow player
 
Hi all, well as the title says how I can make a sprite follow the player? and how do I make it repeat several times? What I want to do is make the effect of the led sprite of the c4 (ledglow.spr) but in a player, I try using an infinite task and TE_GLOWSPRITE. The task works well, I mean the sprite is repeated several times but the sprite does not follow the player, when the sprite appears and I go it stays on the last current origin... thx in advance

DarthMan 04-19-2018 12:34

Re: Repeat sprite and follow player
 
Quote:

Originally Posted by wicho (Post 2588488)
Hi all, well as the title says how I can make a sprite follow the player? and how do I make it repeat several times? What I want to do is make the effect of the led sprite of the c4 (ledglow.spr) but in a player, I try using an infinite task and TE_GLOWSPRITE. The task works well, I mean the sprite is repeated several times but the sprite does not follow the player, when the sprite appears and I go it stays on the last current origin... thx in advance

Try TE_SPRITETRAIL or whatever it was called and you won't need a task.

wicho 04-19-2018 18:59

Re: Repeat sprite and follow player
 
That temp entity what it does is that the sprite looks like a tail and it's not what I want, what I want is to simulate the glow led on the player (like the c4) and I want it to come out in a certain event then I want it to be removed, Does anyone know how I can do that?

PHP Code:

#include <amxmodx>
#include <zp50_core>

#define TASK_SPRITE 300
#define ID_SPRITE (taskid - TASK_SPRITE)

new spr_bomb 

public plugin_precache()
{   
    
spr_bomb precache_model("sprites/ledglow.spr"
}

public 
zp_fw_core_cure(idattacker)
{
    
remove_task(id+TASK_SPRITE)
}

public 
zp_fw_core_infect_post(idattacker)
{
    
set_task(2.0"bomb_led"id+TASK_SPRITE__"b")    
}

public 
bomb_led(taskid
{         
    static 
origin[3]
    
get_user_origin(ID_SPRITEorigin)    
    
    
message_begin(MSG_PVSSVC_TEMPENTITYorigin)
    
write_byte(TE_GLOWSPRITE)
    
write_coord(origin[0])
    
write_coord(origin[1])
    
write_coord(origin[2])
    
write_short(spr_bomb)
    
write_byte(1)
    
write_byte(6)
    
write_byte(255)
    
message_end()


I did it like this works but the sprite does not follow the player.


All times are GMT -4. The time now is 04:43.

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