Help needed .
#1

How to check if a player is near to another player (close to him up to 10meters) on foot ?
I need it for an /arrest command .
Reply
#2

pawn Код:
new
    Float: pX,
    Float: pY,
    Float: pZ;

GetPlayerPos(id, pX, pY, pZ); // edit "id" to the variable you store the player's ID who is about to be arrested
if (!IsPlayerInRangeOfPoint(playerid, 10.0, pX, pY, pZ)) return // error message (not close enough)
Reply
#3

pawn Код:
new pos[3];
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
if(IsPlayerInRangeOfPoint(idOfUserToGetArrested, 10.0, pos[0], pos[1], pos[2])) {
    // In range!
} else {
    // Not in range!
}
Edit: As mentioned above.
Reply
#4

thank you , both
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)