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=428211)
IsPlayerInArea problem -
HurtLocker - 04.04.2013
How can i make this work? I mean in which way to write it to be equal with this form?
pawn Код:
if (!IsPlayerInArea(*******)
{
//sth to be done everywhere BUT when player is in this area
}
Cause in this way, the ! does nothing.
Re: IsPlayerInArea problem -
SilverKiller - 04.04.2013
Why don't you use
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint ?
Re: IsPlayerInArea problem -
HurtLocker - 05.04.2013
I think you didnt understand what i asked for. I want to create an area, and say if a player IS NOT in this area and spawns minigun with hack, he loses all his weapons.
Re: IsPlayerInArea problem -
kamzaf - 05.04.2013
pawn Код:
forward IsPlayerInArea(playerid, BX,BY,BZ,BA);
public IsPlayerInArea(playerid, BX,BY,BZ,BA)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerID, X, Y, Z);
if(X >= BX && X <= BZ && Y >= BY && Y <= BA)
{
return 1;
}
return 0;
}
hope that is what you needed.
pawn Код:
if(!IsPlayerInArea(playerid,X,Y,Z,A)
{
// do code here
}
Re: IsPlayerInArea problem -
HurtLocker - 05.04.2013
Thanks a lot man, what you wrote is not correct but you gave me the idea!
Re: IsPlayerInArea problem -
MP2 - 05.04.2013
If you ever want to see the syntax, type the function and the opening ( and wait a second. The parameters will pop up in a box*. It can be a bit buggy in pawno and is a bit better in Notepad++. Not sure about other editors.
* This is only designed to work for native functions (i.e. functions default to SA-MP) but library writers can use a little trick called 'fake natives' to make their custom functions show up.