IsPlayerInArea - 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)
+--- Thread: IsPlayerInArea (
/showthread.php?tid=530323)
IsPlayerInArea -
Mititel - 06.08.2014
I have a system war and put three different areas where as a red square. I want that when group members out of the red square marked decrease to 5 hp to 2 seconds.
I tried with "IsPlayerInArea" but did not succeed.
HELP ME PLEASE!!!
Sorry for my bad english.
Re: IsPlayerInArea -
Stanford - 06.08.2014
Are you using streamer dynamic areas or something else? if you are using something else then provide the code.
If you are using streamer then:
pawn Код:
public OnPlayerLeaveDynamicArea(playerid, areaid)
{
if(areaid == (your areaid))
{
// code
}
}
Re: IsPlayerInArea -
Mititel - 06.08.2014
Do not use dynamic zones
My areas are so:
1
Код:
new GangZoneFlash1, GangZoneFlash2, GangZoneFlash3;
2 (OnPlayerSpawn)
Код:
if(IsWar == true && warzone == 1) GangZoneFlashForPlayer(playerid, GangZoneFlash1, COLOR_RED);
else if(IsWar == true && warzone == 2) GangZoneFlashForPlayer(playerid, GangZoneFlash2, COLOR_RED);
else if(IsWar == true && warzone == 3) GangZoneFlashForPlayer(playerid, GangZoneFlash3, COLOR_RED);
3. (OnGamemodeInit)
Код:
GangZoneFlash1 = GangZoneCreate(351.5625,-9.375,103.125,-295.3125);
GangZoneFlash2 = GangZoneCreate(1675.78125,-1207.03125,1867.96875,-1050);
GangZoneFlash3 = GangZoneCreate(1054.6875,-1058.59375,1269.53125,-875);
These areas are marked with red.
Re: IsPlayerInArea -
Stanford - 06.08.2014
Then create dynamic areas with the same coordinates that you have for gang zones ( squares ) and it should work fine for you, as I believe that there's no such function for gang zones to detect if the player has left the zone or not, streamer will so the job for you; There are several types of dynamic areas, choose square..