01.03.2009, 04:59
ok i want to make a command that when you use it, it shows a list of all wanted players (wanted level above 0).
can someone help? no idea where to start.
can someone help? no idea where to start.
for(new i = 0; i < MAX_PLAYERS; i ++)
{
if(GetPlayerWantedLevel(i) >= 1)
{
// This player is wanted
}
}
dcmd_wantedlist(playerid,params[]) {
#pragma unused params
new wantedmates, string[64];
new playername[MAX_PLAYER_NAME];
for(new i=0;i<MAX_PLAYERS;i++)
{
if(GetPlayerWantedLevel(i) >= 1)
{
if(wantedmates == 0)
{
SendClientMessage(playerid, COLOR_COLOR, "* List of players which are currently wanted:");
wantedmates = 1;
}
GetPlayerName(i, playername, sizeof(playername));
format(string, sizeof(string), "* %s (id: %d) is currently wanted.", playername,i);
SendClientMessage(playerid, COLOR_COLOR, string);
}
}
if(wantedmates == 0)
{
SendClientMessage(playerid, COLOR_COLOR, "* No one is currently wanted.");
}
return 1;
}
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1