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+