Taking Over Zones - 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: Taking Over Zones (
/showthread.php?tid=266046)
Taking Over Zones -
muhib777 - 03.07.2011
So i have made a simple zone
Код:
public OnGameModeInit()
{
Grove_Base = GangZoneCreate(2216.207, -1729.235, 2623.11, -1456.841);
}
Код:
public OnPlayerSpawn(playerid)
{
GangZoneShowForPlayer(playerid, Grove_Base, 0x80FF8096);
GangZoneShowForPlayer(playerid, Vagos_Base, 0xF9F20096);
return 1;
}
How do i make it so a certain coloured person has to be in the area for 60 seconds so they have captured it.
Re: Taking Over Zones -
Shadoww5 - 03.07.2011
PHP код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/gz", true) == 0)
{
new Float:Pos[3];
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
if(Pos[0] > 2216.207 && Pos[0] < 2623.11 && Pos[1] > 2216.207 && Pos[1] < -1456.841)
{
SendClientMessage(playerid, 0xFFFF00FF,"Wait 60 seconds here for dominate.");
SetTimerEx("Check", 600000, false, "i", playerid);
}
return 1;
}
return 0;
}
forward Check(playerid);
public Check(playerid)
{
new Float:Pos[3];
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
if(Pos[0] > 2216.207 && Pos[0] < 2623.11 && Pos[1] > 2216.207 && Pos[1] < -1456.841)
{
SendClientMessage(playerid, 0xFFFF00FF,"GangZone dominated.");
// FUNCTIONS ..
}
else { SendClientMessage(playerid, 0xFFFF00FF,"You aren't in the the gangzone"); }
return 1;
}
https://sampwiki.blast.hk/wiki/Areacheck
Re: Taking Over Zones -
muhib777 - 03.07.2011
doesnt work when i do /gz it gives no such message when im inside the area.
Re: Taking Over Zones -
=WoR=Varth - 04.07.2011
Use IsPlayerInRangeOfPoint