Cool down
#2

PHP код:
new
     
Cooldown[MAX_PLAYERS char];
CMD:dive(playeridparams[]) {
    if(
Cooldown{playerid} > gettime())
        return 
SendClientMessage(playeridCOLOR_GREEN"You already dived!");
    new 
highness;
    if(
sscanf(params,"i",highness))return SendClientMessage(playerid,COLOR_GREEN,"/dive [high 100-800]");
    if (
highness 100 || highness 800) return SendClientMessage(playerid,COLOR_GREEN,"/dive [high 100-800]");//COLOR_BROWN
    
SendClientMessage(playerid,COLOR_RED,"You dive. Enjoy.");
    new 
Float:x,Float:y,Float:z;
    
GetPlayerPos(playerid,x,y,z);
    
SetPlayerPos(playerid,x,y,z+highness);
    
GivePlayerWeapon(playerid461);
    
SendAdminCMD(playerid"dive");
    
Cooldown{playerid} = gettime() + 60;
    return 
1;

@oma Your code will still execute and then print the error message.
Reply


Messages In This Thread
Cool down - by Xdrime - 22.05.2016, 12:48
Re: Cool down - by J0sh... - 22.05.2016, 12:50
Re: Cool down - by oMa37 - 22.05.2016, 12:50
Re: Cool down - by MBilal - 22.05.2016, 12:53
Re: Cool down - by Xdrime - 22.05.2016, 13:01
Re: Cool down - by Xdrime - 22.05.2016, 13:04
Re: Cool down - by J0sh... - 22.05.2016, 13:55
Re: Cool down - by Konstantinos - 22.05.2016, 14:03
Re: Cool down - by J0sh... - 22.05.2016, 14:11

Forum Jump:


Users browsing this thread: 1 Guest(s)