24.06.2010, 18:52
Hello! I need help with count down showing in textdraw.
I got following.
After played stayed in CP for 10 seconds timer don't go '30 seconds till money is delivered.', '29 seconds till money is delivered.', '28 seconds till money is delivered.'. It goes '0 seconds till money is delivered.', ''
-100 seconds till money is delivered.', '-2000 seconds till money is delivered.' and it is not stopping. Anyone can help to make it like '30 seconds till money is delivered.', '29 seconds till money is delivered.', '28 seconds till money is delivered.' till 0.
Thanks.
I got following.
Код:
public OnPlayerEnterCheckpoint(playerid) { if(GetPlayerTeam(playerid) == TEAM_HOODIES) { new string[256], playername[MAX_PLAYER_NAME]; GetPlayerName(playerid, playername, sizeof(playername)); format(string, sizeof(string), "%s is stealing money. It takes to take 10 seconds.", playername); TextDrawSetString(text3, string); TextDrawHideForAll(text4); TextDrawShowForAll(text3); SetTimer("Destroy3", 2000, false); man[playerid] = 1; plant = SetTimer("Planted", 10000, false); } return 1; } public OnPlayerLeaveCheckpoint(playerid) { if(GetPlayerTeam(playerid) == TEAM_HOODIES) { new string[256], playername[MAX_PLAYER_NAME]; GetPlayerName(playerid, playername, sizeof(playername)); format(string, sizeof(string), "%s has quit stealing money.", playername); KillTimer(plant); TextDrawSetString(text4, string); TextDrawHideForAll(text3); TextDrawShowForAll(text4); SetTimer("Destroy4", 2000, false); man[playerid] = 0; } return 1; } forward Planted(); public Planted() { for(new i=0; i<MAX_PLAYERS; i++) { timedeliver = 30; DisablePlayerCheckpoint (i); plant = SetTimer("UpdateTime", 1000, true); } } forward UpdateTime(); public UpdateTime() { timedeliver--; new string[256]; format(string, sizeof(string), "%i seconds until money is delivered.", timedeliver); TextDrawSetString(text19, string); TextDrawShowForAll(text19); if(timedeliver == 0) { KillTimer(plant); format(string, sizeof(string), "Money was succesfully delivered.", timedeliver); TextDrawSetString(text19, string); TextDrawShowForAll(text19); SetTimer("AttackWin", 2000, false); } }
-100 seconds till money is delivered.', '-2000 seconds till money is delivered.' and it is not stopping. Anyone can help to make it like '30 seconds till money is delivered.', '29 seconds till money is delivered.', '28 seconds till money is delivered.' till 0.
Thanks.