07.11.2013, 20:48
Hello Guys Someone Can Help Me To Do Like This ?:
i Mean Timeleft Textdraw
Thanks
i Mean Timeleft Textdraw
Thanks
new timelefttimer[MAX_PLAYERS];
new timeleftsecs[MAX_PLAYERS];
forward TimeLeft(playerid);
public TimeLeft(playerid)
{
if(timeleftsecs[playerid] == 0)
{
//WHEN TIME LEFT IS 00:00
//WRITE HERE THE FUNCTIONS // ACTIONS YOU WANT TO MAKE
KillTimer(timelefttimer[playerid]);
}
else
{
new string[8];
format(string,sizeof(string),"~R~%d",timeleftsecs[playerid]);
GameTextForAll(string,1000,3);
}
timeleftsecs[playerid] = timeleftsecs[playerid] -1;
return 1;
}
//THEN YOU WILL ADD THESE TWO LINES WHERE YOU WANT TO CALL THE FUNCTION OF TIME LEFT
timeleftsecs[playerid]=30; //30 seconds for example
timelefttimer[playerid]=SetTimerEx("TimeLeft", 1000, true,"d",playerid);
new timelefttimer[MAX_PLAYERS]; new timeleftsecs[MAX_PLAYERS];
forward TimeLeft(playerid); public TimeLeft(playerid) { if(timeleftsecs[playerid] == 0) { //WHEN TIME LEFT IS 00:00 //WRITE HERE THE FUNCTIONS // ACTIONS YOU WANT TO MAKE KillTimer(timelefttimer[playerid]); } else { new string[8]; format(string,sizeof(string),"~R~%d",timeleftsecs[playerid]); GameTextForAll(string,1000,3); } timeleftsecs[playerid] = timeleftsecs[playerid] -1; return 1; } //THEN YOU WILL ADD THESE TWO LINES WHERE YOU WANT TO CALL THE FUNCTION OF TIME LEFT timeleftsecs[playerid]=30; //30 seconds for example timelefttimer[playerid]=SetTimerEx("TimeLeft", 1000, true,"d",playerid);