Raised This Month: $ Target: $400
 0% 

[HELP] Laser Beam [Nightcrawler]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
NiceGuyx
Senior Member
Join Date: Nov 2011
Old 12-23-2011 , 18:24   [HELP] Laser Beam [Nightcrawler]
Reply With Quote #1

Hello, i want know why after i say /lg the laser show in 1sec and disappear
I want it to disappear only if player is dead

PHP Code:
register_clcmd("say /lg""laser_green")                

public 
laser_greenid )
    {
        if( !
is_user_aliveid ) )
            return;

                static 
iRediGreeniBlueiWeapon;                
            
                
iWeapon get_user_weaponid );
            
                if( 
IsPrimaryWeaponiWeapon ) || IsSecondaryWeaponiWeapon ) )


                        {
                        
iRed 0;
                        
iGreen 255;
                        
iBlue 0;
                    }
                    
                    static 
iOrigin];
                    
get_user_originidiOrigin);
                    
                    
message_beginMSG_BROADCASTSVC_TEMPENTITY );
                    
write_byteTE_BEAMENTPOINT );
                    
write_shortid 0x1000 );
                    
write_coordiOrigin] );
                    
write_coordiOrigin] );
                    
write_coordiOrigin] );
                    
write_shortg_iLaserSprite );
                    
write_byte);
                    
write_byte10 );
                    
write_byte);
                    
write_byte);
                    
write_byte);
                    
write_byteiRed );
                    
write_byteiGreen );
                    
write_byteiBlue );
                    
write_byte150 );
                    
write_byte25 );
                    
message_end( );

NiceGuyx is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 12-23-2011 , 19:07   Re: [HELP] Laser Beam [Nightcrawler]
Reply With Quote #2

You didn't set the time in the message properly.

Also, any message can last to the maximum of 255 (should be 25,5 seconds, but it always was around 8 seconds for me - don't know why) , so you have to recreate it every time it is destroyed. You also want to check if the player is alive in the re-creating process.
If you want to make it more accurate, set the life to 10 (1 second) and recreate it every 1 second; thus the beam won't be on player's dead body when they die for up to 25,5 seconds ( 8 ).

Last edited by Backstabnoob; 12-23-2011 at 19:07.
Backstabnoob is offline
Reply


Thread Tools
Display Modes

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 11:52.


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