Zone Area Help Pleasee
#1

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(playeridGZ_ZONE10x000000AA); 
Please Please Help Me I Realy Need It + Rep
Reply
#2

PHP код:
IsPlayerInArea(playeridFloat:MinXFloat:MinYFloat:MaxXFloat:MaxY)
{
    new 
Float:XFloat:YFloat:Z;
    
GetPlayerPos(playeridXYZ);
    if(
>= MinX && <= MaxX && >= MinY && <= 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
Reply
#3

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".
Reply
#4

Yea, Streamer negates the use of a timer as there's a callback or 3 that cover it. OnPlayerEnterDynamicArea and OnPlayerLeaveDynamicArea.
Reply
#5

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.
Reply
#6

You could also use the gangzone include by Gammix and use the callback OnPlayerLeaveGangZone.
Reply
#7

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)