14.08.2012, 05:05
You can combine GetPlayerPos with IsPlayerInRangeOfPoint, like this
pawn Код:
CMD:givemoney(playerid, params[])
{
new amount, Float:Pos[3];
if(sscanf(params, "ui", targetid, amount)) return SendClientMessage(playerid, -1, "[USAGE] /givemoney <playerid> <amount>");
GetPlayerPos(targetid, Pos[0], Pos[1], Pos[2]);
if(IsPlayerInRangeOfPoint(playerid, 5, Pos[0], Pos[1], Pos[2])
{
GivePlayerMoney(targetid, amount);
GivePlayerMoney(playerid, -amount);
}
return 1;
}