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

Repeat sprite and follow player


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wicho
Veteran Member
Join Date: Feb 2012
Location: GuateAmala
Old 04-19-2018 , 12:06   Repeat sprite and follow player
Reply With Quote #1

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
wicho is offline
DarthMan
Veteran Member
Join Date: Aug 2011
Old 04-19-2018 , 12:34   Re: Repeat sprite and follow player
Reply With Quote #2

Quote:
Originally Posted by wicho View Post
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.

Last edited by DarthMan; 04-19-2018 at 12:34.
DarthMan is offline
wicho
Veteran Member
Join Date: Feb 2012
Location: GuateAmala
Old 04-19-2018 , 18:59   Re: Repeat sprite and follow player
Reply With Quote #3

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.

Last edited by wicho; 04-19-2018 at 19:13.
wicho 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 17:22.


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