Quick Question
#1

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

Why nobody bother to help

İ will give rep?
Reply
#3

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

Well thanks for your help i will try both ways
Reply
#5

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

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
}
Reply
#7

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)