Interiors dialog
#1

Hey, I am trying to do a dialog but everything just fucks up and I have now hard to understand what I am doing..

Could anyone give me a hand?

pawn Код:
#define HOUSES0 9900
#define HOUSES 9800
#define INT 38 // Interiors

CMD:interiors(playerid, params[])
{
    new text[128];

    if(PlayerInfo[playerid][pAdmin] >= 2)
    {
    ShowPlayerDialog(playerid, HOUSES, DIALOG_STYLE_LIST, "Interior Name || Interior ID", "Go!", "Exit");
    }
    else
    {
    SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to use this command.");
    }
 return 1;
}
pawn Код:
switch(dialogid){
                case HOUSES0:{
                        if(response){
                                selection[playerid] = listitem;
                                new text[1024];
                                for(new x;x<sizeof(Houses);x++){
                                format(text, sizeof(text), "%s%s || (%d)\n", text, Houses[x][interiorname], Houses[x][interior]);
                        }
                        ShowPlayerDialog(playerid, HOUSES, DIALOG_STYLE_LIST, "Interior Name || Interior ID", "Go!", "Exit");
                        }
                }
                case HOUSES:{
                        if(response){
                        new text[25];
                                SetPlayerPos(playerid, Houses[listitem][PosX], Houses[listitem][PosY], Houses[listitem][PosZ]);
                                SetPlayerInterior(playerid, Houses[listitem][interior]);
                                SetPlayerVirtualWorld(playerid, 0);
                                format(text, sizeof(text), "%s", Houses[listitem][interiorname]);
                                SendClientMessage(playerid, COLOR_WHITE, text);
                        }
                }
        }
pawn Код:
enum IntHouses{
        interior,
        Float:PosX,
        Float:PosY,
        Float:PosZ,
        interiorname[24]
};

new Houses[INT][IntHouses] = {
{0,1479.2269,-1699.7888,14.0469,"Los Santos"},
{2,2447.8704,-1704.4509,1013.5078,"Ryderґs House"},
{3,2496.0549,-1695.1749,1014.7422,"Johnsonґs House"},
{5,1267.8407,-776.9587,1091.9063,"MaddDog Mansion"},
{5,2233.6919,-1112.8107,1050.8828,"Safe House 1"},
{6,2194.7900,-1204.3500,1049.0234,"Safe House 2"},
{9,2319.1272,-1023.9562,1050.2109,"Safe House 3"},
{10,2261.0977,-1137.8833,1050.6328,"Safe House 4"},
{3,234.6087,1187.8195,1080.2578,"Burglary X1"},
{2,225.5707,1240.0643,1082.1406,"Burglary X2"},
{1,224.288,1289.1907,1082.1406,"Burglary X3"},
{5,239.2819,1114.1991,1080.9922,"Burglary X4"},
{15,295.1391,1473.3719,1080.2578,"Burglary Houses"},
{12,446.3247,509.9662,1001.4195,"Motel Room"},
{2,446.626,1397.738,1084.3047,"Pair Burglary"},
{5,227.7559,1114.3844,1080.9922,"Burglary X11"},
{4,261.1165,1287.2197,1080.2578,"Burglary  X12"},
{4,306.1966,307.819,1003.3047,"Michelle's Love Nest"},
{10,24.3769,1341.1829,1084.375,"Burglary X14"},
{4,221.6766,1142.4962,1082.6094,"Burglary X13"},
{12,2323.7063,-1147.6509,1050.7101,"Unused House"},
{6,344.9984,307.1824,999.1557,"Millie's Room"},
{4,-262.1759,1456.6158,1084.3672,"Burglary X15"},
{5,22.861,1404.9165,1084.4297,"Burglary X16"},
{5,140.3679,1367.8837,1083.8621,"Burglary X17"},
{6,234.2826,1065.229,1084.2101,"House X18"},
{6,-68.5145,1353.8485,1080.2109,"House X19"},
{15,-285.2511,1471.197,1084.375,"House X20"},
{8,2807.3604,-1171.7048,1025.5703,"Colonel Furhberger"},
{1,2216.1282,-1076.3052,1050.4844,"The Camel's Safehouse"},
{8,2365.1089,-1133.0795,1050.875,"Verdant Bluffs House"},
{8,-42.5267,1408.23,1084.4297,"Burglary X21"},
{11,2282.9099,-1138.2900,1050.8984,"Willowfield House"},
{9,84.9244,1324.2983,1083.8594,"Burglary X22"},
{9,260.7421,1238.2261,1084.2578,"Burglary X23"},
{2,269.6405,305.9512,999.1484,"Katie's Lovenest"},
{5,322.5014,303.6906,999.1484,"Barbara's Love nest"},
{1,245.2307,304.7632,999.1484,"Denise's Bedroom"}
};
+rep to whoever helps me.
Reply
#2

Wouldnt this change place -
pawn Код:
case HOUSES0:{
pawn Код:
ShowPlayerDialog(playerid, HOUSES0, DIALOG_STYLE_LIST, "Interior Name || Interior ID", "Go!", "Exit");
Changing "Houses" to "Houses0"
Reply
#3

I have taken back the original code but how to do so I don't have to click the "Continue" button before I get the interiors dialog? Codes..

pawn Код:
CMD:interiors(playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] >= 2)
    {
        new text[] = "In the next list, select where to go.";
        return ShowPlayerDialog(playerid, HOUSES0, DIALOG_STYLE_MSGBOX, "Interior Houses", text, "Continue", "Cancel");
        }
    }
    else
    {
    SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to use this command.");
    }
 return 1;
}
pawn Код:
switch(dialogid){
                case HOUSES0:{
                        if(response){
                                selection[playerid] = listitem;
                                new text[1024];
                                for(new x;x<sizeof(Houses);x++){
                                        format(text, sizeof(text), "%s%s || (%d)\n", text, Houses[x][interiorname], Houses[x][interior]);
                        }
                                ShowPlayerDialog(playerid, HOUSES, DIALOG_STYLE_LIST, "Interior Name || Interior ID", text, "Go!", "Exit");
                        }
                }
                case HOUSES:{
                        if(response){
                        new text[25];
                                SetPlayerPos(playerid, Houses[listitem][PosX], Houses[listitem][PosY], Houses[listitem][PosZ]);
                                SetPlayerInterior(playerid, Houses[listitem][interior]);
                                SetPlayerVirtualWorld(playerid, 0);
                                format(text, sizeof(text), "%s", Houses[listitem][interiorname]);
                                SendClientMessage(playerid, COLOR_WHITE, text);
                        }
                }
        }
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)