Why This Code Not Work !
#2

PHP код:
if(strcmp(params"die"true) == 0)
{
           new 
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;
           }
           else
           {
               
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!");
                }
            }

The reason why your code didn't worked was cuz when you type /accept die then the dietimer gets activated. And then the if statement of gettime() executes making the command stop. So you should use else after the if gettime statement i.e player typed /accept die if timer was there then it will stop else if there was no timer then the timer gets activated along with your code.
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)