19.04.2010, 13:00
Hey! I triedto make a /wanted cmd to show which player is wanted and how many stars they have.
If no one is wanted it return as it should, but if there is someone wanted it just say "Wanted Players:"
And dosen't tell who is wanted.
code:
I hope someone is able to fix this 
- Naxix
If no one is wanted it return as it should, but if there is someone wanted it just say "Wanted Players:"
And dosen't tell who is wanted.
code:
Код:
dcmd_wanted(playerid,params[]) { #pragma unused params new pid,string[128],wantedcount = 0,name[MAX_PLAYER_NAME]; for(new j=0;j<MAX_PLAYERS;j++) { if(GetPlayerWantedLevel(j) >= 1) wantedcount ++; if(wantedcount == 0) return SendClientMessage(playerid, COLOUR_GREY, "There are currently no wanted players."); else if(wantedcount >= 1) return SendClientMessage(playerid, COLOUR_BLUE, "Wanted players:"); for(new i=0;i<MAX_PLAYERS;i++) { if(IsPlayerConnected(i)) { if(GetPlayerWantedLevel(i) >= 1) { new stars = GetPlayerWantedLevel(pid); GetPlayerName(i,name,sizeof(name)); format(string,sizeof(string),"%s have %i stars",name,stars); SendClientMessage(playerid,COLOUR_BLUE,string); return 1; } } } } return 1; }

- Naxix