Peršokti į turinį

Klausimas dėl dialogų


Recommended Posts

Laba diena. Šiandien kūriau dialogą ir vis tiek man galva neįšneša kaip padaryti, kad kai paspaudžia Atšaukti atšauktų, o pasirinkti tai pasirinktų, nes dabar taip yra, kad jis betka paspaudžia ir jį nuteleportuoją.

 

COMMAND:ateles(playerid, params[])
{
    if(playerDB[playerid][admin] < 4) return 0;
    ShowPlayerDialog(playerid,4051,DIALOG_STYLE_LIST,"ATELES","1. SF \n2. Ls\n3. Laikinai neveikia\n", "Pasirinkti", "Atšaukti");
    return 1;
}

 

Ir dialogas: 

 

    if(dialogid == 4051)
    {
            switch (listitem)
            {
                case 0:
                  {
                    new vehicleid = GetPlayerVehicleID(playerid);
                    SetVehiclePos(vehicleid,-1566.7825,702.5635,6.8380);
                    SetPlayerPos(playerid, -1566.7825,702.5635,6.8380);
                    PutPlayerInVehicle(playerid, vehicleid, 0);
                    SendClientMessage(playerid,WHITE,"atsileportavai{43C6DB}SF{ffffff}.");
                }
                case 1:
                  {
                    new vehicleid = GetPlayerVehicleID(playerid);
                    SetVehiclePos(vehicleid,-2028.2756,-95.4288,34.8911);
                    SetPlayerPos(playerid, -2028.2756,-95.4288,34.8911);
                    PutPlayerInVehicle(playerid, vehicleid, 0);
                    SendClientMessage(playerid,WHITE,"atsileportavai{43C6DB}Ls{ffffff}.");
                }
                case 2:
                  {
                    new vehicleid = GetPlayerVehicleID(playerid);
                    SetVehiclePos(vehicleid,-2165.2327,252.5585,35.3203);
                    SetPlayerPos(playerid, -2165.2327,252.5585,35.3203);
                    PutPlayerInVehicle(playerid, vehicleid, 0);
                    SendClientMessage(playerid,WHITE,"atsileportavai{43C6DB}SF{ffffff}.");
                }
                case 3:
                  {
                    new vehicleid = GetPlayerVehicleID(playerid);
                    SetVehiclePos(vehicleid,-2757.4138,373.8284,4.3399);
                    SetPlayerPos(playerid, -2757.4138,373.8284,4.3399);
                    PutPlayerInVehicle(playerid, vehicleid, 0);
                    SendClientMessage(playerid,WHITE,"atsileportavai{43C6DB}SF{ffffff}.");
                }
            }
        }

Redaguota , nario Tautedorus
Nuoroda į komentarą
Dalintis per kitą puslapį

if(dialogid == 4051)
{
	if(response) // Pasirinkti
	{
		new vehicleid = GetPlayerVehicleID(playerid);
		switch(listitem)
		{
			case 0:
			{
				SetVehiclePos(vehicleid, -1566.7825, 702.5635, 6.8380);
				SetPlayerPos(playerid, -1566.7825, 702.5635, 6.8380);
				SendClientMessage(playerid, WHITE, "atsileportavai{43C6DB}SF{ffffff}.");
			}
			case 1:
			{
				SetVehiclePos(vehicleid, -2028.2756, -95.4288, 34.8911);
				SetPlayerPos(playerid, -2028.2756, -95.4288, 34.8911);
				SendClientMessage(playerid, WHITE, "atsileportavai{43C6DB}Ls{ffffff}.");
			}
			case 2:
			{
				SetVehiclePos(vehicleid, -2165.2327, 252.5585, 35.3203);
				SetPlayerPos(playerid, -2165.2327, 252.5585, 35.3203);
				SendClientMessage(playerid, WHITE, "atsileportavai{43C6DB}SF{ffffff}.");
			}
			case 3:
			{
				SetVehiclePos(vehicleid, -2757.4138, 373.8284, 4.3399);
				SetPlayerPos(playerid, -2757.4138, 373.8284, 4.3399);
				SendClientMessage(playerid, WHITE, "atsileportavai{43C6DB}SF{ffffff}.");
			}
		}
		PutPlayerInVehicle(playerid, vehicleid, 0);
	}
	else // Atšaukti
	{
	    /* Kažkoks kodas, jeigu reikia */
	}
}

 

Nuoroda į komentarą
Dalintis per kitą puslapį

Po:

if(dialogid == 4051)
{

Dėk:

if(response) //Jeigu paspaudė pasirinkti
if(!response) //Jeigu paspaudė atšaukti

Visas kodas turėtų būti toks:

if(dialogid == 4051)
{
	if(response)
	{
		switch (listitem)
    		{
                	case 0:
                  	{
                    		new vehicleid = GetPlayerVehicleID(playerid);
                    		SetVehiclePos(vehicleid,-1566.7825,702.5635,6.8380);
                    		SetPlayerPos(playerid, -1566.7825,702.5635,6.8380);
                    		PutPlayerInVehicle(playerid, vehicleid, 0);
                    		SendClientMessage(playerid,WHITE,"atsileportavai{43C6DB}SF{ffffff}.");
                	}
                	case 1:
                  	{
                    		new vehicleid = GetPlayerVehicleID(playerid);
                    		SetVehiclePos(vehicleid,-2028.2756,-95.4288,34.8911);
                    		SetPlayerPos(playerid, -2028.2756,-95.4288,34.8911);
                    		PutPlayerInVehicle(playerid, vehicleid, 0);
                    		SendClientMessage(playerid,WHITE,"atsileportavai{43C6DB}Ls{ffffff}.");
                	}
                	case 2:
                  	{
                    		new vehicleid = GetPlayerVehicleID(playerid);
                    		SetVehiclePos(vehicleid,-2165.2327,252.5585,35.3203);
                    		SetPlayerPos(playerid, -2165.2327,252.5585,35.3203);
                    		PutPlayerInVehicle(playerid, vehicleid, 0);
                    		SendClientMessage(playerid,WHITE,"atsileportavai{43C6DB}SF{ffffff}.");
                	}
                	case 3:
                  	{
                    		new vehicleid = GetPlayerVehicleID(playerid);
                    		SetVehiclePos(vehicleid,-2757.4138,373.8284,4.3399);
                    		SetPlayerPos(playerid, -2757.4138,373.8284,4.3399);
                    		PutPlayerInVehicle(playerid, vehicleid, 0);
                    		SendClientMessage(playerid,WHITE,"atsileportavai{43C6DB}SF{ffffff}.");
                	}
            	}
        }
}

 

Nuoroda į komentarą
Dalintis per kitą puslapį

35 minutes prieš, ES.^ parašė:
if(dialogid == 4051)
{
	if(response) // Pasirinkti
	{
		new vehicleid = GetPlayerVehicleID(playerid);
		switch(listitem)
		{
			case 0:
			{
				SetVehiclePos(vehicleid, -1566.7825, 702.5635, 6.8380);
				SetPlayerPos(playerid, -1566.7825, 702.5635, 6.8380);
				SendClientMessage(playerid, WHITE, "atsileportavai{43C6DB}SF{ffffff}.");
			}
			case 1:
			{
				SetVehiclePos(vehicleid, -2028.2756, -95.4288, 34.8911);
				SetPlayerPos(playerid, -2028.2756, -95.4288, 34.8911);
				SendClientMessage(playerid, WHITE, "atsileportavai{43C6DB}Ls{ffffff}.");
			}
			case 2:
			{
				SetVehiclePos(vehicleid, -2165.2327, 252.5585, 35.3203);
				SetPlayerPos(playerid, -2165.2327, 252.5585, 35.3203);
				SendClientMessage(playerid, WHITE, "atsileportavai{43C6DB}SF{ffffff}.");
			}
			case 3:
			{
				SetVehiclePos(vehicleid, -2757.4138, 373.8284, 4.3399);
				SetPlayerPos(playerid, -2757.4138, 373.8284, 4.3399);
				SendClientMessage(playerid, WHITE, "atsileportavai{43C6DB}SF{ffffff}.");
			}
		}
		PutPlayerInVehicle(playerid, vehicleid, 0);
	}
	else // Atšaukti
	{
	    /* Kažkoks kodas, jeigu reikia */
	}
}

 

Dėkui labai.

 

34 minutes prieš, Siloraq parašė:

Po:

if(dialogid == 4051)
{

Dėk:

if(response) //Jeigu paspaudė pasirinkti
if(!response) //Jeigu paspaudė atšaukti

Visas kodas turėtų būti toks:

if(dialogid == 4051)
{
	if(response)
	{
		switch (listitem)
    		{
                	case 0:
                  	{
                    		new vehicleid = GetPlayerVehicleID(playerid);
                    		SetVehiclePos(vehicleid,-1566.7825,702.5635,6.8380);
                    		SetPlayerPos(playerid, -1566.7825,702.5635,6.8380);
                    		PutPlayerInVehicle(playerid, vehicleid, 0);
                    		SendClientMessage(playerid,WHITE,"atsileportavai{43C6DB}SF{ffffff}.");
                	}
                	case 1:
                  	{
                    		new vehicleid = GetPlayerVehicleID(playerid);
                    		SetVehiclePos(vehicleid,-2028.2756,-95.4288,34.8911);
                    		SetPlayerPos(playerid, -2028.2756,-95.4288,34.8911);
                    		PutPlayerInVehicle(playerid, vehicleid, 0);
                    		SendClientMessage(playerid,WHITE,"atsileportavai{43C6DB}Ls{ffffff}.");
                	}
                	case 2:
                  	{
                    		new vehicleid = GetPlayerVehicleID(playerid);
                    		SetVehiclePos(vehicleid,-2165.2327,252.5585,35.3203);
                    		SetPlayerPos(playerid, -2165.2327,252.5585,35.3203);
                    		PutPlayerInVehicle(playerid, vehicleid, 0);
                    		SendClientMessage(playerid,WHITE,"atsileportavai{43C6DB}SF{ffffff}.");
                	}
                	case 3:
                  	{
                    		new vehicleid = GetPlayerVehicleID(playerid);
                    		SetVehiclePos(vehicleid,-2757.4138,373.8284,4.3399);
                    		SetPlayerPos(playerid, -2757.4138,373.8284,4.3399);
                    		PutPlayerInVehicle(playerid, vehicleid, 0);
                    		SendClientMessage(playerid,WHITE,"atsileportavai{43C6DB}SF{ffffff}.");
                	}
            	}
        }
}

 

dq

Nuoroda į komentarą
Dalintis per kitą puslapį

Svečias
Ši tema yra užrakinta.
  • Šiame puslapyje naršo:   0 nariai

    • Nėra registruotų narių peržiūrinčių šį forumą.

×
×
  • Sukurti naują...