[HELP]Area Takeover Almost Done - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP]Area Takeover Almost Done (
/showthread.php?tid=148611)
[HELP]Area Takeover Almost Done -
faloleroy - 18.05.2010
Hi, im making an area taking over system, took some from cod5 gm, but like.
I've put a timer on the gamemode init
SetTimer("AreaCheck", 1000, 1);
http://pastebin.com/7y0nwGXT
And when i go to the gangzone, it keeps going and going over the timer. Like
"You're dominating the area, wait 30 sec"
1 second later
"You're dominating the area, wait 30 sec"
Why is that happening?
Re: [HELP]Area Takeover Almost Done -
faloleroy - 18.05.2010
Код:
public AreaCheck()
{
for(new i, m = GetMaxPlayers(); i < m; i++ )
{
if(IsPlayerInArea(i, -2158.000000, 1918.755737, -2133.312011, 1926.421630))
{
if(EnteredArea[i] == 0)
{
if(Class[i] == TEAM_ARMY && CapturedBy == TEAM_ARMY || Class[i] == TEAM_MILITIA && CapturedBy == TEAM_MILITIA)
{
SendClientMessage(i, RED, "Esta бrea jб й do seu time!");
EnteredArea[i] = 1;
}
else
{
if(Class[i] == TEAM_ARMY)
{
if(Capturing[i] == 0)
{
GangZoneFlashForAll(area, BLUE);
SendClientMessageToAll(GREEN, "A бrea estб sendo capturada!");
EnteredArea[i] = 1; // He has entered
SendClientMessage(i,GREEN, "Fique aqui por trinta segundos para capturar a бrea!");
IfCapture[i] = 1;
Capturing[i] = 1;
takeOverTimer[i] = SetTimer("TakeOver", 30000, 0);
}
}
else if(Class[i] == TEAM_ARMY)
{
if(Capturing[i] == 0)
{
GangZoneFlashForAll(area, BLUE);
SendClientMessageToAll(GREEN, "A бrea estб sendo capturada!");
EnteredArea[i] = 1; // He has entered
SendClientMessage(i,GREEN, "Fique aqui por trinta segundos para capturar a бrea!");
IfCapture[i] = 1;
Capturing[i] = 1;
takeOverTimer[i] = SetTimer("TakeOver", 30000, 0);
}
}
}
}
else
{
EnteredArea[i] = 0; // When he leaves, he's no longer in the area
KillTimer(takeOverTimer[i]);
Capturing[i] = 0;
}
}
}
return 1;
}
just making things easier
Re: [HELP]Area Takeover Almost Done -
faloleroy - 18.05.2010
someone?
Re: [HELP]Area Takeover Almost Done -
Steven82 - 18.05.2010
Dude please, 12 hour bumps only.
Thanks
Re: [HELP]Area Takeover Almost Done -
faloleroy - 18.05.2010
what?