03.04.2010, 00:04
How to make a command like "/wanted" but it shows all the players with stars names?
CMD:wanted(playerid, params[])
{
new p = 0;
SendClientMessage(playerid, 0x009DFFFF, "__________________| Wanted List |__________________");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
if(GetPlayerWantedLevel(i) >= 1)
{
new string[128], Name[MAX_PLAYER_NAME];
GetPlayerName(i, Name, sizeof(Name));
format(string, sizeof(string), "> %s (Wanted Level: %i)", Name, GetPlayerWantedLevel(i));
SendClientMessage(playerid, 0xFFFFFFFF, string);
p++;
}
}
}
if (p == 0) SendClientMessage(playerid, 0xFFFFFFFF, "There are no wanted criminals!");
return 1;
}
Originally Posted by Steven82
How do i convert it.
|
if (strcmp(cmdtext, "/wanted", true) ==0)
{
new p = 0;
SendClientMessage(playerid, 0x009DFFFF, "__________________| Wanted List |__________________");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
if(GetPlayerWantedLevel(i) >= 1)
{
new string[128], Name[MAX_PLAYER_NAME];
GetPlayerName(i, Name, sizeof(Name));
format(string, sizeof(string), "> %s (Wanted Level: %i)", Name, GetPlayerWantedLevel(i));
SendClientMessage(playerid, 0xFFFFFFFF, string);
p++;
}
}
}
if (p == 0) SendClientMessage(playerid, 0xFFFFFFFF, "There are no wanted criminals!");
return 1;
}
if(gTeam[playerid] == TEAM_LVPD
Originally Posted by Steven82
Guys i am trying to mix this command with:
Код:
if(gTeam[playerid] == TEAM_LVPD |
if (strcmp(cmdtext, "/wanted", true) ==0)
{
if (gTeam[playerid] != TEAM_LVPD) return 0;
new p = 0;
SendClientMessage(playerid, 0x009DFFFF, "__________________| Wanted List |__________________");
for(new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
if(GetPlayerWantedLevel(i) >= 1)
{
new string[128], Name[MAX_PLAYER_NAME];
GetPlayerName(i, Name, sizeof(Name));
format(string, sizeof(string), "> %s (Wanted Level: %i)", Name, GetPlayerWantedLevel(i));
SendClientMessage(playerid, 0xFFFFFFFF, string);
p++;
}
}
}
if (p == 0) SendClientMessage(playerid, 0xFFFFFFFF, "There are no wanted criminals!");
return 1;
}