View Full Version : GetPlayerWantedLevel.

02/08/2012, 09:29 PM
I wanted to ask that how can we get a players wanted level by typing his name in the dialog message box.
It would be a real help please.

02/08/2012, 09:36 PM
Put this at the top of your script

#define FINDPLAYER 553

Put this where ever you want some one to get the message box (maybe a CMD)

ShowPlayerDialog(playerid, FINDPLAYER, DIALOG_STYLE_INPUT, "Find player's wanted level", "Type in the player's name to see their wanted level", "Enter", "");

Then put this under OnDialogResponse

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
if(dialogid == FINDPLAYER)
new name[24];
foreach(Player, targetid)
GetPlayerName(targetid, name, 24);
if(strfind(name, inputtext, true) != -1)
new string[50];
format(string, 50, "%s's Wanted level is %d", name, GetPlayerWantedLevel(targetid));
SendClientMessage(playerid, -1, string);
return 1;
return SendClientMessage(playerid, -1, "Name not found!");