Eat Command not working properly
#4

Check if the player is in range of the point.
pawn Код:
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;
}

Using IF you are checking if they are near the point. Having IsPlayerInRangeOfPoint wouldnt make any sort of sense to the script.
Reply


Messages In This Thread
Eat Command not working properly - by Crystallize - 17.10.2015, 23:06
Re: Eat Command not working properly - by Abagail - 17.10.2015, 23:19
Re: Eat Command not working properly - by Crystallize - 17.10.2015, 23:23
Re: Eat Command not working properly - by TwinkiDaBoss - 17.10.2015, 23:30
Re: Eat Command not working properly - by Crystallize - 17.10.2015, 23:46

Forum Jump:


Users browsing this thread: 1 Guest(s)