Raised This Month: $ Target: $400
 0% 

Simple Solution for Sprite Trail


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 01-04-2013 , 08:28   Simple Solution for Sprite Trail
Reply With Quote #1

Hello everybody,

I'm looking for a simple solution to attach a trail to a player using a sprite file.
E.g. Player X is selecting Rainbow Sprite from menu ( File : rainbow.spr ) and then the player gets a trail using the sprite file.

Anyone knows how to make something like this?
__________________
Kia is offline
ANTICHRISTUS
kingdom of weird stuff
Join Date: Jun 2010
Location: My kingdom is not in thi
Old 01-04-2013 , 10:02   Re: Simple Solution for Sprite Trail
Reply With Quote #2

maybe you'll find an answer in the plugin called: Nice player trail.
__________________
ANTICHRISTUS is offline
micapat
Veteran Member
Join Date: Feb 2010
Location: Nyuu, nyuu (France).
Old 01-04-2013 , 10:46   Re: Simple Solution for Sprite Trail
Reply With Quote #3

Te_beamfollow
__________________

Last edited by micapat; 01-04-2013 at 10:46.
micapat is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 01-04-2013 , 11:53   Re: Simple Solution for Sprite Trail
Reply With Quote #4

Like this?

Quote:
public set_user_trail(id, sprite, lifetime)
{
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(22) // TE_BEAMFOLLOW
write_short(id)
write_short(sprite)
write_byte(lifetime)
}
__________________
Kia is offline
micapat
Veteran Member
Join Date: Feb 2010
Location: Nyuu, nyuu (France).
Old 01-04-2013 , 12:11   Re: Simple Solution for Sprite Trail
Reply With Quote #5

More like that:

PHP Code:
stock UTIL_BeamFollowiEntityiSpriteiLifeiWidthiColoriBrightness )
{
    
message_beginMSG_BROADCASTSVC_TEMPENTITY );
        
write_byteTE_BEAMFOLLOW );
        
write_shortiEntity );
        
write_shortiSprite );
        
write_byteiLife );
        
write_byteiWidth );
        
write_byte(( iColor >> 16 ) & 0xFF );
        
write_byte(( iColor >> 8) & 0xFF );
        
write_byteiColor 0xFF );
        
write_byteiBrightness );
    
message_end( );

Example :

PHP Code:
UTIL_BeamFollowplayermy_sprite15 /* = 1,5 seconds */100xFF0000 /* = RED */255 ); 
For colors, see for instance : http://www.javascripter.net/faq/rgbtohex.htm
__________________

Last edited by micapat; 01-04-2013 at 12:11.
micapat is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 01-04-2013 , 12:44   Re: Simple Solution for Sprite Trail
Reply With Quote #6

And what color do I use when I want to show the sprite in its original color?
__________________
Kia 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 13:42.


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