09.04.2011, 10:54
Hi!
I got a problem with my function:
Here's an command.
Function IsPlayerNearObject:
So.. my problem is, when i'm near ATM the message sends to me. It shouldn't send. Any suggestions?
I got a problem with my function:
Here's an command.
pawn Код:
CMD:atm(playerid, cmdtext[])
{
if(!IsPlayerNearObject(playerid, 2942, 2.0))return SendClientMessage(playerid, COLOR_RED, "* You're not near a ATM.");
ShowPlayerDialog(playerid, DIALOG_BANK, [...]);
return true;
}
pawn Код:
stock IsPlayerNearObject(playerid, objectid, Float:range)
{
new Float:X, Float:Y, Float:Z;
GetObjectPos(objectid, X, Y, Z);
if(IsPlayerInRangeOfPoint(playerid, range, X, Y, Z))return true;
return false;
}