07.02.2012, 16:33
Stock was a stupid example it doesnt have to be in one I didnt even return a value.
Just call keep calling it every second. Until the value = 0. I dont know if there is a more efficent way. And you want to call it by player so like
SetTimerEx("function", 1000, true, "i", playerid);
You want to move my stock to a forward and public.
Kill the timer if the value of Time = 0
Remove the Timer I put in the stock that was a stupid place to put it as the timer would have to be false that way causing to to loop and star over instad of looping automaticly
EDIT: Infact I'll add some code here
Somthing like this or you coould use Y_Timers.
Sorry if this isnt well explained I cant really explain things. Also Sorry for my spelling it might be a problem.
Just call keep calling it every second. Until the value = 0. I dont know if there is a more efficent way. And you want to call it by player so like
SetTimerEx("function", 1000, true, "i", playerid);
You want to move my stock to a forward and public.
Kill the timer if the value of Time = 0
Remove the Timer I put in the stock that was a stupid place to put it as the timer would have to be false that way causing to to loop and star over instad of looping automaticly
EDIT: Infact I'll add some code here
pawn Код:
new Time[MAX_PLAYERS];
new FunctionTimer[MAX_PLAYERS];
forward function(playerid);
public function(playerid)
{
new string, Min, sec;
if(Time[playerid] > 0)
{
Time[playerid] --;
sec = ((Time[playerid] * 1000));
Minutes = ((Time[playerid] * 1000) / 60);
format(string, sizeof(string), "%s:%s", Min, sec);
TextDrawSetString(TextDrawDefine, string);
}
else KillTimer(FuntionTimer[playerid]);
return 1;
}
CMD:mycommand(playerid, params[])
{
//code
FuntionTimer[targetid/playerid] = SetTimerEx("function", 1000, true, "i", playerid);
return 1;
}
Sorry if this isnt well explained I cant really explain things. Also Sorry for my spelling it might be a problem.