30.12.2014, 15:39
Hi all i want to make a timer for family wars (or capturing)
that when player typed /capture after 10 sec show a timer that is for end of war but when 10 sec passed it shows the timer for 1 sec after that timer will be remove.
my code
Plz Help For +rep
that when player typed /capture after 10 sec show a timer that is for end of war but when 10 sec passed it shows the timer for 1 sec after that timer will be remove.
my code
Код:
forward CapturePoint(playerid, idx); public CapturePoint(playerid, idx) { new Float:Cap[3], string[128]; GetPlayerPos(playerid, Cap[0], Cap[1], Cap[2]); if(Cap[0] == Capture[0] && Cap[1] == Capture[1] && Cap[2] == Capture[2]) { format(string, sizeof(string), "%s has attempted to capture the %s for %s, it will be theirs in 10 minutes(600 sanie).", RPN(playerid), PointInfo[idx][pName], RPFaN(playerid)); SendClientMessageToAll(COLOR_YELLOW, string); Capturing = 0; PointInfo[idx][pOwner] = 0; KillTimer(PointTimer); Capturer = playerid; CapturerFam = idx; PointTimer = SetTimerEx("FinalCapture", 600000, false, "dd", Capturer, CapturerFam); // new playerb = PlayerInfo[playerid][pFam]; // foreach(Player, playerb) // { // if(Capturing ==1) // { WarTimer[playerid] = 600; WarTimer[playerid] --; format(string,sizeof(string),"~n~~n~~n~~n~~n~~n~~n~~n~~r~Point Time Left: ~w~%d ~r~seconds", WarTimer[playerid]); GameTextForPlayer(playerid, string,1500, 3); // } // } } else { Capturing = 0; SendClientMessage(playerid, COLOR_GREY, "You have moved from your position and failed to capture the point."); } return 1; } forward FinalCapture(playerid, idx); public FinalCapture(playerid, idx) { new string[128]; format(string, sizeof(string), "%s has successfully captured the %s for %s.", RPN(playerid), PointInfo[idx][pName], RPFaN(playerid)); SendClientMessageToAll(COLOR_YELLOW, string); Capturer = -1; CapturerFam = -1; PointInfo[idx][pTime] = 24; PointInfo[idx][pOwner] = PlayerInfo[playerid][pFam]; GiveZaiatMoney(playerid,PointInfo[idx][pProfit]); DestroyDynamicPickup(PointInfo[idx][pPickup]); DestroyDynamic3DTextLabel(PointInfo[idx][pText]); SavePoints(); return 1; }