03.06.2017, 19:24
hey iv made an wanted system that give me the wanted reason it is working fine but when I set my friend wanted I see him on the command but if I set another one I see the new wanted without my friend so how to fix it please?
PHP код:
CMD:wanted(playerid, params[])
{
new string[256], playername[MAX_PLAYER_NAME], str[256], reas[256], mr;
for(new b=0; b<PLAYERS; b++)
{
if(GetPlayerWantedLevel(b) > 0) {
mr++;
}
}
if(mr==0) return SendClientMessage(playerid, COLOR_GREY, "There are currently no wanted players.");
for(new i; i<PLAYERS; i++)
{
if(IsPlayerConnected2(i) && GetPlayerWantedLevel(i)>0)
{
GetPlayerName(i, playername, sizeof(playername));
GetPVarString(i, "WReason", reas, sizeof(reas));
format(string, 128, "%s\n%s (ID:%d)\t%d\t%s\n",string, playername, i, GetPlayerWantedLevel(i), reas);
format(str, sizeof(str), "Name\tLevel\tReason\n%s", string);
ShowPlayerDialog2(playerid, DIALOG_WANTED, DIALOG_STYLE_TABLIST_HEADERS, "Wanted Players", str, "Done", "");
return 1;
}
}
return 1;
}