16.12.2009, 20:38
ok first, here is the script...
the prolem is that, when i start the countdown, it goes 3,2,1 etc ut the HAPPY NEW YEAR 2010!! does not appear, any reason,?
thanks
Код:
#define FILTERSCRIPT #include <a_samp> new counter; new countTimer; forward timer(); #if defined FILTERSCRIPT public OnFilterScriptInit() { counter = 0; return 1; } public OnFilterScriptExit() { counter = 0; return 1; } #else main() { print("\n------------------------------------------"); print(" NewYearCountdown Script"); print("------------------------------------------\n"); } #endif public OnPlayerConnect(playerid) { SendClientMessage(playerid, 0xFF00FF,"Welcome to the New Year's Party!"); return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { if(!strcmp(cmdtext, "/count", true) || !strcmp(cmdtext, "/countdown", true)) { if(counter != 0) return SendClientMessage(playerid, 0xFFFF00FF, "The new-year countdown is already running...print what till next year!"); countTimer = SetTimer("timer", 1000, true); return true; } return 0; } public timer() { counter++; if(counter == 1) GameTextForAll("3", 500, 3); else if(counter == 2) GameTextForAll("2", 500, 3); else if(counter == 3) GameTextForAll("1", 500, 3); else if(counter == 4) { GameTextForAll("HAPPY NEW YEAR 2010!!!", 500, 2000); counter = 0; KillTimer(countTimer); } return true; }
thanks