Time Left Textdraw
#8

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

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;
}
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.
Reply


Messages In This Thread
Time Left Textdraw - by vassilis - 07.02.2012, 16:00
Re: Time Left Textdraw - by Konstantinos - 07.02.2012, 16:03
Re: Time Left Textdraw - by vassilis - 07.02.2012, 16:07
Re: Time Left Textdraw - by IceCube! - 07.02.2012, 16:08
Re: Time Left Textdraw - by vassilis - 07.02.2012, 16:12
Re: Time Left Textdraw - by Konstantinos - 07.02.2012, 16:16
Re: Time Left Textdraw - by vassilis - 07.02.2012, 16:28
Re: Time Left Textdraw - by IceCube! - 07.02.2012, 16:33
Re: Time Left Textdraw - by Zaec - 07.02.2012, 18:07

Forum Jump:


Users browsing this thread: 2 Guest(s)