21.04.2012, 22:14
pawn Код:
CMD:wanted(playerid, params[])
{
if(pTeam[playerid] == 7)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
new string[400];//we will create a little big string coz 128 is too small, also we will make it outside loop because we don't
// wait it to new emprty string is created MAX_PLAYER times
if(GetPlayerWantedLevel(i) > 0)
{
format(string, sizeof(string), "%s{E60000}%s {FFFFFF}(Wanted Level: {E60000}%d{FFFFFF})\n", string,Name(i), GetPlayerWantedLevel(i)); //we add old string into new string
}
}
ShowPlayerDialog(playerid, DIALOG_WANTED, DIALOG_STYLE_LIST, "SASP - Wanted List", string, "Done", ""); //we also show him dialog after loop is done. Your code would show him around
//15 dialogs at same same so he would see only last one.
}
else
{
SendClientMessage(playerid, COLOR_VIOLET, "INFO: {FFFFFF}You're not in the SASP.");
}
return 1;
}