Dialog list bug
#1

After I choose a floor it gives me the login dialog...any help?




Код:
// By Shabi RoxX

#include <a_samp>
#include <streamer>


main()
{
    print("\n----------------------------------");
    print("            Elevator                ");
    print("----------------------------------\n");
}



public OnGameModeInit()
{
    // you must create menu in OnGameModeInit



    SetGameModeText("Cops And Robbers");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
    return 1;
}


public OnGameModeExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    return 1;
}

public OnPlayerConnect(playerid)
{
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    return 1;
}

public OnPlayerSpawn(playerid)
{
	SetPlayerCheckpoint (playerid, -1916.9716,1112.4375,48.7100,3.0);
    return 1;
}


public OnPlayerDeath(playerid, killerid, reason)
{
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
    return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
    return 1;
}

public OnPlayerText(playerid, text[])
{
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/lift", cmdtext, true, 10) == 0)
    {
        // Do something here
        return 1;
    }
    return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 9.0, -1916.9716,1112.4375,48.7100))
{

		new Float:X, Float:Y, Float:Z;
		for(new i=0; i < MAX_PLAYERS; i++)
		{
			GetPlayerPos(i, X, Y, Z);
			if(IsPlayerConnected(i))//checking if player is connected else nothing
			{

				ShowPlayerDialog(i, 1, DIALOG_STYLE_LIST, "what floor do you want?", "Ground floor \nFirst Floor \nSecond Floor \nThirdFloor \nFourth Floor \nFifth Floor \nSixthFloor \nSeventh Floor \nEighth Floor \nNineth Floor \nTenthfloor \nEleventh Floor \nTwelefth Floor \nThirteenth Floor \nFourteenth Floor \nFifteenth Floor \nSixteenth Floor \nSeventeenth Floor \nEighteenth Floor \nNineteenth Floor \nRoof", "Select", "Cancel");
				return 1;

			}
		}
	}
return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
    return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
    return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
    return 1;
}

public OnRconCommand(cmd[])
{
    return 1;
}

public OnPlayerRequestSpawn(playerid)
{
    return 1;
}

public OnObjectMoved(objectid)
{
    return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    return 1;
}

public OnVehicleMod(playerid, vehicleid, componentid)
{
    return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
    return 1;
}

public OnVehicleRespray(playerid, vehicleid, color1, color2)
{
    return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
    return 1;
}

public OnPlayerExitedMenu(playerid)
{
    return 1;
}

public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
{
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    return 1;
}

public OnRconLoginAttempt(ip[], password[], success)
{
    return 1;
}

public OnPlayerUpdate(playerid)
{
    return 1;
}

public OnPlayerStreamIn(playerid, forplayerid)
{
    return 1;
}

public OnPlayerStreamOut(playerid, forplayerid)
{
    return 1;
}

public OnVehicleStreamIn(vehicleid, forplayerid)
{
    return 1;
}

public OnVehicleStreamOut(vehicleid, forplayerid)
{
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(response)// They pressed the first button.
    {
    switch(dialogid)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
        {
		case 1:// Our dialog!
    	    {
           	switch(listitem)// Checking which listitem was selected
        	{
            case 0://Ground
            {SetPlayerPos(playerid,-1916.9716,1112.4375,48.7100);}
            case 1: //First
            {SetPlayerPos(playerid,-1916.9716,1112.4375,48.7100+ 8.7396 + (1 * 5.45155));}
            case 2: //Second
            {SetPlayerPos(playerid, -1916.9716,1112.4375,48.7100+ 8.7396 + (2 * 5.45155));}
            case 3: //Third
            {SetPlayerPos(playerid,-1916.9716,1112.4375,48.7100+ 8.7396 + (3 * 5.45155));}
            case 4: //Fourth
            {SetPlayerPos(playerid,-1916.9716,1112.4375,48.7100+ 8.7396 + (4 * 5.45155) );}
            case 5: //Fifth
            {SetPlayerPos(playerid,-1916.9716,1112.4375,48.7100+ 8.7396 + (5 * 5.45155));}
            case 6: //Sixth
            {SetPlayerPos(playerid,-1916.9716,1112.4375,48.7100+ 8.7396 + (6 * 5.45155));}
            case 7: //Seventh
            {SetPlayerPos(playerid,-1916.9716,1112.4375,48.7100+ 8.7396 + (7 * 5.45155));}
            case 8: //Eighth
            {SetPlayerPos(playerid,-1916.9716,1112.4375,48.7100+ 8.7396 + (8 * 5.45155));}
            case 9: //Ninth
            {SetPlayerPos(playerid,-1916.9716,1112.4375,48.7100+ 8.7396 + (9 * 5.45155));}
            case 10: //Tenth
            {SetPlayerPos(playerid,-1916.9716,1112.4375,48.7100+ 8.7396 + (10 * 5.45155));}
            case 11: //Eleventh
            {SetPlayerPos(playerid,-1916.9716,1112.4375,48.7100+ 8.7396 + (11 * 5.45155));}
            case 12: //Twelth
            {SetPlayerPos(playerid,-1916.9716,1112.4375,48.7100+ 8.7396 + (12 * 5.45155));}
            case 13: //Thirteenth
            {SetPlayerPos(playerid,-1916.9716,1112.4375,48.7100+ 8.7396 + (13 * 5.45155));}
            case 14: //Fourteenth
            {SetPlayerPos(playerid,-1916.9716,1112.4375,48.7100+ 8.7396 + (14 * 5.45155));}
            case 15: //Fifteenth
            {SetPlayerPos(playerid,-1916.9716,1112.4375,48.7100+ 8.7396 + (15 * 5.45155));}
            case 16: //Sixteenth
            {SetPlayerPos(playerid,-1916.9716,1112.4375,48.7100+ 8.7396 + (16 * 5.45155));}
            case 17: //Seventeenth
            {SetPlayerPos(playerid,-1916.9716,1112.4375,48.7100+ 8.7396 + (17 * 5.45155));}
            case 18: //Eighteenth
            {SetPlayerPos(playerid,-1916.9716,1112.4375,48.7100+ 8.7396 + (18 * 5.45155));}
            case 19: //Nineteenth
            {SetPlayerPos(playerid,-1916.9716,1112.4375,48.7100+ 8.7396 + (19 * 5.45155));}
            case 20: //Penthouse
            {SetPlayerPos(playerid,-1916.9716,1112.4375,48.7100+ 8.7396 + (20 * 5.45155));}
            case 21: //Roof
            {SetPlayerPos(playerid,-1916.9716,1112.4375,48.7100+ 8.7396 + (21 * 5.45155));}
        	    }
				}
			}
		}
    }



//
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
    return 1;
}
Reply
#2

if you are using a login filterscript then you probably have a dialog id mixed up somewhere, if this fixes it then thats your problem.
pawn Код:
ShowPlayerDialog(i, 1000, DIALOG_STYLE_LIST, "what floor do you want?", "Ground floor \nFirst Floor \nSecond Floor \nThirdFloor \nFourth Floor \nFifth Floor \nSixthFloor \nSeventh Floor \nEighth Floor \nNineth Floor \nTenthfloor \nEleventh Floor \nTwelefth Floor \nThirteenth Floor \nFourteenth Floor \nFifteenth Floor \nSixteenth Floor \nSeventeenth Floor \nEighteenth Floor \nNineteenth Floor \nRoof", "Select", "Cancel");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)