Wanted List Dialog
#7

pawn Код:
if(strcmp(cmd, "/wanted2", true) == 0)
{
    string[0] = EOS; // clearing string array
    new namestr[MAX_PLAYER_NAME];//64 is too much since the max length of a name is like ~20
    for(new i, g = GetMaxPlayers(); i < g; i++)
        if(IsPlayerConnected(i))
        {
            if(PlayerData[i][pWantedLevel] != 0)
            {
                GetPlayerName(i,namestr,MAX_PLAYER_NAME);
                format(string,sizeof(string),"\n%s%s level: %d",string,namestr,PlayerData[i][pWantedLevel]);
            }
        }

    if(!string[0]) SendClientMessage(playerid,0xFFFFFFFF,"There are no wanted Players");
    else ShowPlayerDialog(playerid,500, DIALOG_STYLE_LIST, "Wanted List.",string,"Ok", "Cancel");

    return 1;
}

if(dialogid == 500)
{
    if(!response) return 1;

    new pos = strfind(inputtext," ",true);
    if(pos != -1)
    {
        inputtext[pos] = EOS;
        new giveplayerid;
        //giveplayerid = GetPlayerIdFromName(inputtext); you need add/find this function if there is no sscanf in your gamemode
        sscanf(inputtext,"u",giveplayerid);
        if(giveplayerid != INVALID_PLAYER_ID)
        {
            if(PlayerData[giveplayerid][pWantedLevel] > 0)
            {
                new Float:x, Float:y, Float:z;
                GetPlayerPos(giveplayerid, x, y, z);
                SetPlayerCheckpoint(playerid, x, y, z, 3.0);
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread
How do I find the player that I wanted selected in dialogue? - by w3b - 27.12.2015, 15:58
Re: Wanted List Dialog - by w3b - 27.12.2015, 19:56
Re: Wanted List Dialog - by SmoW - 27.12.2015, 20:02
Re: Wanted List Dialog - by w3b - 27.12.2015, 20:17
Re: Wanted List Dialog - by PrO.GameR - 27.12.2015, 20:22
Re: Wanted List Dialog - by w3b - 27.12.2015, 20:27
Re: Wanted List Dialog - by Jefff - 27.12.2015, 21:03

Forum Jump:


Users browsing this thread: 1 Guest(s)