Raised This Month: $ Target: $400
 0% 

Solved Wait N amount of seconds?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 08-05-2018 , 09:35   Re: Wait N amount of seconds?
Reply With Quote #3

Quote:
Originally Posted by edon1337 View Post
PHP Code:
#include < amxmodx >
#include < fun >

new g_iUseTime;

const 
g_iFreq 15;

public 
plugin_init( )
{    
    
register_clcmd"say /healme""@HealMe" );
}

@
HealMeid )
{
    new 
iTime floatroundget_gametime( ) );
    
    if( 
iTime >= g_iUseTime )
    {
        
g_iUseTime iTime g_iFreq;
        
        
set_user_healthidget_user_healthid ) + 15 );
    }
    
    else
    {
        
client_printidprint_center"You have to wait %d seconds until you can use this again."g_iUseTime iTime );
    }
    
    return 
PLUGIN_HANDLED;

Notice 1: g_iUseTime is single variable so in players this will mess things up
Notice 2: Better use float variable than converting float to int
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM

Last edited by Ghosted; 08-05-2018 at 09:35.
Ghosted 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 12:37.


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