19.04.2013, 17:42
Quote:
Hi All.I maked my Toilet system.I using a textdraw but now i want to make when player type /toilet to textdraw go 1, 2,3,4,5,6,7...100% how to make it ? To textdraw set a string from 0% to 100% ?
|
pawn Код:
new RMKD[MAX_PLAYERS];
new Timer[MAX_PLAYERS];
CMD:toilet(playerid,params[])
{
RMKD[playerid] = 100; //
Timer[playerid] = SetTimerEx("UpdateX",100,1,"d",playerid),
TextDrawShowForPlayer(playerid,Text:text);
}
forward UpdateX(playerid);
public UpdateX(playerid)
{
new string[128];
if(RMDK[playerid] == 0)
{
// remove the textdraws here
KillTimer(Timer[playerid]);
return 0;
}
RMDK[playerid] --;
format(string,sizeof(string)," %d",RMDK[playerid]);
TextDrawSetString(text:tdname,string); // set the textdraw name
/*
if is playertextdraw use
PlayerTextDrawSetString(Text:text,string);
*/
}