AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Simple Solution for Sprite Trail (https://forums.alliedmods.net/showthread.php?t=204864)

Kia 01-04-2013 08:28

Simple Solution for Sprite Trail
 
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?

ANTICHRISTUS 01-04-2013 10:02

Re: Simple Solution for Sprite Trail
 
maybe you'll find an answer in the plugin called: Nice player trail.

micapat 01-04-2013 10:46

Re: Simple Solution for Sprite Trail
 
Te_beamfollow

Kia 01-04-2013 11:53

Re: Simple Solution for Sprite Trail
 
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)
}

micapat 01-04-2013 12:11

Re: Simple Solution for Sprite Trail
 
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

Kia 01-04-2013 12:44

Re: Simple Solution for Sprite Trail
 
And what color do I use when I want to show the sprite in its original color?


All times are GMT -4. The time now is 13:42.

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