Why This Code Not Work !
#4

Hello.

Always when you type "/accept die" DieTimer will have the value 0 because you create this variable there.
So you should do it like this:
PHP код:
if(strcmp(params"die"true) == 0) {
    static 
DieTimer[MAX_PLAYERS];
    if(
gettime() < DieTimer[playerid])
    {
        
format(stringsizeof(string), "Ban phai doi %d giay moi co the chet."DieTimer[playerid]-gettime());
        
SendClientMessageEx(playeridCOLOR_GREYstring);
        return 
1;
    }
    
DieTimer[playerid] = gettime()+30;
    if(
GetPVarInt(playerid"Injured") == 1) {
        
SendClientMessageEx(playeridCOLOR_WHITE"You A Dead.");
        
KillEMSQueue(playerid);
        
ResetPlayerWeaponsEx(playerid);
        
SpawnPlayer(playerid);
    }
    else { 
SendClientMessageEx(playeridCOLOR_GREY" u cannot do that right now!"); }

Try this. I think static will help you.
Reply


Messages In This Thread
Why This Code Not Work ! - by TYDS - 29.10.2016, 08:30
Re: Why This Code Not Work ! - by StrikerZ - 29.10.2016, 08:42
Re: Why This Code Not Work ! - by TYDS - 29.10.2016, 10:16
Re: Why This Code Not Work ! - by Mencent - 29.10.2016, 10:33
Re: Why This Code Not Work ! - by TYDS - 29.10.2016, 10:37
Re: Why This Code Not Work ! - by Mencent - 29.10.2016, 10:38
Re: Why This Code Not Work ! - by TYDS - 29.10.2016, 10:40
Re: Why This Code Not Work ! - by TYDS - 29.10.2016, 11:06
Re: Why This Code Not Work ! - by StrikerZ - 29.10.2016, 11:49
Re: Why This Code Not Work ! - by HoangNam - 29.10.2016, 12:53

Forum Jump:


Users browsing this thread: 1 Guest(s)