GetPlayerWantedLevel.
#1

Hello,
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.
Reply
#2

Put this at the top of your script
pawn Код:
#define FINDPLAYER 553
Put this where ever you want some one to get the message box (maybe a CMD)
pawn Код:
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
pawn Код:
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!");
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)