Problems with /give cmd
#1

Hello, I got a problem with my /give cmd, When i am close to the player, It says: You are not near this player, But i am close.

This is the beggining of the code:

pawn Код:
CMD:give(playerid, params[])
{
    new targetid, option[128], string[128];
    if(sscanf(params, "us[128]", targetid, option))
    {
        SendClientMessage(playerid, RED, "[LOST:RP] /give [ID] [OPTION");
        SendClientMessage(playerid, COLOR_WHITE, "[LOST:RP] Options: Matches,Firewood,WaterBottle,FishingRod,FishingNet,Heroin,Fish,WalkieTalkie");
        return 1;
    }
    new targetname[MAX_PLAYER_NAME], sendername[MAX_PLAYER_NAME];
    GetPlayerName(targetid, targetname, sizeof(targetname));
    GetPlayerName(playerid, sendername, sizeof(sendername));
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid,x,y,z);
    new Float:tx,Float:ty,Float:tz;
    GetPlayerPos(targetid,tx,ty,tz);
    if(!IsPlayerInRangeOfPoint(playerid, 2.0, tx,ty,tz)) // Here
    return SendClientMessage(playerid, RED, "[LOST:RP] You arent close to that player");
    {
I dont understand it, It should be like that. But i can be standing next to the person, And it still says like that.

Anyone know how to solve?
Reply
#2

Make the 2.0 bigger. Like 6.0. The zone around the target position.
Reply
#3

Is it the single line with IsPlayerInRangeOfPoint ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)