IsPlayerInArea problem. - 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 problem. (
/showthread.php?tid=526083)
IsPlayerInArea problem. -
tuuler - 15.07.2014
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;
}
Re: IsPlayerInArea problem. -
TwinkiDaBoss - 15.07.2014
Use
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);
}
}
}
Re: IsPlayerInArea problem. -
Dignity - 15.07.2014
Quote:
Originally Posted by TwinkiDaBoss
|
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);
|