Quick Question - 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: Quick Question (
/showthread.php?tid=308653)
Need Help [+rep] -
lordturhan - 04.01.2012
Soo i have GangZone coordinates
pawn Код:
BlueArea= GangZoneCreate(97.171417, 1795.970458, 289.171417, 1995.970458);
Here is the deal i made command /w which gives you access to a weapon shop so i want weapon shop only to work on this gangzone.
Can someone please help
Thank you for reading.
Re: Quick Question -
lordturhan - 04.01.2012
Why nobody bother to help
İ will give rep?
Re: Quick Question -
DarkKillerWithPride<3 - 04.01.2012
if(GetPlayerPos(playerid) == BlueZone)? Also I have said this on so many peoples thread. DO NOT BUMP YOUR THREAD IF IT ISN'T AFTER 24HOURS UNDERSTAND? o.O thanks
Re: Quick Question -
lordturhan - 04.01.2012
Well thanks for your help i will try both ways
Re: Quick Question -
lordturhan - 04.01.2012
Quote:
Originally Posted by [HLF]Southclaw
pawn Код:
if(GetPlayerPos(playerid) == BlueZone)
That will NOT work
Before posting make sure you know how functions work.
GetPlayerPos has 3 more parameters, X, Y and Z you use it to store the positions into variables, the value it returns is 0 if the player isn't connected and 1 if they are, that's all. (I think)
So if you use that code it will only check if the return value (IsPlayerConnected) is equal to whatever the variable 'BlueZone' is worth.
|
Yes i test it doesnt work im trying to make your work.
Re: Quick Question -
RyDeR` - 04.01.2012
A bit improved:
pawn Код:
stock IsPlayerInArea(iPlayer, Float: fMinX, Float: fMinY, Float: fMaxX, Float: fMaxY) {
new
Float: fX,
Float: fY
;
if(GetPlayerPos(iPlayer, fX, fY, Float: iPlayer)) {
return ((fMinX < fX < fMaxX) && (fMinY < fY < fMaxY));
}
return 0;
}
Then just use this condition:
pawn Код:
if(IsPlayerInArea(playerid, 97.171417, 1795.970458, 289.171417, 1995.970458)) {
// Player is in gangzone
} else {
// Player is not in gangzone
}
Re: Quick Question -
lordturhan - 04.01.2012
EDİT:
I used ryder's function and it didnt give errors i will test it when i got to computer at my house
Thanks Guys