Zone Area Help Pleasee - 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: Zone Area Help Pleasee (
/showthread.php?tid=615088)
Zone Area Help Pleasee -
alishvasis - 17.08.2016
Hi How To Make If Player Go Out Of My Zone Area Then Kick(playerid);
This Is My Zone Area
PHP код:
new GZ_ZONE1;
GZ_ZONE1 = GangZoneCreate(-2171.875,-285.15625,-2000,-66.40625);
GangZoneShowForPlayer(playerid, GZ_ZONE1, 0x000000AA);
Please Please Help Me I Realy Need It + Rep
Re: Zone Area Help Pleasee -
xTURBOx - 17.08.2016
PHP код:
IsPlayerInArea(playerid, Float:MinX, Float:MinY, Float:MaxX, Float:MaxY)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
if(X >= MinX && X <= MaxX && Y >= MinY && Y <= MaxY) {
return 1;
}
return 0;
}
public OnPlayerUpdate(playerid)
{
if(!IsPlayerInArea(playerid, -2171.875,-285.15625,-2000,-66.40625);
{
//send client message if you want to
Kick(playerid);
}
Although i would recommend to use a timer
Re: Zone Area Help Pleasee -
Mencent - 17.08.2016
Hello!
Either you do it like xTURBOx said or you use the streamer. This are dynamic zones / areas.
=>
https://sampforum.blast.hk/showthread.php?tid=102865
Look at "areas".
Re: Zone Area Help Pleasee -
Sew_Sumi - 17.08.2016
Yea, Streamer negates the use of a timer as there's a callback or 3 that cover it. OnPlayerEnterDynamicArea and OnPlayerLeaveDynamicArea.
Re: Zone Area Help Pleasee -
Sanady - 17.08.2016
Hey, easiest way to detect if player is in gang zone is when you are using Streamer, there is one callback called
forward OnPlayerEnterDynamicArea(playerid, STREAMER_TAG_AREA areaid). First create cube by CreateDynamicCube function then use same cord`s for gang zone, that`s all, and when player enter zone you kick him. That`s all. Easy.
Re: Zone Area Help Pleasee -
oMa37 - 17.08.2016
You could also use the gangzone include by Gammix and use the callback OnPlayerLeaveGangZone.
Re: Zone Area Help Pleasee -
DeeadPool - 18.08.2016
use this -
World Boundaries
This will stop the player from leaving the area you have made. If the player tries to leave, he will be pushed back in the area.