Near Player
#1

so don't ask why I need this but I need it I have made this thing so that it give me the near players from 100meters away from me but this give me 1 player what if I need to get all the players that are near me what should I do here is the code:
PHP код:
CMD:pnear(playeridparams[])
{
        new 
string[64], Float:tx[MAX_PLAYERS], Float:ty[MAX_PLAYERS], Float:tz[MAX_PLAYERS], tname[MAX_PLAYER_NAME];
        if(
adlvl(playerid) <5) return 0;
        
SendClientMessage(playeridCOLOR_YELLOW"* Listing all Player(s) within 100 meters of you...");
        for(new 
i=1i<MAX_PLAYERS i++)
        {
            
GetPlayerPos(itx[i], ty[i], tz[i]);
            if(
IsPlayerInRangeOfPoint(playerid100.0tx[i], ty[i], tz[i]) && i!=playerid)
            {
                
GetPlayerName(itnamesizeof(tname));
                
format(stringsizeof(string), "Playerid: %d | Name: %s"itname);
                
SendClientMessage(playeridCOLOR_WHITEstring);
            }
        }
        return 
1;

Reply


Messages In This Thread
Near Player - by silverms - 08.04.2017, 23:26
Re: Near Player - by LazzyBoy - 08.04.2017, 23:50
Re: Near Player - by silverms - 09.04.2017, 00:10
Re: Near Player - by LazzyBoy - 09.04.2017, 00:13
Re: Near Player - by Threshold - 09.04.2017, 01:28

Forum Jump:


Users browsing this thread: 1 Guest(s)