Raised This Month: $ Target: $400
 0% 

Catching 10sec beginning of the round


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 10-25-2009 , 08:18   Re: Catching 10sec beginning of the round
Reply With Quote #3

here some code:
PHP Code:
#include <amxmodx>
#include <hamsandwich>

new g_user_time[33]

public 
plugin_init(){
    
RegisterHam(Ham_Spawn"player""player_spawn"1)
    
register_clcmd("say hi""cmdSayHI")
}

public 
client_connect(id)
    
g_user_time[id] = 0
    
public player_spawn(id)
    if(
is_user_alive(id) && g_user_time[id] <= 0)
        
g_user_time[id] = get_systime()

public 
cmdSayHI(id){
    if(
g_user_time[id] <= 0){
        
//user has not been spawned yet since connect
        
return PLUGIN_CONTINUE
    
}
    if(
get_systime() - g_user_time[id] > 10){
        
//at least 10 seconds passed since user first spawn
        
client_print(idprint_chat"10 seconds already passed.")
        return 
PLUGIN_HANDLED
    
}

    
//user has been spawned and 10 seconds have not passed yet

    
return PLUGIN_CONTINUE

__________________
Impossible is Nothing
Sylwester 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 17:32.


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