05.06.2010, 19:45
How do i make a timer without making the timer?
Ex:
/command - does something
After 10 secs, it says "You are doing something"
after 20 says same thing
It says samething every 10 secs until the 60 second marker
At 60 secs = "You are done doing something"
Help?
Script:
For..
I've tried replacing with < or > etc but still doesn't even show msgs.
Ex:
/command - does something
After 10 secs, it says "You are doing something"
after 20 says same thing
It says samething every 10 secs until the 60 second marker
At 60 secs = "You are done doing something"
Help?
Script:
Код:
if(strcmp(cmd, "/mine", true) == 0) if(Logged[playerid] == 1) { if(Job[playerid] == MW) // 12 engineer 11 mineworker { if(MM[playerid] == 0) return scm(playerid,cr,"[ ! ] You are not at the mining area!"); if(Mine[playerid] == 1) return SendClientMessage(playerid,cr,"[ ! ] Already mining !"); Mine[playerid] = 1; SendClientMessage(playerid,COLOR_YELLOW,"[ ! ] ..:Mining in progress:.."); minemsg[playerid] = gettime(); if((gettime()-minemsg[playerid]) == 50) { SendClientMessage(playerid,COLOR_YELLOW,"[ ! ] ..:Mining in progress:.."); if(MM[playerid] == 0) { scm(playerid,cr,"[ ! ] You left the mining area, job canceled !"); return 1; } } if((gettime()-minemsg[playerid]) == 40) { SendClientMessage(playerid,COLOR_YELLOW,"[ ! ] ..:Mining in progress:.."); if(MM[playerid] == 0) { scm(playerid,cr,"[ ! ] You left the mining area, job canceled !"); return 1; } } if((gettime()-minemsg[playerid]) == 30) { SendClientMessage(playerid,COLOR_YELLOW,"[ ! ] ..:Mining in progress:.."); if(MM[playerid] == 0) { scm(playerid,cr,"[ ! ] You left the mining area, job canceled !"); return 1; } } if((gettime()-minemsg[playerid]) == 20) { SendClientMessage(playerid,COLOR_YELLOW,"[ ! ] ..:Mining in progress:.."); if(MM[playerid] == 0) { scm(playerid,cr,"[ ! ] You left the mining area, job canceled !"); return 1; } } if((gettime()-minemsg[playerid]) == 10) { SendClientMessage(playerid,COLOR_YELLOW,"[ ! ] ..:Mining in progress:.."); if(MM[playerid] == 0) { scm(playerid,cr,"[ ! ] You left the mining area, job canceled !"); return 1; } } if((gettime()-minemsg[playerid]) == 60) { if(MM[playerid] == 0) { scm(playerid,cr,"[ ! ] You left the mining area, job canceled !"); return 1; } moneys = Mlvl[playerid]; if(Mlvl[playerid] == 0) { if(Mine[playerid] == 0) return 1; Mineral[playerid] = Mineral[playerid] + 1; format(string,sizeof(string),"[ ! ] Mining finished ! You get 1 mineral !"); SendClientMessage(playerid,COLOR_YELLOW,string); SendClientMessage(playerid,COLOR_GREEN,"[ ! ] Mining level +1 !"); Mlvl[playerid] = Mlvl[playerid] + 1; Mine[playerid] = 0; return 1; } else if(Mlvl[playerid] > 0) { if(Mine[playerid] == 0) return 1; Mineral[playerid] = Mineral[playerid] + moneys; format(string,sizeof(string),"[ ! ] Mining finished ! You get %d minerals !",moneys); SendClientMessage(playerid,COLOR_YELLOW,string); SendClientMessage(playerid,COLOR_GREEN,"[ ! ] Mining level +1 !"); Mlvl[playerid] = Mlvl[playerid] + 1; Mine[playerid] = 0; return 1; } } return 1; } else { SendClientMessage(playerid,COLOR_WHITE,"SERVER: Unknown command."); } return 1; }
Код:
if((gettime()-minemsg[playerid]) == 60)