17.10.2015, 23:06
(
Последний раз редактировалось Crystallize; 23.12.2015 в 13:15.
)
Fixed.
CMD:eat(playerid) {
if(GetPlayerWeapon(playerid) != 4) return SendClientMessage(playerid, -1, "You must be holding a knife to eat the human meat!");
if(!IsPlayerInRangeOfPoint (playerid, 8.0, 2695.6880, -1704.6300, 11.8438)) return SendClientMessage(playerid,COLOR_RED,"You are not near eating place!");
ApplyAnimation(playerid, "PED", "BOM_Plant ", 4.1, 0, 1, 1, 0, 1, 1);
SetPlayerHealth(playerid, 100);
SetTimerEx("needFood",needFoodTimer,1,"i",playerid);
SendClientMessage(playerid, COLOR_LIGHTGREEN, "You are no longer hungry");
return 1;
}
Check if the player is in range of the point.
pawn Код:
Using IF you are checking if they are near the point. Having IsPlayerInRangeOfPoint wouldnt make any sort of sense to the script. |