SA-MP Forums Archive
Need Help With Teleport Menu - 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 Help With Teleport Menu (/showthread.php?tid=344932)



Need Help With Teleport Menu - Jarnu - 23.05.2012

pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>

//COLORS
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_BRIGHTRED 0xFF0000AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_PINK 0xFF66FFAA
#define COLOR_BLUE 0x3A47DEFF
#define COLOR_TAN 0xBDB76BAA
#define COLOR_PURPLE 0x800080AA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_INDIGO 0x4B00B0AA
#define COLOR_BLACK 0x00000000
#define COLOR_DARKGREY 0x696969FF
#define COLOR_GOLD     0xF6C861AA

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print("Teleport Menu!");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#else

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

#endif

public OnFilterScriptExit()
{
    return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/teleport", cmdtext, true, 10) == 0)
    {
        ShowPlayerDialog(playerid, 2322, DIALOG_STYLE_LIST,"Teleports","BaseJump1\nBaseJump2\nBaseJump3\nBaseJump4\nBaseJump5\nBaseJump6\nBaseJump7\nBaseJump8\nStunt Run\nStuntJump\nDerby\nParkour\nWarZone\nDeathMatch\nLas Venturas Stunt\nLas Venturas\nLas Venturas Drift\nLos Santos Stunts\nLos Santos\nSan Fierro\nDesert Stunts","Teleport","");
        return 1;
    }
    return 0;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 2322 && response)
{
 switch(listitem)
 {
    case 0:
    {
SetPlayerPos(playerid, 1666.7014,-1218.3112,233.3750);
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, COLOR_YELLOW, "Welcome to BaseJump 1");
GivePlayerWeapon(playerid, 46, 1);
}
    case 1:
    {
        SetPlayerPos(playerid, -1812.7672,559.2889,273.1258);
        SetPlayerInterior(playerid, 0);
        SendClientMessage(playerid, COLOR_YELLOW, "Welcome to BaseJump 2");
        GivePlayerWeapon(playerid, 46, 1);
    }
    case 2:
    {
       SetPlayerPos(playerid,2067.9290,2437.1096,165.6172);
       SetPlayerInterior(playerid, 0);
       SendClientMessage(playerid,COLOR_PINK, "Welcome to BaseJump 3");
       GivePlayerWeapon(playerid,46,1);
    }
    case 3:
    {
       SetPlayerPos(playerid,1670.7603,-1343.0720,158.4766);
       SetPlayerInterior(playerid, 0);
       SendClientMessage(playerid,COLOR_PINK, "Welcome to BaseJump 4");
       GivePlayerWeapon(playerid,46,1);
    }
    case 4:
    {
       SetPlayerPos(playerid,-1280.4670,49.5875,70.5295);
       SetPlayerInterior(playerid, 0);
       SendClientMessage(playerid,COLOR_PINK, "Welcome to BaseJump 5");
       GivePlayerWeapon(playerid,46,1);
    }
    case 5:
    {
       SetPlayerPos(playerid,-1013.4426,-703.5352,136.3203);
       SetPlayerInterior(playerid, 0);
       SendClientMessage(playerid,COLOR_PINK, "Welcome to BaseJump 6");
       GivePlayerWeapon(playerid,46,1);
    }
    case 6:
        {
        SetPlayerPos(playerid,-2662.2515,1933.5365,225.7578);
        SetPlayerInterior(playerid, 0);
        SendClientMessage(playerid,COLOR_GREEN,"Welcome to BaseJump 7");
        GivePlayerWeapon(playerid,46,1);
    }
    case 7:
        {
        SetPlayerPos(playerid,-2662.2515,1933.5365,225.7578);
        SetPlayerInterior(playerid, 0);
        SendClientMessage(playerid,COLOR_GREEN,"Welcome to BaseJump 8");
        GivePlayerWeapon(playerid,46,1);
    }
    case 8:
    {
SetPlayerPos(playerid,1285.6987, 2168.1829, 768.5095);
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, COLOR_BLUE, "You have been Teleported To Stunt Run!");
}
    case 9:
{
SetPlayerPos(playerid, 3331.3096,811.2070,9.1215);
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, COLOR_GREEN,"Welcome To Stunt Jump");
}
    case 10:
{
SetPlayerPos(playerid, -234.8499,-256.2689,1.4297);
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, COLOR_GREEN,"Welcome to Derby");
}
    case 11:
{
SetPlayerPos(playerid, 1544.9849,-1353.7681,329.4735);
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, COLOR_GREEN,"Welcome to Parkour");
}
    case 12:
{
SetPlayerPos(playerid, 3004.041015625, -1493.2126464844, 747.49713134766);
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, COLOR_GREEN,"Welcome To War Zone");
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
GivePlayerWeapon(playerid, 24, 100);
}
    case 13:
{
SetPlayerPos(playerid, 1977.3790,1916.6001,130.9345);
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, COLOR_GREEN,"Welcome to Death Match Stadium");
GivePlayerWeapon(playerid, 24, 500);
GivePlayerWeapon(playerid, 27, 500);
GivePlayerWeapon(playerid, 31, 500);
}
    case 14:
{
SetPlayerPos(playerid, 1553.3973,1853.6757,10.8203);
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, COLOR_BLUE,"Welcome to Las Venturas Stunt");
}
    case 15:
{
SetPlayerPos(playerid, 2020.0333,1918.3666,12.3409);
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, COLOR_GREEN,"Welcome to Las Venturas");
}
    case 16:
{
SetPlayerPos(playerid, 1109.0466,1351.3458,10.8203);
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, COLOR_GREEN,"Welcome to Las Venturas Drift");
}
    case 17:
{
SetPlayerPos(playerid, 1481.7937,-2633.9624,13.5469);
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, COLOR_GREEN,"Welcome to Los Santos Stunt");
}
    case 18:
{
SetPlayerPos(playerid, 1107.6791,-1796.6454,16.5938);
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, COLOR_GREEN,"Welcome to Los Santos");
}
    case 19:
{
SetPlayerPos(playerid, -1939.9095,556.5318,35.1719);
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, COLOR_GREEN,"Welcome to San Fierro");
}
    case 20:
{
SetPlayerPos(playerid, 292.3943,2541.7905,16.8208);
SetPlayerInterior(playerid, 0);
SendClientMessage(playerid, COLOR_YELLOW,"Welcome To Desert Stunt!");
}
}
}
return 1;
}
Can someone tell me what did i do wrong in script due to what i ain't get teleported? when i click the option...


Re: Warnings..Need Help! - JaKe Elite - 23.05.2012

change

pawn Код:
ShowPlayerDialog(playerid, 2322, DIALOG_STYLE_LIST,"BaseJump1\nBaseJump2\nBaseJump3\nBaseJump4\nBaseJump5\nBaseJump6\nBaseJump7\nBaseJump8\nStunt Run\nStuntJump\nDerby\nParkour\nWarZone\nDeathMatch\nLas Venturas Stunt\nLas Venturas\nLas Venturas Drift\nLos Santos Stunts\nLos Santos\nSan Fierro\nDesert Stunts","Teleport","");
to

pawn Код:
ShowPlayerDialog(playerid, 2322, DIALOG_STYLE_LIST, "Title of Your Dialog", "BaseJump1\nBaseJump2\nBaseJump3\nBaseJump4\nBaseJump5\nBaseJump6\nBaseJump7\nBaseJump8\nStunt Run\nStuntJump\nDerby\nParkour\nWarZone\nDeathMatch\nLas Venturas Stunt\nLas Venturas\nLas Venturas Drift\nLos Santos Stunts\nLos Santos\nSan Fierro\nDesert Stunts","Teleport","");



Re: Warnings..Need Help! - Vince - 23.05.2012

Just show line 57. There are line numbers on the left side of the screen. Use them!
... And I am damn slow because someone already bothered to look for which line it was.


Re: Warnings..Need Help! - Jarnu - 23.05.2012

well.. this is Fixed.. Very Thanks for it.. but now the problem is I didn't get teleported when i click on of them.. can someone help me with this?


Re: Need Help With Teleport Menu - leonardo1434 - 23.05.2012

you forgot to make n1,n2,n3,n4 and so on.

pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>

//COLORS
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_BRIGHTRED 0xFF0000AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_PINK 0xFF66FFAA
#define COLOR_BLUE 0x3A47DEFF
#define COLOR_TAN 0xBDB76BAA
#define COLOR_PURPLE 0x800080AA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_ORANGE 0xFF9900AA
#define COLOR_INDIGO 0x4B00B0AA
#define COLOR_BLACK 0x00000000
#define COLOR_DARKGREY 0x696969FF
#define COLOR_GOLD     0xF6C861AA

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print("Teleport Menu!");
    print("--------------------------------------\n");
    return 1;
}


public OnFilterScriptExit()
{
    return 1;
}


#else

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

public OnFilterScriptExit()
{
    return 1;
}


public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/teleport", cmdtext, true, 10) == 0) {
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST,"Teleports","1\tBaseJump1\n2\tBaseJump2\n3\tBaseJump3\n4\tBaseJump4\n5\tBaseJump5\n6\tBaseJump6\n7\tBaseJump7\n8\tBaseJump8\n9\tStunt Run\n10\tStuntJump\n11\tDerby\n12\tnParkour\n12\tWarZone\n13\tDeathMatch\n14\tLas Venturas Stunt\n15\tLas Venturas\n16\tLas Venturas Drift\n17\tLos Santos Stunts\n18\tLos Santos\n19\tSan Fierro\n20\tDesert Stunts","Teleport","");
        return 1;
    }
    return 0;
}


public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == 1 && response) {
        switch(listitem) {
            case 0:
            {
                SetPlayerPos(playerid, 1666.7014,-1218.3112,233.3750);
                SetPlayerInterior(playerid, 0);
                SendClientMessage(playerid, COLOR_YELLOW, "Welcome to BaseJump 1");
                GivePlayerWeapon(playerid, 46, 1);
            }
            case 1:
            {
                SetPlayerPos(playerid, -1812.7672,559.2889,273.1258);
                SetPlayerInterior(playerid, 0);
                SendClientMessage(playerid, COLOR_YELLOW, "Welcome to BaseJump 2");
                GivePlayerWeapon(playerid, 46, 1);
            }
            case 2:
            {
                SetPlayerPos(playerid,2067.9290,2437.1096,165.6172);
                SetPlayerInterior(playerid, 0);
                SendClientMessage(playerid,COLOR_PINK, "Welcome to BaseJump 3");
                GivePlayerWeapon(playerid,46,1);
            }
            case 3:
            {
                SetPlayerPos(playerid,1670.7603,-1343.0720,158.4766);
                SetPlayerInterior(playerid, 0);
                SendClientMessage(playerid,COLOR_PINK, "Welcome to BaseJump 4");
                GivePlayerWeapon(playerid,46,1);
            }
            case 4:
            {
                SetPlayerPos(playerid,-1280.4670,49.5875,70.5295);
                SetPlayerInterior(playerid, 0);
                SendClientMessage(playerid,COLOR_PINK, "Welcome to BaseJump 5");
                GivePlayerWeapon(playerid,46,1);
            }
            case 5:
            {
                SetPlayerPos(playerid,-1013.4426,-703.5352,136.3203);
                SetPlayerInterior(playerid, 0);
                SendClientMessage(playerid,COLOR_PINK, "Welcome to BaseJump 6");
                GivePlayerWeapon(playerid,46,1);
            }
            case 6:
            {
                SetPlayerPos(playerid,-2662.2515,1933.5365,225.7578);
                SetPlayerInterior(playerid, 0);
                SendClientMessage(playerid,COLOR_GREEN,"Welcome to BaseJump 7");
                GivePlayerWeapon(playerid,46,1);
            }
            case 7:
            {
                SetPlayerPos(playerid,-2662.2515,1933.5365,225.7578);
                SetPlayerInterior(playerid, 0);
                SendClientMessage(playerid,COLOR_GREEN,"Welcome to BaseJump 8");
                GivePlayerWeapon(playerid,46,1);
            }
            case 8:
            {
                SetPlayerPos(playerid,1285.6987, 2168.1829, 768.5095);
                SetPlayerInterior(playerid, 0);
                SendClientMessage(playerid, COLOR_BLUE, "You have been Teleported To Stunt Run!");
            }
            case 9:
            {
                SetPlayerPos(playerid, 3331.3096,811.2070,9.1215);
                SetPlayerInterior(playerid, 0);
                SendClientMessage(playerid, COLOR_GREEN,"Welcome To Stunt Jump");
            }
            case 10:
            {
                SetPlayerPos(playerid, -234.8499,-256.2689,1.4297);
                SetPlayerInterior(playerid, 0);
                SendClientMessage(playerid, COLOR_GREEN,"Welcome to Derby");
            }
            case 11:
            {
                SetPlayerPos(playerid, 1544.9849,-1353.7681,329.4735);
                SetPlayerInterior(playerid, 0);
                SendClientMessage(playerid, COLOR_GREEN,"Welcome to Parkour");
            }
            case 12:
            {
                SetPlayerPos(playerid, 3004.041015625, -1493.2126464844, 747.49713134766);
                SetPlayerInterior(playerid, 0);
                SendClientMessage(playerid, COLOR_GREEN,"Welcome To War Zone");
                SetPlayerHealth(playerid, 100);
                SetPlayerArmour(playerid, 100);
                GivePlayerWeapon(playerid, 24, 100);
            }
            case 13:
            {
                SetPlayerPos(playerid, 1977.3790,1916.6001,130.9345);
                SetPlayerInterior(playerid, 0);
                SendClientMessage(playerid, COLOR_GREEN,"Welcome to Death Match Stadium");
                GivePlayerWeapon(playerid, 24, 500);
                GivePlayerWeapon(playerid, 27, 500);
                GivePlayerWeapon(playerid, 31, 500);
            }
            case 14:
            {
                SetPlayerPos(playerid, 1553.3973,1853.6757,10.8203);
                SetPlayerInterior(playerid, 0);
                SendClientMessage(playerid, COLOR_BLUE,"Welcome to Las Venturas Stunt");
            }
            case 15:
            {
                SetPlayerPos(playerid, 2020.0333,1918.3666,12.3409);
                SetPlayerInterior(playerid, 0);
                SendClientMessage(playerid, COLOR_GREEN,"Welcome to Las Venturas");
            }
            case 16:
            {
                SetPlayerPos(playerid, 1109.0466,1351.3458,10.8203);
                SetPlayerInterior(playerid, 0);
                SendClientMessage(playerid, COLOR_GREEN,"Welcome to Las Venturas Drift");
            }
            case 17:
            {
                SetPlayerPos(playerid, 1481.7937,-2633.9624,13.5469);
                SetPlayerInterior(playerid, 0);
                SendClientMessage(playerid, COLOR_GREEN,"Welcome to Los Santos Stunt");
            }
            case 18:
            {
                SetPlayerPos(playerid, 1107.6791,-1796.6454,16.5938);
                SetPlayerInterior(playerid, 0);
                SendClientMessage(playerid, COLOR_GREEN,"Welcome to Los Santos");
            }
            case 19:
            {
                SetPlayerPos(playerid, -1939.9095,556.5318,35.1719);
                SetPlayerInterior(playerid, 0);
                SendClientMessage(playerid, COLOR_GREEN,"Welcome to San Fierro");
            }
            case 20:
            {
                SetPlayerPos(playerid, 292.3943,2541.7905,16.8208);
                SetPlayerInterior(playerid, 0);
                SendClientMessage(playerid, COLOR_YELLOW,"Welcome To Desert Stunt!");
            }
        }
    }
    return 1;
}



Re: Need Help With Teleport Menu - Jarnu - 23.05.2012

Still Not Working.. :/ idk what is wrong with script