25.10.2011, 19:19
Why the countdown begins to count from zero and reaches a given number and not the other way around? I want to countdown began between 120 seconds and ended at 0 Will be 0 when the command is to be unlocked.
This is my code:
what is wrong?
Help.
Sorry for my english.
This is my code:
Код:
CMD:zycie(playerid, params[])
{
new Tick = GetTickCount();
if(Tick - GetPVarInt(playerid, "Zycie") < 120 * 1000)
{
new string[128];
format(string, sizeof string, "{FFFFFF}Zycie mozesz kupic dopiero za {EA0000}%d{FFFFFF}.sek!", (Tick - GetPVarInt(playerid, "Zycie"))/1000);
ShowPlayerDialog(playerid, DIALOG_INFO, DIALOG_STYLE_MSGBOX, "{EA0000}Czekaj..",string,"Zamknij","");
return 1;
}
SetPlayerHealth(playerid,100.0);
SetPVarInt(playerid, "Zycie", Tick);
return 1;
}
Help.
Sorry for my english.


