06.04.2012, 10:40
Can anyone tell me why this countdown not working ?
what happens is.. when i enter command /cd 5
a 5 comes on the screen but it doesnt decrease..
what happens is.. when i enter command /cd 5
a 5 comes on the screen but it doesnt decrease..
pawn Код:
dcmd_cd(playerid,params[])
{
#pragma unused playerid
sscanf(params,"d",Scount);
new string[256];
format(string,sizeof(string),"%i",Scount);
TextDrawSetString(TextdrawCD,string);
TextDrawShowForAll(TextdrawCD);
SetTimer("CDRepeat",10,0);
return 1;
}
public CDRepeat()
{
SetTimer("reper",1000,0);
}
public reper()
{
Scount--;
new string[256];
format(string,sizeof(string),"%i",Scount);
TextDrawSetString(TextdrawCD,string);
if(Scount != 0)
{
SetTimer("CDRepeat",10,0);
}
if(Scount == 0)
{
TextDrawHideForAll(TextdrawCD);
TextDrawShowForAll(TextdrawGO);
SetTimer("CDRepeat",1000,0);
}
}