- 0
Comanda /countdown
-
Recently Browsing 0 members
- No registered users viewing this page.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.
Question
roscatu
Am o comanda de countdown , dar am intalnit o problema la timer, nu executa functia, iar gametextul de inceput,sta cam mult on.Care ar fi problema?
forward count_one(playerid); public count_one(playerid) { GameTextForPlayer(playerid, "CountDown: ~b~3", 1000, 1); } forward count_two(playerid); public count_two(playerid) { foreach (new i : Player) { GameTextForPlayer(i, "CountDown: ~b~2", 1000, 1); } } forward count_three(playerid); public count_three(playerid) { foreach (new i : Player) { GameTextForPlayer(i, "CountDown: ~b~1", 1000, 1); } } forward count_four(i); public count_four(i) { GameTextForPlayer(i, "~r~GO ~y~GO ~b~GO", 1000, 1); } COMMAND:countdown(playerid,params[]) { new CountDownDistance; new Float:slx,Float:sly,Float:slz; CountDown = 3; if(PlayerInfo[playerid][pLogged] == 1) { if(PlayerInfo[playerid][pAdminLevel] >= 1) { if(sscanf(params,"i", CountDownDistance)) { SCM(playerid, 0xBFC0C2FF, "{00FF00}Utilizare:{FFFFFF} /countdown [distanta]"); } else { if(CountDown == 1) { SendClientMessage(playerid, 0xB4B5B7FF, "* E deja pornit timeru *"); return 1; } else { foreach (new i : Player) { GetPlayerPos(playerid, slx, sly, slz); if(IsPlayerInRangeOfPoint(i, CountDownDistance, slx, sly, slz)) { GameTextForPlayer(i, "~g~Pe Locuri !!!", 1000, 1); if(CountDown== 3) { SetTimerEx("count_one", 2000, false, "i", playerid); CountDown--; } else if(CountDown == 2) { SetTimerEx("count_two", 3000, false, "i", playerid); CountDown--; } else if(CountDown == 1) { SetTimerEx("count_three", 4000, false, "i", playerid); CountDown--; } else if(CountDown == 0) { SetTimerEx("count_four", 5000, false, "i", playerid); CountDown = 4; } return 1; } } } } } } return 1; }4 answers to this question
Recommended Posts