IsPlayerInRangePoint Help.... +Rep
#7

My method will work for all objects you created and having position stored in the array. I missed a check just add this:
pawn Код:
public OnPlayerUpdate(playerid)
{
    for(new i; i < MAX_OBJECTS; i++)
    {
        if(IsValidObject(i) && Objects[i][ox] != 0.0 && Objects[i][oy] != 0.0 && Objects[i][oz] != 0.0)
        {
            if(IsPlayerInRangeOfPoint(playerid, 5.0, Objects[i][ox], Objects[i][oy], Objects[i][oz]))
            {
                SendClientMessage(playerid, -1, "your msg");
            }
        }
    }
    return 1;
}
Rather than OnPlayerUpdate, use a timer or make use of a custom callback based on player position updating(best way).
Reply


Messages In This Thread
IsPlayerInRangePoint Help.... +Rep - by kesarthakur - 12.04.2015, 05:06
Re: IsPlayerInRangePoint Help.... +Rep - by Gammix - 12.04.2015, 05:30
Re: IsPlayerInRangePoint Help.... +Rep - by kesarthakur - 12.04.2015, 05:34
Re: IsPlayerInRangePoint Help.... +Rep - by Crayder - 12.04.2015, 05:44
Re: IsPlayerInRangePoint Help.... +Rep - by kesarthakur - 12.04.2015, 05:46
Re: IsPlayerInRangePoint Help.... +Rep - by Crayder - 12.04.2015, 05:51
Re: IsPlayerInRangePoint Help.... +Rep - by Gammix - 12.04.2015, 05:51
Re: IsPlayerInRangePoint Help.... +Rep - by Crayder - 12.04.2015, 05:56
Re: IsPlayerInRangePoint Help.... +Rep - by kesarthakur - 12.04.2015, 08:01

Forum Jump:


Users browsing this thread: 1 Guest(s)