SA-MP Forums Archive
Need some help on this script. - 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: Need some help on this script. (/showthread.php?tid=590388)



Need some help on this script. - Tixxt - 28.09.2015

I have this teleport script. With dialog etc . But when i select a teleport option it does not tele the player there? And just quits the dialog?

Help? Rep+

Код:
/* filterscript written by Connorlolz of the sa-mp forums. this may be a noob script, but don't steal it */

#include <a_samp>

#define COLOR_GREY              0x808080FF
#define Teleid                  13396
#define COLOR_WHITE             0xFFFFFFFF

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" Teleport FS By Connorlolz");
    print("--------------------------------------\n");
    return 1;
}


public OnFilterScriptExit()
{
    return 1;
}


#else

main()
{
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
}
#endif

public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/tele", cmdtext, true, 10) == 0) {
        ShowPlayerDialog(playerid, Teleid, DIALOG_STYLE_LIST, "Teleport Selection", "Los Santos\nSan Fierro\nLas Venturas\nAircraft Carrier\nMount Chilliad\nPig Pen\nShamal\nJefferson Motel\nLSPD\nSFPD\nLVPD\nBinco\nArea 69\nAndromada\nLos Santos Airport\nO.G Loc's\nLiberty City(outside)(buggy)\nBank\n Liberty City(inside)\nLS Atrium\nSherman Damn\n8-Track\nBloodbowl\nDirt Track\nKickstart\nVice Stadium\nStar Tower\nVehicle Basketball", "Select", "Cancel");

        return 1;
    }
    return 0;
}


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

                        SetPlayerInterior (playerid, 0);
                        SetPlayerPos(playerid, -302.5238,1519.8558,78.3594 );
                    }
                    case 1:
                    {
                        SetPlayerInterior (playerid, 0);
                        SetPlayerPos (playerid, -2900.9683,464.0657,4.9141 );
                    }
                    case 2:
                    {
                        SetPlayerInterior (playerid, 0);
                        SetPlayerPos (playerid, 2000.7534,1529.9393,14.6223 );
                    }
                    case 3:
                    {
                        SetPlayerInterior (playerid, 0);
                        SetPlayerPos (playerid, -1310.8959,499.1293,18.2344 );
                    }
                    case 4:
                    {
                        SetPlayerInterior (playerid, 0);
                        SetPlayerPos (playerid, -2321.5945,-1636.9006,483.7031);
                    }
                    case 5:
                    {
                        SetPlayerInterior(playerid, 2);
                        SetPlayerPos (playerid, 1204.809936,-11.586799,1000.921875);
                    }
                    case 6:
                    {
                        SetPlayerInterior(playerid, 1);
                        SetPlayerPos (playerid, 1.808619,32.384357,1199.593750);
                    }
                    case 7:
                    {
                        SetPlayerInterior(playerid, 15);
                        SetPlayerPos (playerid, 2215.454833,-1147.475585,1025.796875);
                    }
                    case 8:
                    {
                        SetPlayerInterior(playerid, 6);
                        SetPlayerPos (playerid, 246.783996,63.900199,1003.640625);
                    }
                    case 9:
                    {
                        SetPlayerInterior(playerid, 10);
                        SetPlayerPos (playerid, 246.375991,109.245994,1003.218750);
                    }
                    case 10:
                    {
                        SetPlayerInterior(playerid, 3);
                        SetPlayerPos (playerid, 288.745971,169.350997,1007.171875);
                    }
                    case 11:
                    {
                        SetPlayerInterior(playerid, 15);
                        SetPlayerPos (playerid, 207.737991,-109.019996,1005.132812);
                    }
					case 12:
					{
					    SetPlayerInterior(playerid, 0);
					    SetPlayerPos (playerid, 214.3151,1871.5281,13.1406);
					}
					case 13:
					{
					    SetPlayerInterior(playerid, 9);
					    SetPlayerPos (playerid, 315.745086,984.969299,1958.919067);
						SendClientMessage(playerid, COLOR_WHITE, "I wouldn't suggest skydiving, as your in an interior");
					}
					case 14:
					{
					    SetPlayerInterior(playerid, 0);
					    SetPlayerPos (playerid, 2096.8315,-2454.4473,13.5469);
					}
					case 15:
					{
					    SetPlayerInterior(playerid, 3);
					    SetPlayerPos (playerid, 513.882507,-11.269994,1001.565307);
					}
					case 16:
					{
					    SetPlayerInterior(playerid, 1);
					    SetPlayerPos (playerid, -729.276000,503.086944,1371.971801);
					}
					case 17:
					{
					    SetPlayerInterior(playerid, 0);
					    SetPlayerPos (playerid, 2315.952880,-1.618174,26.742187);
					}
					case 18:
					{
					    SetPlayerInterior(playerid, 1);
					    SetPlayerPos (playerid, -794.806396,497.738037,1376.195312);
					}
					case 19:
					{
						SetPlayerInterior(playerid, 18);
						SetPlayerPos (playerid, 1710.433715,-1669.379272,20.225049);
					}
					case 20:
					{
					    SetPlayerInterior(playerid, 17);
					    SetPlayerPos (playerid, -959.564392,1848.576782,9.000000);
					}
					case 21:
					{
					    SetPlayerInterior(playerid, 7);
					    SetPlayerPos (playerid, -1398.065307,-217.028900,1051.115844);
					}
					case 22:
					{
					    SetPlayerInterior(playerid, 15);
					    SetPlayerPos (playerid, -1398.103515,937.631164,1036.479125);
					}
					case 23:
					{
					    SetPlayerInterior(playerid, 4);
					    SetPlayerPos (playerid, -1444.645507,-664.526000,1053.572998);
					}
					case 24:
					{
					    SetPlayerInterior(playerid, 14);
					    SetPlayerPos (playerid, -1465.268676,1557.868286,1052.531250);
					}
					case 25:
					{
					    SetPlayerInterior(playerid, 1);
					    SetPlayerPos (playerid, -1401.829956,107.051300,1032.273437);
					}
					case 26:
					{
						SetPlayerPos (playerid,1544.9849,-1353.7681,329.4735);
						SetPlayerInterior(playerid, 0);
					}
					case 27:
					{
					    SetPlayerPos(playerid, 3362.55, -1522.44, 323.67);
					    SetPlayerInterior(playerid, 0);
					}
				}
            }
        }
    }
    return 0;
}



Re: Need some help on this script. - jlalt - 28.09.2015

would you try this? i hope it will work
PHP код:
/* filterscript written by Connorlolz of the sa-mp forums. this may be a noob script, but don't steal it */
#include <a_samp>
#define COLOR_GREY              0x808080FF
#define Teleid1                  13896
#define COLOR_WHITE             0xFFFFFFFF
public OnFilterScriptInit()
{
    print(
"\n--------------------------------------");
    print(
" Teleport FS By Connorlolz");
    print(
"--------------------------------------\n");
    return 
1;
}
public 
OnPlayerCommandText(playeridcmdtext[])
{
    if (
strcmp("/tele"cmdtexttrue10) == 0) {
        
ShowPlayerDialog(playeridTeleid1DIALOG_STYLE_LIST"Teleport Selection""Los Santos\nSan Fierro\nLas Venturas\nAircraft Carrier\nMount Chilliad\nPig Pen\nShamal\nJefferson Motel\nLSPD\nSFPD\nLVPD\nBinco\nArea 69\nAndromada\nLos Santos Airport\nO.G Loc's\nLiberty City(outside)(buggy)\nBank\n Liberty City(inside)\nLS Atrium\nSherman Damn\n8-Track\nBloodbowl\nDirt Track\nKickstart\nVice Stadium\nStar Tower\nVehicle Basketball""Select""Cancel");
        return 
1;
    }
    return 
0;
}
public 
OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    switch(
dialogid) {
        case 
Teleid1:
        {
            if (!
response) return SendClientMessage(playerid0xFF0000FF"You cancelled.");
            
            switch(
listitem) {
                    case 
0:
                    {
                        
SetPlayerInterior (playerid0);
                        
SetPlayerPos(playerid, -302.5238,1519.8558,78.3594 );
                    }
                    case 
1:
                    {
                        
SetPlayerInterior (playerid0);
                        
SetPlayerPos (playerid, -2900.9683,464.0657,4.9141 );
                    }
                    case 
2:
                    {
                        
SetPlayerInterior (playerid0);
                        
SetPlayerPos (playerid2000.7534,1529.9393,14.6223 );
                    }
                    case 
3:
                    {
                        
SetPlayerInterior (playerid0);
                        
SetPlayerPos (playerid, -1310.8959,499.1293,18.2344 );
                    }
                    case 
4:
                    {
                        
SetPlayerInterior (playerid0);
                        
SetPlayerPos (playerid, -2321.5945,-1636.9006,483.7031);
                    }
                    case 
5:
                    {
                        
SetPlayerInterior(playerid2);
                        
SetPlayerPos (playerid1204.809936,-11.586799,1000.921875);
                    }
                    case 
6:
                    {
                        
SetPlayerInterior(playerid1);
                        
SetPlayerPos (playerid1.808619,32.384357,1199.593750);
                    }
                    case 
7:
                    {
                        
SetPlayerInterior(playerid15);
                        
SetPlayerPos (playerid2215.454833,-1147.475585,1025.796875);
                    }
                    case 
8:
                    {
                        
SetPlayerInterior(playerid6);
                        
SetPlayerPos (playerid246.783996,63.900199,1003.640625);
                    }
                    case 
9:
                    {
                        
SetPlayerInterior(playerid10);
                        
SetPlayerPos (playerid246.375991,109.245994,1003.218750);
                    }
                    case 
10:
                    {
                        
SetPlayerInterior(playerid3);
                        
SetPlayerPos (playerid288.745971,169.350997,1007.171875);
                    }
                    case 
11:
                    {
                        
SetPlayerInterior(playerid15);
                        
SetPlayerPos (playerid207.737991,-109.019996,1005.132812);
                    }
                    case 
12:
                    {
                        
SetPlayerInterior(playerid0);
                        
SetPlayerPos (playerid214.3151,1871.5281,13.1406);
                    }
                    case 
13:
                    {
                        
SetPlayerInterior(playerid9);
                        
SetPlayerPos (playerid315.745086,984.969299,1958.919067);
                        
SendClientMessage(playeridCOLOR_WHITE"I wouldn't suggest skydiving, as your in an interior");
                    }
                    case 
14:
                    {
                        
SetPlayerInterior(playerid0);
                        
SetPlayerPos (playerid2096.8315,-2454.4473,13.5469);
                    }
                    case 
15:
                    {
                        
SetPlayerInterior(playerid3);
                        
SetPlayerPos (playerid513.882507,-11.269994,1001.565307);
                    }
                    case 
16:
                    {
                        
SetPlayerInterior(playerid1);
                        
SetPlayerPos (playerid, -729.276000,503.086944,1371.971801);
                    }
                    case 
17:
                    {
                        
SetPlayerInterior(playerid0);
                        
SetPlayerPos (playerid2315.952880,-1.618174,26.742187);
                    }
                    case 
18:
                    {
                        
SetPlayerInterior(playerid1);
                        
SetPlayerPos (playerid, -794.806396,497.738037,1376.195312);
                    }
                    case 
19:
                    {
                        
SetPlayerInterior(playerid18);
                        
SetPlayerPos (playerid1710.433715,-1669.379272,20.225049);
                    }
                    case 
20:
                    {
                        
SetPlayerInterior(playerid17);
                        
SetPlayerPos (playerid, -959.564392,1848.576782,9.000000);
                    }
                    case 
21:
                    {
                        
SetPlayerInterior(playerid7);
                        
SetPlayerPos (playerid, -1398.065307,-217.028900,1051.115844);
                    }
                    case 
22:
                    {
                        
SetPlayerInterior(playerid15);
                        
SetPlayerPos (playerid, -1398.103515,937.631164,1036.479125);
                    }
                    case 
23:
                    {
                        
SetPlayerInterior(playerid4);
                        
SetPlayerPos (playerid, -1444.645507,-664.526000,1053.572998);
                    }
                    case 
24:
                    {
                        
SetPlayerInterior(playerid14);
                        
SetPlayerPos (playerid, -1465.268676,1557.868286,1052.531250);
                    }
                    case 
25:
                    {
                        
SetPlayerInterior(playerid1);
                        
SetPlayerPos (playerid, -1401.829956,107.051300,1032.273437);
                    }
                    case 
26:
                    {
                        
SetPlayerPos (playerid,1544.9849,-1353.7681,329.4735);
                        
SetPlayerInterior(playerid0);
                    }
                    case 
27:
                    {
                        
SetPlayerPos(playerid3362.55, -1522.44323.67);
                        
SetPlayerInterior(playerid0);
                    }
                }
            }
        }
    return 
0;