Help Timer for +rep
#1

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
Код:
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;
}
Plz Help For +rep
Reply
#2

I am not to sure what you want me to do, however timer intervals are not accurate.

The timer intervals can be fixed;
- https://sampforum.blast.hk/showthread.php?tid=289675
- https://sampforum.blast.hk/showthread.php?tid=375925
Reply
#3

No i dont want this i have fixes
Reply
#4

Do you mean this?

pawn Код:
GameTextForPlayer(playerid, string,1500, 3);
Change it for this:

pawn Код:
GameTextForPlayer(playerid, string, 10000, 3);
Or if it is not what you meant, try changing this:

pawn Код:
PointTimer = SetTimerEx("FinalCapture", 600000, false, "dd", Capturer, CapturerFam);
To this:

pawn Код:
PointTimer = SetTimerEx("FinalCapture", 10000, false, "dd", Capturer, CapturerFam);
Reply
#5

no i mean cuntdown timer for 600sec
Reply
#6

Plz Help anyone can't helpme?
Reply
#7

Код:
PointTimer = SetTimerEx("FinalCapture", 10000, false, "dd", Capturer, CapturerFam);
Add this and Use TextDraw to show the time for user.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)