IsPlayerInArea problem.
#1

Hello, I'm trying to make a safezone for my server, but it wont work, I dont know why, this is the code.

pawn Код:
if( killerid != INVALID_PLAYER_ID && IsPlayerInArea( killerid, -412.2311,1231.9600,53.6609,917.8260))
IsPlayerInArea function.
pawn Код:
stock 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;
}
Reply
#2

Use
pawn Код:
IsPlayerInRangeOfPoint

EDIT: Nvm just use it like this

pawn Код:
public isPlayerInArea()
   {
       new Float:X, Float:Y, Float:Z;
       for(new i=0; i < MAX_PLAYERS; i++)
       {
           GetPlayerPos(i, X, Y, Z);
           if (X <= -3915 && X >= -3694 && Y <= 401 && Y >= 37) //if a player enters the area, between X= -3915 and -3694 || Y= 401 and 37. He will die.
           {
               SetPlayerHealth(i, 0);
           }
       }
   }
Reply
#3

Quote:
Originally Posted by TwinkiDaBoss
Посмотреть сообщение
Use
pawn Код:
IsPlayerInRangeOfPoint
Lol. Don't try to give advice if you have no idea what you're talking about.

@OP

While I'm not familiar with the function (but don't want to reply without replying constructively), did you try this?
https://sampforum.blast.hk/showthread.php?tid=222283
https://sampwiki.blast.hk/wiki/Areacheck

If you did, try this as an alternative:
https://sampforum.blast.hk/showthread.php?tid=102865

As quoted from OP:

Quote:
Originally Posted by Incognito
pawn Код:
native CreateDynamicCube(Float:minx, Float:miny, Float:minz, Float:maxx, Float:maxy, Float:maxz, worldid = -1, interiorid = -1, playerid = -1);
native DestroyDynamicArea(areaid);

native IsPlayerInDynamicArea(playerid, areaid, recheck = 0);
native IsPlayerInAnyDynamicArea(playerid, recheck = 0);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)