SA-MP Forums Archive
Something wrong with dialogs. (Pressing list item shows up login dialog)) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Something wrong with dialogs. (Pressing list item shows up login dialog)) (/showthread.php?tid=468875)



Something wrong with dialogs. (Pressing list item shows up login dialog)) - Scrillex - 10.10.2013

Hello dear samp forum members again I'm coming for an answer what is needed for me.
So when I press list item it shows me login dialog....

#defines
#define DIALOG_LOGIN (1)
#define DIALOG_VEH (6
pawn Код:
case DIALOG_LOGIN: {
            if(!response) return Kick(playerid);

            new
                query[300],
                escapedName[MAX_PLAYER_NAME],
                escapedPassword[129];

            GetPlayerName(playerid, szPlayerName, MAX_PLAYER_NAME);

            WP_Hash(escapedPassword, sizeof(escapedPassword), inputtext);

            mysql_real_escape_string(szPlayerName, escapedName);

            format(query, sizeof(query), "SELECT * FROM `playeraccounts` WHERE playerName = '%s' AND playerPassword = '%s'", escapedName, escapedPassword);
            mysql_query(query, THREAD_CHECK_CREDENTIALS, playerid);
        }
        case DIALOG_VEH:
        {
            if(!response)
                return 1;
            switch(listitem) {
                case 0:
                {
                    if(GetPVarInt(playerid, "Lights") == 0)
                    {
                        new veh = GetPlayerVehicleID(playerid);
                        new engine,lights,alarm,doors,bonnet,boot,objective;
                        GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                        SetVehicleParamsEx(veh,engine,VEHICLE_PARAMS_ON,alarm,doors,bonnet,boot,objective);
                        SetPVarInt(playerid, "Lights", 1);
                    }
                    else if(GetPVarInt(playerid, "Lights") == 1)
                    {
                        new veh = GetPlayerVehicleID(playerid);
                        new engine,lights,alarm,doors,bonnet,boot,objective;
                        GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                        SetVehicleParamsEx(veh,engine,VEHICLE_PARAMS_OFF,alarm,doors,bonnet,boot,objective);
                        SetPVarInt(playerid, "Lights", 0);
                    }
                }
                case 1:
                {
                    if(GetPVarInt(playerid, "Bonnet") == 0)
                    {
                        new veh = GetPlayerVehicleID(playerid);
                        new engine,lights,alarm,doors,bonnet,boot,objective;
                        GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                        SetVehicleParamsEx(veh,engine,lights,alarm,doors,VEHICLE_PARAMS_ON,boot,objective);
                        SetPVarInt(playerid, "Bonnet", 1);
                    }
                    else if(GetPVarInt(playerid, "Bonnet") == 1)
                    {
                        new veh = GetPlayerVehicleID(playerid);
                        new engine,lights,alarm,doors,bonnet,boot,objective;
                        GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                        SetVehicleParamsEx(veh,engine,lights,alarm,doors,VEHICLE_PARAMS_OFF,boot,objective);
                        SetPVarInt(playerid, "Bonnet", 0);
                    }
                }
                case 2:
                {
                    if(GetPVarInt(playerid, "Boot") == 0)
                    {
                        new veh = GetPlayerVehicleID(playerid);
                        new engine,lights,alarm,doors,bonnet,boot,objective;
                        GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                        SetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_ON,objective);
                        SetPVarInt(playerid, "Boot", 1);
                    }
                    else if(GetPVarInt(playerid, "Boot") == 1)
                    {
                        new veh = GetPlayerVehicleID(playerid);
                        new engine,lights,alarm,doors,bonnet,boot,objective;
                        GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                        SetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,VEHICLE_PARAMS_OFF,objective);
                        SetPVarInt(playerid, "Boot", 0);
                    }
                }
                case 3:
                {
                    if(GetPVarInt(playerid, "Doors") == 0)
                    {
                        new veh = GetPlayerVehicleID(playerid);
                        new engine,lights,alarm,doors,bonnet,boot,objective;
                        GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                        SetVehicleParamsEx(veh,engine,lights,alarm,VEHICLE_PARAMS_ON,bonnet,boot,objective);
                        SetPVarInt(playerid, "Doors", 1);
                    }
                    else if(GetPVarInt(playerid, "Doors") == 1)
                    {
                        new veh = GetPlayerVehicleID(playerid);
                        new engine,lights,alarm,doors,bonnet,boot,objective;
                        GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                        SetVehicleParamsEx(veh,engine,lights,alarm,VEHICLE_PARAMS_OFF,bonnet,boot,objective);
                        SetPVarInt(playerid, "Doors", 0);
                    }
                }
                case 4:
                {
                    if(GetPVarInt(playerid, "Engine") == 0)
                    {
                        new veh = GetPlayerVehicleID(playerid);
                        new engine,lights,alarm,doors,bonnet,boot,objective;
                        GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                        SetVehicleParamsEx(veh,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
                        SetPVarInt(playerid, "Engine", 1);
                    }
                    else if(GetPVarInt(playerid, "Engine") == 1)
                    {
                        new veh = GetPlayerVehicleID(playerid);
                        new engine,lights,alarm,doors,bonnet,boot,objective;
                        GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
                        SetVehicleParamsEx(veh,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
                        SetPVarInt(playerid, "Engine", 0);
                    }
                }
            }
        }
    }
    return 1;
}
With best regards Scrillex.


AW: Something wrong with dialogs. (Pressing list item shows up login dialog)) - Nero_3D - 10.10.2013

Recheck the ids of the dialogs and print the parameter from OnDialogReponse


Re: Something wrong with dialogs. (Pressing list item shows up login dialog)) - Scrillex - 10.10.2013

Uhh added dialog ids... I could maybe add all dialog response.. Yeah about printing it didn't help.. At first it was lights.. now it shows Bonnet as login dialog..


Re: Something wrong with dialogs. (Pressing list item shows up login dialog)) - iGetty - 10.10.2013

Is this in a filterscript?


Re: Something wrong with dialogs. (Pressing list item shows up login dialog)) - Scrillex - 10.10.2013

Sorry for bump.. But any second click it gives back on login dialog...