PlayerPos help
#5

Quote:
Originally Posted by Devilxz97
Посмотреть сообщение
https://sampwiki.blast.hk/wiki/GetPlayerPos
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint
https://sampwiki.blast.hk/wiki/Function:...erControllable

pawn Код:
forward IsCopNearSuspect(playerid);

public IsCopNearSuspect(playerid)
{
    new Float:X, Float:Y, Float:Z;
    GetPlayerPos(playerid, X, Y, Z);
    for(new i; i < MAX_PLAYERS; i ++)
    {
        if(IsPlayerConnected(i))
        {
            if(IsPlayerInRangeOfPoint(i, 5, X, Y, Z))
            {
                //Your code here
            }
        }
    }
    return 1;
}
for u
That will just check if playerid is near anyone, and it's terrible inflexible :/

Try:

pawn Код:
stock IsPlayerNearSuspect(playerid, suspectid, Float:range)
{
    new bool:isNear = false;
    if(IsPlayerConnected(playerid) && IsPlayerConnected(suspectid)) {
        new Float:pX, Float:pY, Float:pZ;
        GetPlayerPos(playerid, pX, pY, pZ);
        if(IsPlayerInRangeOfPoint(suspectid, range, pX, pY, pZ)) {
            isNear = true;
        }
    }
    return isNear;
}
Reply


Messages In This Thread
PlayerPos help - by jimis - 29.07.2012, 13:15
Re: PlayerPos help - by Cjgogo - 29.07.2012, 13:17
Re: PlayerPos help - by jimis - 29.07.2012, 13:25
Re: PlayerPos help - by Devilxz97 - 29.07.2012, 13:29
Re: PlayerPos help - by Sinner - 29.07.2012, 13:39
Re: PlayerPos help - by jimis - 29.07.2012, 13:40
Re: PlayerPos help - by Sinner - 29.07.2012, 13:41
Re: PlayerPos help - by Devilxz97 - 29.07.2012, 13:45
Re: PlayerPos help - by Roko_foko - 29.07.2012, 13:56
Re: PlayerPos help - by Sinner - 29.07.2012, 14:07

Forum Jump:


Users browsing this thread: 2 Guest(s)