SA-MP Forums Archive
DIALOG TELEPORT NOT WORKING AND NEED MORE HELP - 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: DIALOG TELEPORT NOT WORKING AND NEED MORE HELP (/showthread.php?tid=647835)



DIALOG TELEPORT NOT WORKING AND NEED MORE HELP - ConnorG - 12.01.2018

Hi guys, i have problems with this Dialog teleport, i can compiler them can use it (just show dialog and, clicked Floor 1/2/3/4 but did not teleport) and i want set this dialog just can use at this point (1079.6085,2346.6362,10.8203).
My English not good, sorry.
Код:
#include <a_samp>
#include <zcmd>

#define DIALOG_TELEPORT 1
#define Teleid	13396


CMD:elevator(playerid,params[])
{
	ShowPlayerDialog(playerid, DIALOG_TELEPORT, DIALOG_STYLE_LIST, "Elevator", "Floor 1\nFloor 2\nFloor 3\Floor 4", "Go", "Cancel");
	return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	if(dialogid == DIALOG_TELEPORT)
	{
    	switch(dialogid) {
        	case Teleid:
        	{
            	if (!response) return SendClientMessage(playerid, 0xFF0000FF, "You cancelled.");
            	if(response) {
                	switch(listitem) {
                    	case 0:
                    	{

	                        SetPlayerInterior (playerid, 0);
    	                   	SetPlayerPos(playerid, 1146.1284,2213.0630,16.7188);
        	            }
            	        case 1:
                	    {
                    	    SetPlayerInterior (playerid, 0);
                        	SetPlayerPos(playerid, 1121.3375,2214.4021,19.7628);
                    	}
                    	case 2:
                    	{
                        	SetPlayerInterior (playerid, 0);
                        	SetPlayerPos(playerid, 1071.8690,2215.1221,16.7188);
                    	}
                    	case 3:
                    	{
                        	SetPlayerInterior (playerid, 0);
                       	 	SetPlayerPos(playerid, 1146.5698,2334.1914,10.8203);
                    	}
                    	case 4:
                    	{
                        	SetPlayerInterior (playerid, 0);
                        	SetPlayerPos (playerid, -2321.5945,-1636.9006,483.7031);
                    	}
                  	}
				}
			}
  		}
   	}
    return 0;
}



Re: DIALOG TELEPORT NOT WORKING AND NEED MORE HELP - DelK - 12.01.2018

Where is case Teleid you put case DIALOG_TELEPORT:

Код:
CMD:elevador(playerid)
{
	if(IsPlayerInRangeOfPoint(playerid, 1.0, 1079.6085,2346.6362,10.8203))
	{
		ShowPlayerDialog (playerid, DIALOG_TELEPORT, DIALOG_STYLE_LIST, "Elevador", "Floor 1 \ nFloor 2 \ nFloor 3 \ Floor 4", "Go", "Cancelar");
		return 1;
	}
	return 1;
}



Re: DIALOG TELEPORT NOT WORKING AND NEED MORE HELP - ConnorG - 12.01.2018

I dont understand, so you can help me pls? I'm newbie in Scripting, so i'm learning...


Re: DIALOG TELEPORT NOT WORKING AND NEED MORE HELP - Sew_Sumi - 12.01.2018

What DelK means is that you've got
Код:
case Teleid:
in your code, and yet it's not doing anything, nor is it even referenced. Who made the code if it's not you, and if it isn't yours, then was it working prior to messing about with it?

That case statement is likely to have made it not work. Your indentation also needs work, as it makes your code difficult to track, and looks messy.


Re: DIALOG TELEPORT NOT WORKING AND NEED MORE HELP - KyNe - 12.01.2018

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_TELEPORT)
	{
		if(response)
		{
			if(listitem == 0)
			{
            SetPlayerInterior (playerid, 0);
    	    SetPlayerPos(playerid, 1146.1284,2213.0630,16.7188);
 			}
			if(listitem == 1)
			{
            SetPlayerInterior (playerid, 0);
            SetPlayerPos(playerid, 1121.3375,2214.4021,19.7628);
  			}
			if(listitem == 2)
			{
  	        SetPlayerInterior (playerid, 0);
            SetPlayerPos(playerid, 1071.8690,2215.1221,16.7188);
  			}
			if(listitem == 3)
			{
            SetPlayerInterior (playerid, 0);
      	 	SetPlayerPos(playerid, 1146.5698,2334.1914,10.8203);
  			}
  			if(listitem == 4)
  			{
  			SetPlayerInterior (playerid, 0);
            SetPlayerPos (playerid, -2321.5945,-1636.9006,483.7031);
  			}
	    }
	}
	return 1;
}



Re: DIALOG TELEPORT NOT WORKING AND NEED MORE HELP - Sew_Sumi - 12.01.2018

You forgot to copy-paste the error for !response KyNe...

This also teaches nothing, and simply encourages not trying and asking for code on the forums.


As you may notice OP, they've removed the case statement, they've re-indented all your code, and the error message was a casualty of this hack-and-slash 'method' that some of these guys use in copy-paste rep-farming.