help in /rape cmd
#5

I use some sort of this in my server...

pawn Код:
stock GetClosestPlayer(playerid)
{
    new Float:cdist, targetid = -1;
    for (new i = 0; i < MAX_PLAYERS; i++)
    {
        if (IsPlayerConnected(i) && GetPlayerState(i) != PLAYER_STATE_SPECTATING && playerid != i && (targetid < 0 || cdist > GetDistanceBetweenPlayers(playerid, i)))
        {
            targetid = i;
            cdist = GetDistanceBetweenPlayers(playerid, i);
        }
    }
    return targetid;
}

//
new Tplayer = GetClosestPlayer(playerid);// use this in command

//
Reply


Messages In This Thread
Deleted. - by iFiras - 15.10.2013, 09:52
Re: help in /rape cmd - by doreto - 15.10.2013, 10:16
Deleted. - by iFiras - 15.10.2013, 10:24
Deleted. - by iFiras - 15.10.2013, 11:30
Re: help in /rape cmd - by Anak - 15.10.2013, 11:40
Re: help in /rape cmd - by edzis84 - 15.10.2013, 11:40
Deleted. - by iFiras - 15.10.2013, 11:48
Re: help in /rape cmd - by Anak - 15.10.2013, 11:49
Deleted. - by iFiras - 15.10.2013, 21:52
Re: help in /rape cmd - by Anak - 16.10.2013, 03:54

Forum Jump:


Users browsing this thread: 1 Guest(s)