Need some help with an algorythm or something :/
#1

Hello, Today I have been making my teleports in a different way to make them only 1 line, and still be able to do lot's and lot's of stuff with it...
ok so the way that I done this was like this:
pawn Код:
enum TeleportInfo
{
    tType,
    tTele[128],
    tName[128],
    Float:tx,
    Float:ty,
    Float:tz,
    Float:tAngle_P,
    bool:tVehicleRemove,
    tTimeH,
    tTimeM,
    tWeapon,
    tAmmo,
    Float:tx_V,
    Float:ty_V,
    Float:tz_V,
    Float:tAngle_V,
}

new tInfo[40][TeleportInfo] =
{
    {TYPE_STUNT, "/hh", "Huge Halfpipe", -1252.8372802734,-3572.2570800781,19.23807144165, 0.0, false, 12, 0, -1, -1, 0.0, 0.0, 0.0, 0.0}, // hh
    {TYPE_STUNT, "/hh2", "Huge HalfPipe 2", -966.3057,2704.9131,43.8409, 0.0, false, 12, 0, -1, -1, 0.0, 0.0, 0.0, 0.0}, // hh2
    {TYPE_STUNT, "/chilliad", "MT Chilliad", -2358.1282,-1631.2905,486.5476, 0.0, true, 12, 0, 46, 1, 0.0, 0.0, 0.0, 0.0}, // chilliad
    {TYPE_STUNT, "/coaster", "Coaster 1", 3394.7490234375,-2858.6318359375,586.51507568359, 0.0, false, 12, 0, -1, -1, 0.0, 0.0, 0.0, 0.0}, // coaster
    {TYPE_STUNT, "/lvsz", "North Las Venturas Stuntzone", 2955.1484375,2718.0791015625,47.445892333984, 0.0, false, 12, 0, -1, -1, 0.0, 0.0, 0.0, 0.0}, // lvsz
    {TYPE_STUNT, "/ej", "Evel Knievel Jump", 830.79907226563,-1649.3950195313,96.727676391602, 0.0, true, 12, 0, -1, -1, 0.0, 0.0, 0.0, 0.0}, // ej
    {TYPE_STUNT, "/lvsky", "Las Venturas Sky Park", 2050.4905,2047.7407,304.1125, 0.0, false, 12, 0, -1, -1, 0.0, 0.0, 0.0, 0.0}, // lvksy
    {TYPE_STUNT, "/pj", "Pier Jump", 354.1863,-760.6149,871.6344, 0.0, false, 12, 0, -1, -1, 0.0, 0.0, 0.0, 0.0}, // pj
    {TYPE_STUNT, "/cj", "Coast Jump", 404.13891601563,-2888.9594726563,751.1493530273, 0.0, false, 12, 0, -1, -1, 0.0, 0.0, 0.0, 0.0}, // cj
    {TYPE_STUNT, "/da", "Desert Airport", 419.800018, 2531.705322, 16.157726, 0.0, false, 12, 0, -1, -1, 0.0, 0.0, 0.0, 0.0}, // da
    {TYPE_STUNT, "/coaster2", "Coaster 2", 35.38744354248,-900.32940673828,1761.6329345703, 0.0, false, 12, 0, -1, -1, 0.0, 0.0, 0.0, 0.0}, // coaster2
    {TYPE_STUNT, "/canyon", "Canyon Jump", -672.6729,2311.8418,134.7830, 0.0, true, 12, 0, -1, -1, 0.0, 0.0, 0.0, 0.0}, // canyon
    {TYPE_STUNT, "/farm", "Farm StuntPark", -1011.8487548828,-1024.7260742188,129.01875305176, 0.0, false, 12, 0, -1, -1, 0.0, 0.0, 0.0, 0.0}, // farm
    {TYPE_STUNT, "/dam", "The Dam", -528.1,2129.4,45.3, 0.0, false, 12, 0, -1, -1, 0.0, 0.0, 0.0, 0.0}, // dam
    {TYPE_STUNT, "/paradise", "Stunt Paradise", 2437.7554,-3492.3938,6.1205, 0.0, false, 12, 0, -1, -1, 0.0, 0.0, 0.0, 0.0}, // paradise
    {TYPE_STUNT, "/hd", "Heavens Drop", 3425.0229,-1048.2330,1465.5647, 0.0, true, 12, 0, -1, -1, 0.0, 0.0, 0.0, 0.0}, // hd
//------------------------------------------------------------------------------
    {TYPE_RACE, "/driftcity", "Drift City", -1025.1023,1019.2966,2.9941, 0.0, false, 12, 0, -1, -1, 0.0, 0.0, 0.0, 0.0}, // driftcity
    {TYPE_RACE, "/kart", "Kart Race", 2570.8005,1893.9918,10.8280, 0.0, true, 12, 0, -1, -1, 0.0, 0.0, 0.0, 0.0}, // kart
    {TYPE_RACE, "/drag2", "Drag Race 2", 2041.580688,-3113.884277,6.142639, 0.0, false, 12, 0, -1, -1, 0.0, 0.0, 0.0, 0.0}, // drag2
//------------------------------------------------------------------------------
    {TYPE_NRG, "/nrg", "Nrg course 1", 2784.3462,-2518.5698,13.6319, 0.0, true, 12, 0, -1, -1, 0.0, 0.0, 0.0, 0.0}, // nrg
    {TYPE_NRG, "/nrg2", "Nrg course 2", 2798.9404,-1643.3833,28.5625, 0.0, true, 12, 0, -1, -1, 0.0, 0.0, 0.0, 0.0}, // nrg
//------------------------------------------------------------------------------
    {TYPE_BACKFLIP, "/backflip", "Oil BackFlip, do not turn left or right!", 151.1787109375, 1339.357421875, 10.246315002441, 0.0, true, 12, 0, -1, -1, 0.0, 0.0, 0.0, 0.0}, // backflip
//------------------------------------------------------------------------------
    {TYPE_BASEJUMP, "/jump1", "Base Jump 1", 1961.4845,1920.7383,131.1122, 0.0, true, 12, 0, -1, -1, 0.0, 0.0, 0.0, 0.0}, // jump
    {TYPE_BASEJUMP, "/jump2", "Base Jump 2", 1562.7367,-1346.4706,330.0493, 0.0, true, 12, 0, -1, -1, 0.0, 0.0, 0.0, 0.0}, // jump
    {TYPE_BASEJUMP, "/jump3", "Base Jump 3", 1592.8718,-1221.6572,278.0506, 0.0, true, 12, 0, -1, -1, 0.0, 0.0, 0.0, 0.0}, // jump
    {TYPE_BASEJUMP, "/jump4", "Base Jump 4", 1661.2975,-1247.3594,233.9873, 0.0, true, 12, 0, -1, -1, 0.0, 0.0, 0.0, 0.0}, // jump
    {TYPE_BASEJUMP, "/jump5", "Base Jump 5", 1436.8242,-1053.2672,213.8473, 0.0, true, 12, 0, -1, -1, 0.0, 0.0, 0.0, 0.0}, // jump
    {TYPE_BASEJUMP, "/jump6", "Base Jump 6", -861.6122,2307.6626,159.9215, 0.0, true, 12, 0, -1, -1, 0.0, 0.0, 0.0, 0.0}, // jump
    {TYPE_BASEJUMP, "/jump7", "Base Jump 7", -755.6661,2041.5369,83.1339, 0.0, true, 12, 0, -1, -1, 0.0, 0.0, 0.0, 0.0}, // jump
    {TYPE_BASEJUMP, "/jump8", "Base Jump 8", -1280.3628,978.4018,148.2734, 0.0, true, 12, 0, -1, -1, 0.0, 0.0, 0.0, 0.0}, // jump
    {TYPE_BASEJUMP, "/jump9", "Base Jump 9", -1668.3292,884.1396,138.3281, 0.0, true, 12, 0, -1, -1, 0.0, 0.0, 0.0, 0.0}, // jump
    {TYPE_BASEJUMP, "/jump10", "Base Jump 10", -1807.4314,574.6566,245.9893, 0.0, true, 12, 0, -1, -1, 0.0, 0.0, 0.0, 0.0}, // jump
    {TYPE_BASEJUMP, "/jump11", "Base Jump 11", -2669.7974,1595.3375,217.2739, 0.0, true, 12, 0, -1, -1, 0.0, 0.0, 0.0, 0.0}, // jump
//------------------------------------------------------------------------------
    {TYPE_OTHER, "/babel", "The BabelTower", 1544.5788574219,-1399.7844238281,342.79623413086, 0.0, true, 12, 0, 46, 1, 0.0, 0.0, 0.0, 0.0}, // babel
    {TYPE_OTHER, "/bounce", "Trampoline", 1977.0219726563,-1272.712890625,4363.1166992188, 0.0, false, 12, 0, -1, -1, 0.0, 0.0, 0.0, 0.0}, // bounce
    {TYPE_OTHER, "/bowl", "Huge Glass Bowl", -219.1842,-618.2765,117.4826, 0.0, true, 12, 0, -1, -1, 0.0, 0.0, 0.0, 0.0}, // bowl
    {TYPE_OTHER, "/cannon", "The Cannon", -556.0517,2580.0288,65.8368, 0.0, true, 12, 0, -1, -1, 0.0, 0.0, 0.0, 0.0}, // cannon
    {TYPE_OTHER, "/island", "Chill-Island", 261.1905,-3271.4392,5.7316, 0.0, true, 12, 0, -1, -1, 0.0, 0.0, 0.0, 0.0}, // island
    {TYPE_OTHER, "/pd", "Parachute Drop", 3075.26,-2053.21,355.5, 0.0, true, 12, 0, -1, -1, 0.0, 0.0, 0.0, 0.0}, // pd
    {TYPE_OTHER, "/pipe", "Pipes", 2672.00830100,-1076.75427200,301.88580300, 0.0, true, 12, 0, -1, -1, 0.0, 0.0, 0.0, 0.0} // pipe
};
I made an array with all the teleports in my server and some information... this way I can do whatever I want with all this information in my server in a very easy and line saving way...
now, I made a dialog with al the teleports from my server in it and it looks like this:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    new string[1000];
    new string2[256];
    if(dialogid == DIALOG)
    {
        if(!response) return 1;
        else{
            switch(listitem)
            {
                case 0: //stunt
                {
                    for(new i; i<sizeof(tInfo); i++)
                    {
                        if(tInfo[i][tType] == TYPE_STUNT)
                        {
                            format(string2, sizeof(string2),    "-%s{00FF00} | {FFFFFF}%s\n", tInfo[i][tName], tInfo[i][tTele]);
                            strcat(string, string2);

                            /*strcat(string,  "-Huge Halfpipe {00FF00}| {FFFFFF}/hh\n");
                            strcat(string,  "-Huge Halfpipe 2 {00FF00}| {FFFFFF}/hh2\n");
                            strcat(string,  "-Las Venturas Stuntzone {00FF00}| {FFFFFF}/lvsz\n");
                            strcat(string,  "-Evel Knievel Jump {00FF00}| {FFFFFF}/ej\n");
                            strcat(string,  "-Las Venturas Sky Park {00FF00}| {FFFFFF}/lvsky\n");
                            strcat(string,  "-Pier Jump {00FF00}| {FFFFFF}/pj\n");
                            strcat(string,  "-Coast Jump {00FF00}| {FFFFFF}/cj\n");
                            strcat(string,  "-Desert Airstrip {00FF00}| {FFFFFF}/da\n");
                            strcat(string,  "-Babel Tower {00FF00}| {FFFFFF}/babel\n");
                            strcat(string,  "-Farm Stuntpark {00FF00}| {FFFFFF}/farm\n");
                            strcat(string,  "-Canyon Jump {00FF00}| {FFFFFF}/canyon\n");
                            strcat(string,  "-The Dam {00FF00}| {FFFFFF}/dam\n");
                            strcat(string,  "-Stunt Paradise{00FF00} | {FFFFFF}/paradise\n");*/


                            ShowPlayerDialog(playerid, DIALOG+1, DIALOG_STYLE_LIST,"{FFFF00}Stunt", string, "Select", "Exit");
                        }
                    }
                }
                case 1: //DM
                {
                    strcat(string,  "-Army {00FF00}|{FFFFFF}/army {00FF00}|{FFFFFF} Capture the ticki and keep it for 5 minuts to win!");
                    ShowPlayerDialog(playerid, DIALOG+2, DIALOG_STYLE_LIST,"{FFFF00}DM", string, "Select", "Exit");
                }
                case 2: //Race
                {
                    for(new i; i<sizeof(tInfo); i++)
                    {
                        if(tInfo[i][tType] == TYPE_RACE)
                        {
                            format(string2, sizeof(string2),    "-%s{00FF00} | {FFFFFF}%s\n", tInfo[i][tName], tInfo[i][tTele]);
                            strcat(string, string2);
                           
                            /*strcat(string,  "-DriftCity{00FF00} | {FFFFFF}/driftcity\n");
                            strcat(string,  "-Karting Race{00FF00} | {FFFFFF}/kart\n");
                            strcat(string,  "-Drag Race 2{00FF00} | {FFFFFF}/drag2\n");*/


                            ShowPlayerDialog(playerid, DIALOG+3, DIALOG_STYLE_LIST,"{FFFF00}Race", string, "Select", "Exit");
                        }
                    }
                }
                case 3: //Nrg
                {
                    for(new i; i<sizeof(tInfo); i++)
                    {
                        if(tInfo[i][tType] == TYPE_NRG)
                        {
                            format(string2, sizeof(string2),    "-%s{00FF00} | {FFFFFF}%s\n", tInfo[i][tName], tInfo[i][tTele]);
                            strcat(string, string2);
                           
                            /*strcat(string,  "-nrg{00FF00} | {FFFFFF}/nrg\n");
                            strcat(string,  "-nrg2{00FF00} | {FFFFFF}/nrg2\n");*/


                            ShowPlayerDialog(playerid, DIALOG+4, DIALOG_STYLE_LIST,"{FFFF00}NRG", string, "Select", "Exit");
                        }
                    }
                }
                case 4: //Backflip
                {
                    for(new i; i<sizeof(tInfo); i++)
                    {
                        if(tInfo[i][tType] == TYPE_BACKFLIP)
                        {
                            format(string2, sizeof(string2),    "-%s{00FF00} | {FFFFFF}%s\n", tInfo[i][tName], tInfo[i][tTele]);
                            strcat(string, string2);
                     
                           
                        ShowPlayerDialog(playerid, DIALOG+5, DIALOG_STYLE_LIST,"{FFFF00}BackFlip", string, "Select", "Exit");
                        }
                    }
                }
                case 5: //Base Jumps
                {
                    for(new i; i<sizeof(tInfo); i++)
                    {
                        if(tInfo[i][tType] == TYPE_BASEJUMP)
                        {
                            format(string2, sizeof(string2),    "-%s{00FF00} | {FFFFFF}%s\n", tInfo[i][tName], tInfo[i][tTele]);
                            strcat(string, string2);
                           
                       

                            ShowPlayerDialog(playerid, DIALOG+6, DIALOG_STYLE_LIST,"{FFFF00}Base Jumps", string, "Select", "Exit");
                        }
                    }
                }
                case 6: //Other
                {
                    for(new i; i<sizeof(tInfo); i++)
                    {
                        if(tInfo[i][tType] == TYPE_OTHER)
                        {
                            format(string2, sizeof(string2),    "-%s{00FF00} | {FFFFFF}%s\n", tInfo[i][tName], tInfo[i][tTele]);
                            strcat(string, string2);
                            ShowPlayerDialog(playerid, DIALOG+7, DIALOG_STYLE_LIST,"{FFFF00}Other", string, "Select", "Exit");
                        }
                    }
                }
            }
        }
    }
ok, this gives me a good lookgin dialog ingame however, I run into some problems making the responses to teleport the player...
pawn Код:
if(dialogid == DIALOG+1) // Stunt
    {
        if(!response)return 1;
        AddPlayerTeleport(playerid, tInfo[listitem][tName], tInfo[listitem][tx], tInfo[listitem][ty], tInfo[listitem][tz], tInfo[listitem][tTimeH], tInfo[listitem][tTimeM], tInfo[listitem][tVehicleRemove], tInfo[listitem][tWeapon], tInfo[listitem][tAmmo]);
    }
this is how I did it for the first dialog answer
however for my second dialog it will not work, because if I use listitem as index it will return an integer that does not match with the thing that it should give
f.e: I got dialog+2 (dialog to selec your racing teleport) when I click listitem 4, and then it will output index 4 of the teleport array, wich is incorrect...
can anybody please tell me how I have to do this properly? thanks in advance
rep for helper
Reply
#2

Save the indexes to array

pawn Код:
new TeleportList[MAX_PLAYERS][sizeof(tInfo)];
pawn Код:
case 0: //stunt
{
    new idx = 0;
    for(new i; i<sizeof(tInfo); i++)
    {
        if(tInfo[i][tType] == TYPE_STUNT)
        {
            format(string2, sizeof(string2),    "-%s{00FF00} | {FFFFFF}%s\n", tInfo[i][tName], tInfo[i][tTele]);
            strcat(string, string2);
            TeleportList[playerid][idx++] = i;

            /*strcat(string,  "-Huge Halfpipe {00FF00}| {FFFFFF}/hh\n");
            strcat(string,  "-Huge Halfpipe 2 {00FF00}| {FFFFFF}/hh2\n");
            strcat(string,  "-Las Venturas Stuntzone {00FF00}| {FFFFFF}/lvsz\n");
            strcat(string,  "-Evel Knievel Jump {00FF00}| {FFFFFF}/ej\n");
            strcat(string,  "-Las Venturas Sky Park {00FF00}| {FFFFFF}/lvsky\n");
            strcat(string,  "-Pier Jump {00FF00}| {FFFFFF}/pj\n");
            strcat(string,  "-Coast Jump {00FF00}| {FFFFFF}/cj\n");
            strcat(string,  "-Desert Airstrip {00FF00}| {FFFFFF}/da\n");
            strcat(string,  "-Babel Tower {00FF00}| {FFFFFF}/babel\n");
            strcat(string,  "-Farm Stuntpark {00FF00}| {FFFFFF}/farm\n");
            strcat(string,  "-Canyon Jump {00FF00}| {FFFFFF}/canyon\n");
            strcat(string,  "-The Dam {00FF00}| {FFFFFF}/dam\n");
            strcat(string,  "-Stunt Paradise{00FF00} | {FFFFFF}/paradise\n");*/

        }
    }
    ShowPlayerDialog(playerid, DIALOG+1, DIALOG_STYLE_LIST,"{FFFF00}Stunt", string, "Select", "Exit");
}
pawn Код:
if(dialogid == DIALOG+1) // Stunt
{
    if(!response)return 1;
    new idx = TeleportList[playerid][listitem];
    AddPlayerTeleport(playerid, tInfo[idx][tName], tInfo[idx][tx], tInfo[idx][ty], tInfo[idx][tz], tInfo[idx][tTimeH], tInfo[idx][tTimeM], tInfo[idx][tVehicleRemove], tInfo[idx][tWeapon], tInfo[idx][tAmmo]);
}
Also, ShowPlayerDialog should be outside the loop.
Reply
#3

Thanks, but what do I do with the other tp dialogs then?
pawn Код:
case 2: //Race
                {
                    for(new i; i<sizeof(tInfo); i++)
                    {
                        if(tInfo[i][tType] == TYPE_RACE)
                        {
                            format(string2, sizeof(string2),    "-%s{00FF00} | {FFFFFF}%s\n", tInfo[i][tName], tInfo[i][tTele]);
                            strcat(string, string2);
                           
                            /*strcat(string,  "-DriftCity{00FF00} | {FFFFFF}/driftcity\n");
                            strcat(string,  "-Karting Race{00FF00} | {FFFFFF}/kart\n");
                            strcat(string,  "-Drag Race 2{00FF00} | {FFFFFF}/drag2\n");*/


                            ShowPlayerDialog(playerid, DIALOG+3, DIALOG_STYLE_LIST,"{FFFF00}Race", string, "Select", "Exit");
                        }
                    }
                }
                case 3: //Nrg
                {
                    for(new i; i<sizeof(tInfo); i++)
                    {
                        if(tInfo[i][tType] == TYPE_NRG)
                        {
                            format(string2, sizeof(string2),    "-%s{00FF00} | {FFFFFF}%s\n", tInfo[i][tName], tInfo[i][tTele]);
                            strcat(string, string2);
                           
                            /*strcat(string,  "-nrg{00FF00} | {FFFFFF}/nrg\n");
                            strcat(string,  "-nrg2{00FF00} | {FFFFFF}/nrg2\n");*/


                            ShowPlayerDialog(playerid, DIALOG+4, DIALOG_STYLE_LIST,"{FFFF00}NRG", string, "Select", "Exit");
                        }
                    }
                }
                case 4: //Backflip
                {
                    for(new i; i<sizeof(tInfo); i++)
                    {
                        if(tInfo[i][tType] == TYPE_BACKFLIP)
                        {
                            format(string2, sizeof(string2),    "-%s{00FF00} | {FFFFFF}%s\n", tInfo[i][tName], tInfo[i][tTele]);
                            strcat(string, string2);
                           
                            /*strcat(string,  "-Oil backflip{00FF00} | {FFFFFF}/backflip1\n");*/
                           
                            ShowPlayerDialog(playerid, DIALOG+5, DIALOG_STYLE_LIST,"{FFFF00}BackFlip", string, "Select", "Exit");
                        }
                    }
                }
                case 5: //Base Jumps
                {
                    for(new i; i<sizeof(tInfo); i++)
                    {
                        if(tInfo[i][tType] == TYPE_BASEJUMP)
                        {
                            format(string2, sizeof(string2),    "-%s{00FF00} | {FFFFFF}%s\n", tInfo[i][tName], tInfo[i][tTele]);
                            strcat(string, string2);
                           
                            /*strcat(string,  "Base Jump 1{00FF00} | {FFFFFF}/jump1\n");
                            strcat(string,  "Base Jump 2{00FF00} | {FFFFFF}/jump2\n");
                            strcat(string,  "Base Jump 3{00FF00} | {FFFFFF}/jump3\n");
                            strcat(string,  "Base Jump 4{00FF00} | {FFFFFF}/jump4\n");
                            strcat(string,  "Base Jump 5{00FF00} | {FFFFFF}/jump5\n");
                            strcat(string,  "Base Jump 6{00FF00} | {FFFFFF}/jump6\n");
                            strcat(string,  "Base Jump 7{00FF00} | {FFFFFF}/jump7\n");
                            strcat(string,  "Base Jump 8{00FF00} | {FFFFFF}/jump8\n");
                            strcat(string,  "Base Jump 9{00FF00} | {FFFFFF}/jump9\n");
                            strcat(string,  "Base Jump 10{00FF00} | {FFFFFF}/jump10\n");
                            strcat(string,  "Base Jump 11{00FF00} | {FFFFFF}/jump11\n");*/


                            ShowPlayerDialog(playerid, DIALOG+6, DIALOG_STYLE_LIST,"{FFFF00}Base Jumps", string, "Select", "Exit");
                        }
                    }
                }
                case 6: //Other
                {
                    for(new i; i<sizeof(tInfo); i++)
                    {
                        if(tInfo[i][tType] == TYPE_OTHER)
                        {
                            format(string2, sizeof(string2),    "-%s{00FF00} | {FFFFFF}%s\n", tInfo[i][tName], tInfo[i][tTele]);
                            strcat(string, string2);
                            /*
                            strcat(string,  "Chill-Island{00FF00} | {FFFFFF}/island\n");
                            strcat(string,  "MT Chilliad{00FF00} | {FFFFFF}/chilliad\n");
                            strcat(string,  "Trampoline{00FF00} | {FFFFFF}/bounce\n");
                            strcat(string,  "Coaster 1{00FF00} | {FFFFFF}/coaster1\n");
                            strcat(string,  "Coaster 2{00FF00} | {FFFFFF}/coaster2\n");
                            strcat(string,  "Pipes{00FF00} | {FFFFFF}/pipe\n");
                            strcat(string,  "Parachute Drop{00FF00} | {FFFFFF}/pd\n");
                            strcat(string,  "Cannon{00FF00} | {FFFFFF}/cannon\n");
                            strcat(string,  "HeavensDrop{00FF00} | {FFFFFF}/hd\n");
                            strcat(string,  "GlassBowl{00FF00} | {FFFFFF}/bowl\n");*/


                            ShowPlayerDialog(playerid, DIALOG+7, DIALOG_STYLE_LIST,"{FFFF00}Other", string, "Select", "Exit");
                        }
                    }
                }
pawn Код:
if(dialogid == DIALOG+3) // Race
    {
        if(!response)return 1;
        for(new i; i<sizeof(tInfo); i++)
        {
            if(tInfo[i][tType] == TYPE_STUNT)
            {
                AddPlayerTeleport(playerid, tInfo[i+listitem-1][tName], tInfo[i+listitem-1][tx], tInfo[i+listitem-1][ty], tInfo[i+listitem-1][tz], tInfo[i+listitem-1][tTimeH], tInfo[i+listitem-1][tTimeM], tInfo[i+listitem-1][tVehicleRemove], tInfo[i+listitem-1][tWeapon], tInfo[i+listitem-1][tAmmo]);

        /*switch (listitem)
        {
            case 0: AddPlayerTeleport(playerid, "Drift City", -1025.1023,1019.2966,2.9941, 12, 0, false, -1, -1);
            case 1: AddPlayerTeleport(playerid, "Kart Race", 2570.8005,1893.9918,10.8280, 12, 0, false, -1, -1);
            case 2: AddPlayerTeleport(playerid, "Drag Race 2", 2041.580688,-3113.884277,6.142639, 12, 0, false, -1, -1);*/

            }
        }
    }

    if(dialogid == DIALOG+4) // NRG
    {
        if(!response)return 1;
        /*switch (listitem)
        {*/

        for(new i; i<sizeof(tInfo); i++)
        {
            if(tInfo[i][tType] == TYPE_STUNT || tInfo[i][tType] == TYPE_RACE)
            {
                AddPlayerTeleport(playerid, tInfo[i+listitem-1][tName], tInfo[i+listitem-1][tx], tInfo[i+listitem-1][ty], tInfo[i+listitem-1][tz], tInfo[i+listitem-1][tTimeH], tInfo[i+listitem-1][tTimeM], tInfo[i+listitem-1][tVehicleRemove], tInfo[i+listitem-1][tWeapon], tInfo[i+listitem-1][tAmmo]);
               
            /*case 0: AddPlayerTeleport(playerid, "Nrg course 1", 2784.3462,-2518.5698,13.6319, 12, 0, true, -1, -1);
            case 1: AddPlayerTeleport(playerid, "Nrg course 2", 2798.9404,-1643.3833,28.5625, 12, 0, true, -1, -1);*/

            }
        }
    }
   
    if(dialogid == DIALOG+5) // BackFlip
    {
        if(!response)return 1;
        for(new i; i<sizeof(tInfo); i++)
        {
            if(tInfo[i][tType] == TYPE_STUNT || tInfo[i][tType] == TYPE_RACE || tInfo[i][tType] == TYPE_NRG)
            {
                AddPlayerTeleport(playerid, tInfo[i+listitem-1][tName], tInfo[i+listitem-1][tx], tInfo[i+listitem-1][ty], tInfo[i+listitem-1][tz], tInfo[i+listitem-1][tTimeH], tInfo[i+listitem-1][tTimeM], tInfo[i+listitem-1][tVehicleRemove], tInfo[i+listitem-1][tWeapon], tInfo[i+listitem-1][tAmmo]);
            }
        }
        /*switch(listitem)
        {
            case 0: AddPlayerTeleport(playerid, "Oil BackFlip, do not turn left or right!", 151.1787109375, 1339.357421875, 10.246315002441, 12, 0, true, -1, -1);
        }*/

    }

    if(dialogid == DIALOG+6) // Basejumps
    {
        if(!response)return 1;
        for(new i; i<sizeof(tInfo); i++)
        {
            if(tInfo[i][tType] == TYPE_STUNT || tInfo[i][tType] == TYPE_RACE || tInfo[i][tType] == TYPE_NRG || tInfo[i][tType] == TYPE_BACKFLIP)
            {
                AddPlayerTeleport(playerid, tInfo[i+listitem-1][tName], tInfo[i+listitem-1][tx], tInfo[i+listitem-1][ty], tInfo[i+listitem-1][tz], tInfo[i+listitem-1][tTimeH], tInfo[i+listitem-1][tTimeM], tInfo[i+listitem-1][tVehicleRemove], tInfo[i+listitem-1][tWeapon], tInfo[i+listitem-1][tAmmo]);
            }
        }
        /*switch (listitem)
        {
            case 0: AddPlayerTeleport(playerid, "Base Jump 1", 1961.4845,1920.7383,131.1122, 12, 0, true, 46, 1);
            case 1: AddPlayerTeleport(playerid, "Base Jump 2", 1562.7367,-1346.4706,330.0493, 12, 0, true, 46, 1);
            case 2: AddPlayerTeleport(playerid, "Base Jump 3", 1592.8718,-1221.6572,278.0506, 12, 0, true, 46, 1);
            case 3: AddPlayerTeleport(playerid, "Base Jump 4", 1661.2975,-1247.3594,233.9873, 12, 0, true, 46, 1);
            case 4: AddPlayerTeleport(playerid, "Base Jump 5", 1436.8242,-1053.2672,213.8473, 12, 0, true, 46, 1);
            case 5: AddPlayerTeleport(playerid, "Base Jump 6", -861.6122,2307.6626,159.9215, 12, 0, true, 46, 1);
            case 6: AddPlayerTeleport(playerid, "Base Jump 7", -755.6661,2041.5369,83.1339, 12, 0, true, 46, 1);
            case 7: AddPlayerTeleport(playerid, "Base Jump 8", -1280.3628,978.4018,148.2734, 12, 0, true, 46, 1);
            case 8: AddPlayerTeleport(playerid, "Base Jump 9", -1668.3292,884.1396,138.3281, 12, 0, true, 46, 1);
            case 9: AddPlayerTeleport(playerid, "Base Jump 10", -1807.4314,574.6566,245.9893, 12, 0, true, 46, 1);
            case 10: AddPlayerTeleport(playerid, "Base Jump 11", -2669.7974,1595.3375,217.2739, 12, 0, true, 46, 1);
        }*/

    }

    if(dialogid == DIALOG+7)  // Other
    {
        if(!response)return 1;
        for(new i; i<sizeof(tInfo); i++)
        {
            if(tInfo[i][tType] == TYPE_STUNT || tInfo[i][tType] == TYPE_RACE || tInfo[i][tType] == TYPE_NRG || tInfo[i][tType] == TYPE_BACKFLIP || tInfo[i][tType] == TYPE_BASEJUMP)
            {
                AddPlayerTeleport(playerid, tInfo[i+listitem-1][tName], tInfo[i+listitem-1][tx], tInfo[i+listitem-1][ty], tInfo[i+listitem-1][tz], tInfo[i+listitem-1][tTimeH], tInfo[i+listitem-1][tTimeM], tInfo[i+listitem-1][tVehicleRemove], tInfo[i+listitem-1][tWeapon], tInfo[i+listitem-1][tAmmo]);
            }
        }
        /*switch (listitem)
        {
            case 0: AddPlayerTeleport(playerid, "Chill-Island", 261.1905,-3271.4392,5.7316, 21, 0, true, -1, -1);
            case 1: AddPlayerTeleport(playerid, "MT Chilliad", -2358.1282,-1631.2905,486.5476, 12, 0, false, 46, 1);
            case 2: AddPlayerTeleport(playerid, "Trampoline", 1977.0219726563,-1272.712890625,4363.1166992188, 12, 0, false, -1, -1);
            case 3: AddPlayerTeleport(playerid, "Coaster 1", 3394.7490234375,-2858.6318359375,586.51507568359, 12, 0, false, -1, -1);
            case 4: AddPlayerTeleport(playerid, "Coaster 2", 35.38744354248,-900.32940673828,1761.6329345703, 12, 0, false, -1, -1);
            case 5: AddPlayerTeleport(playerid, "Pipes", 2672.00830100,-1076.75427200,301.88580300, 12, 0, false, 46, 1);
            case 6: AddPlayerTeleport(playerid, "Parachute Drop", 3075.26,-2053.21,355.5, 8, 0, true, 46, 1);
            case 7: AddPlayerTeleport(playerid, "The Cannon", -556.0517,2580.0288,65.8368, 12, 0, true, -1, -1);
            case 8: AddPlayerTeleport(playerid, "Heavens Drop", 3425.0229,-1048.2330,1465.5647, 12, 0, false, -1, -1);
            case 9: AddPlayerTeleport(playerid, "Huge Glass Bowl", -219.1842,-618.2765,117.4826, 12, 0, true, -1, -1);
        }*/

    }
?
sorry for all the comments
Reply
#4

Quote:
Originally Posted by knackworst
Посмотреть сообщение
Thanks, but what do I do with the other tp dialogs then?
It should work for all dialogs

pawn Код:
if(dialogid >= DIALOG+1 && dialogid <= DIALOG+7)
{
    if(!response)return 1;
    new idx = TeleportList[playerid][listitem];
    AddPlayerTeleport(playerid, tInfo[idx][tName], tInfo[idx][tx], tInfo[idx][ty], tInfo[idx][tz], tInfo[idx][tTimeH], tInfo[idx][tTimeM], tInfo[idx][tVehicleRemove], tInfo[idx][tWeapon], tInfo[idx][tAmmo]);
}
Reply
#5

Well now listitem f.e listitem 2 in dialog 2 (race dialog), returns listitem 2 from dialog one (stunting dialog)
:/
?
Reply
#6

Quote:
Originally Posted by knackworst
Посмотреть сообщение
Well now listitem f.e listitem 2 in dialog 2 (race dialog), returns listitem 2 from dialog one (stunting dialog)
:/
?
Did you add this

pawn Код:
TeleportList[playerid][idx++] = i;
to other dialogs too?
Reply
#7

Oh, I forgot
anyways it works perfect, also I look at the code over and over, and I understand what it exactly does.
So yeah, thanks alot mate, and added a rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)