[Help] Gangzones
#8

Quote:
Originally Posted by CutX
Посмотреть сообщение
of course,
you'll have to loop trough all of the players (i'd recommend GetMaxPlayers() instead of MAX_PLAYERS btw)
to check their area-id's

something like
pawn Код:
new s[70];//idk could be smaller. we'll just go with that for testing :)
for(new i=0;i<GetMaxPlayers();i++)
{
    if(Gang[i] != 1) continue;//skip every id which is not in gang 1
    if(GetAreaID(i) == -1) continue;//skip the id if it's in the gang but in no defined area
    else if(GetAreaID(i) == 2)//lets say area 2 is Los Santos, were checking for id 2 here
    {
        strcat(s,GetName(i));
        strcat(s," | ");//using "\n" here and displaying it in a dialog would look nicer
    }
}
if(s[0]==EOS) return SendClientMessage(playerid,-1,"There's noone in that area");
SendClientMessage(playerid,-1,s);//display the list of players who are in Los Santos and in Gang 1
//you could also use a dialog.


//for the name
stock GetName(playerid)
{
    new n[MAX_PLAYER_NAME];
    GetPlayerName(playerid, n, MAX_PLAYER_NAME);
    return n;
}
You're the best!

*passes you an internet cookie*
REP+
Reply


Messages In This Thread
[Help] Gangzones - by BornHuman - 21.01.2014, 18:27
Re: [Help] Gangzones - by Ace155 - 21.01.2014, 18:33
Re: [Help] Gangzones - by CutX - 21.01.2014, 18:38
Re: [Help] Gangzones - by BornHuman - 21.01.2014, 18:47
Re: [Help] Gangzones - by CutX - 21.01.2014, 18:57
Re: [Help] Gangzones - by BornHuman - 21.01.2014, 19:03
Re: [Help] Gangzones - by CutX - 21.01.2014, 19:15
Re: [Help] Gangzones - by BornHuman - 21.01.2014, 19:33

Forum Jump:


Users browsing this thread: 1 Guest(s)