Quote:
Originally Posted by edon1337
PHP Code:
#include < amxmodx > #include < fun >
new g_iUseTime;
const g_iFreq = 15;
public plugin_init( ) { register_clcmd( "say /healme", "@HealMe" ); }
@HealMe( id ) { new iTime = floatround( get_gametime( ) ); if( iTime >= g_iUseTime ) { g_iUseTime = iTime + g_iFreq; set_user_health( id, get_user_health( id ) + 15 ); } else { client_print( id, print_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
__________________