Dialog won't show up
#1

Hi there. I'm making an MDC system, but for some weird reason whenever I type in a name of the player, the results dialog won't show up. But if I type in a name of the player that's not connected or I type in something random, the dialog that tells me that there's no results shows up fine.

Can anyone help me out?

pawn Код:
if(dialogid == 54)
    {
        if(!response) return ShowPlayerDialog(playerid,53,DIALOG_STYLE_LIST, "San Andreas State Police - Mobile Database Center", "Search Name\nRun Number Plates\nTrace Cellphone\nView Wanted\nIssue APB\nCancel APB\nRequest Backup", "Select", "Cancel");
        if(strlen(inputtext) < 1 || strlen(inputtext) > MAX_PLAYER_NAME) return ShowPlayerDialog(playerid, 54, DIALOG_STYLE_INPUT, "MDC - {FF0000}No Results", "Please enter a name:", "Search", "Back");  
        new user;
        user = ReturnUser(inputtext);
        if(!IsPlayerConnected(user)) return ShowPlayerDialog(playerid, 54, DIALOG_STYLE_INPUT, "MDC - {FF0000}No Results", "Please enter a name:", "Search", "Back");  
       
                new i = user;
                new string[1024], name[MAX_PLAYER_NAME], surname[2][50];
                GetPlayerName(playerid, name, sizeof(name));
                split(name, surname, '_');
               
                new houselocation[MAX_ZONE_NAME];
                GetCoords2DZone(Houses[PlayerInfo[i][pHouseKey]][EnterX],Houses[PlayerInfo[i][pHouseKey]][EnterY], houselocation, MAX_ZONE_NAME);

               
                new address[100], baddress[100];
                if(PlayerInfo[i][pHouseKey] != 255)
                {
                    format(address, 100, "%d %s", PlayerInfo[i][pHouseKey], houselocation);
                }
                else
                {
                    format(address, 100, "None");
                }
               
               
                if(PlayerInfo[i][pBizKey] != 255)
                {
                    format(baddress, 100, "%s", Businesses[PlayerInfo[i][pBizKey]][BusinessName]);
                }
                else
                {
                    format(baddress, 100, "None");
                }
               
               
               
               
               
                new cname[3][70];
                if(PlayerInfo[playerid][pVeh1Model] != -1)
                {
                    format(cname[0], 70, "%s", VehicleNames[PlayerInfo[i][pVeh1Model]-400]);
                }
                else format(cname[0], 70, "None");
               
                if(PlayerInfo[playerid][pVeh2Model] != -1)
                {
                    format(cname[1], 70, "%s", VehicleNames[PlayerInfo[i][pVeh2Model]-400]);
                }
                else format(cname[1], 70, "None");
               
                if(PlayerInfo[playerid][pVeh3Model] != -1)
                {
                    format(cname[2], 70, "%s", VehicleNames[PlayerInfo[i][pVeh3Model]-400]);
                }
                else format(cname[2], 70, "None");
               
               
               
               
               
                format(string, sizeof(string), "First name: %s\nLast name: %s\nAddress: %s\nCellphone: %i\nBusiness: %s\nModel: %s\nPlate: %s\nModel: %s\nPlate: %s\nModel: %s\nPlate: %s\n\n", surname[0], surname[1], address, PlayerInfo[playerid][pPhoneNumber], baddress, cname[0], PlayerInfo[i][pVeh1License], cname[1], PlayerInfo[i][pVeh2License], cname[2], PlayerInfo[i][pVeh3License]);
               
                if(PlayerInfo[i][pWanted] == 1)
                {
                    format(string, sizeof(string), "%sStatus: {FF0000}WANTED\n{A9C4E4}Wanted For: {FF0000}%s",string, PlayerInfo[i][pWantedFor]);
                }
                else
                {
                    format(string, sizeof(string), "%sStatus: {00FF00}NOT WANTED\n{A9C4E4}Wanted For: {00FF00}None", string);
                }
                ShowPlayerDialog(playerid, 59, DIALOG_STYLE_LIST, "MDC Result", string, "Back", "Close");
                return 1;
    }
Reply
#2

At the bottom you have
pawn Код:
ShowPlayerDialog(playerid, 59, DIALOG_STYLE_LIST, "MDC Result", string, "Back", "Close");
You need to use that in a command for example.

pawn Код:
COMMAND:mdc(playerid, params[])
{
       ShowPlayerDialog(playerid, 59, DIALOG_STYLE_LIST, "MDC Result", string, "Back", "Close");
       return 1;
}
Reply
#3

Hmm, I don't think that's the problem. Other dialogs show up just fine.

Anyways, I edited the code a bit, and now it works for everyone except ID 0. If ID 0 types in the name of any player in the MDC, the dialog for him won't show.

pawn Код:
if(dialogid == 54)
    {
        if(!response) return ShowPlayerDialog(playerid,53,DIALOG_STYLE_LIST, "San Andreas State Police - Mobile Database Center", "Search Name\nRun Number Plates\nTrace Cellphone\nView Wanted\nIssue APB\nCancel APB\nRequest Backup", "Select", "Cancel");
        if(strlen(inputtext) < 1 || strlen(inputtext) > MAX_PLAYER_NAME) return ShowPlayerDialog(playerid, 54, DIALOG_STYLE_INPUT, "MDC - {FF0000}No Results", "Please enter a name:", "Search", "Back");  
        new user;
        user = ReturnUser(inputtext);
        if(!IsPlayerConnected(user)) return ShowPlayerDialog(playerid, 54, DIALOG_STYLE_INPUT, "MDC - {FF0000}No Results", "Please enter a name:", "Search", "Back");  
        new i = user;
        new string[1024];
       
        new address[100], baddress[100];
        if(PlayerInfo[i][pHouseKey] != 255)
        {
            new loc[MAX_ZONE_NAME], n;
            n = PlayerInfo[i][pHouseKey];
            GetCoords2DZone(Houses[n][EnterX],Houses[n][EnterY], loc, MAX_ZONE_NAME);
            format(address, 100, "%d %s", PlayerInfo[i][pHouseKey], loc);
        }
        else
        {
            format(address, 100, "None");
        }
        print("1");    
               
        if(PlayerInfo[i][pBizKey] != 255)
        {
            format(baddress, 100, "%s", Businesses[PlayerInfo[i][pBizKey]][BusinessName]);
        }
        else
        {
            format(baddress, 100, "None");
        }
        print("2");    
               
        new cname[3][70];
        if(PlayerInfo[playerid][pVeh1Model] != -1)
        {
            format(cname[0], 70, "%s", VehicleNames[PlayerInfo[i][pVeh1Model]-400]);
        }
        else format(cname[0], 70, "None");
        print("3");    
        if(PlayerInfo[playerid][pVeh2Model] != -1)
        {
            format(cname[1], 70, "%s", VehicleNames[PlayerInfo[i][pVeh2Model]-400]);
        }
        else format(cname[1], 70, "None");
        print("4");    
        if(PlayerInfo[playerid][pVeh3Model] != -1)
        {
            format(cname[2], 70, "%s", VehicleNames[PlayerInfo[i][pVeh3Model]-400]);
        }
        else format(cname[2], 70, "None");
        print("5");    
               
        format(string, sizeof(string), "Full Name: %s\nAddress: %s\nCellphone: %i\nBusiness: %s\nModel: %s\nPlate: %s\nModel: %s\nPlate: %s\nModel: %s\nPlate: %s\n\n", GetPlayerNameEx(i), address, PlayerInfo[playerid][pPhoneNumber], baddress, cname[0], PlayerInfo[i][pVeh1License], cname[1], PlayerInfo[i][pVeh2License], cname[2], PlayerInfo[i][pVeh3License]);
        print("Formatted the string");     
               
                if(PlayerInfo[i][pWanted] == 1)
                {
                    format(string, sizeof(string), "%sStatus: {FF0000}WANTED\n{A9C4E4}Wanted For: {FF0000}%s",string, PlayerInfo[i][pWantedFor]);
                }
                else
                {
                    format(string, sizeof(string), "%sStatus: {00FF00}NOT WANTED\n{A9C4E4}Wanted For: {00FF00}None", string);
                }
        print(string);
        ShowPlayerDialog(playerid, 59, DIALOG_STYLE_MSGBOX, "MDC Result", string, "Back", "Close");
        return 1;
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)