Raised This Month: $ Target: $400
 0% 

Random Player


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
wyrda
Member
Join Date: Nov 2009
Old 01-01-2010 , 11:30   Re: Random Player
Reply With Quote #2

If you want only one player to have his health and gravity changed after that delay this is the code:
PHP Code:
#include <amxmodx>
#include <fun>
#include <amxmisc>

new cvar_delay

new Night_Stalker

public plugin_init( )
{
    
register_plugin"Night Stalker Mod""1.0""Merc3y" )

    
register_logevent"logevent_round_start"2"1=Round_Start" 
    
register_logevent"logevent_round_end"2"1=Round_End" 
    
    
register_concmd"amx_nightstalker""Toggle"ADMIN_LEVEL_D" < 1 = on | 0 = off >" )
    
register_cvar"nightstalker_toggle""0" )

    
cvar_delay register_cvar"ns_delay""10.0" )

    
}

public 
Game_Startid )
{
    new 
players32 ], num
    get_players
playersnum"a" )
    
Night_Stalker playersrandom_num0num-) ]
    if(
is_user_alive(Night_Stalker))
        
StatsNight_Stalker )
}

public 
Statsid )
{
    
set_user_healthNight_Stalker250 )
    
set_user_gravityNight_Stalker0.7 )


public 
Toggleidlevelcid )
{
    if ( !
cmd_accessidlevelcid) )
    {
        return 
PLUGIN_HANDLED
    
}
    new 
arg132 ]
    
read_argv1arg131 )
    if ( 
str_to_numarg1 ) )
    {
            
set_cvar_num"nightstalker_toggle")
            
server_cmd"sv_restartround 10" )
    } 

    else
    {
            
set_cvar_num"nightstalker_toggle")
            
server_cmd"sv_restartround 10" )
    }       
    return 
PLUGIN_HANDLED
}

public 
logevent_round_start( )
{    
        if ( 
get_cvar_num"nightstalker_toggle" ) == )
        {
            
set_taskget_pcvar_floatcvar_delay ), "Game_Start" )
        }   
}

public 
logevent_round_end( )
{
   public 
logevent_round_end( )
{
    
is_user_connected(Night_Stalker)
    {
        if(
is_user_alive(Night_Stalker))
            
set_user_healthNight_Stalker100 )
        
set_user_gravityNight_Stalker1.0 )
    }
}

also at the end of the round if he is alive his life will be restored to 100(even I think that this is not necessary)
__________________

Last edited by wyrda; 01-01-2010 at 11:55.
wyrda is offline
 



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 04:07.


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