SA-MP Forums Archive
Teleport - 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: Teleport (/showthread.php?tid=467627)



Teleport - Sliceofdeath - 04.10.2013

I am unable to make teleport cmd with dialog , I just want list of teleport not like clicking on teleport name and they will be there. Not that. Just list of teleports server have

I did something like this

pawn Код:
#include <a_samp>

#define DIALOGID 1337


public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/teles", cmdtext, true, 10) == 0)
    {
        ShowPlayerDialog(playerid, DIALOGID, DIALOG_STYLE_LIST, "EF - Teleports", "Airports\nStunts\nTuning\nDrift\nEating Place", "Select", "Cancel");
        return 1;
    }
    return 0;
}
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOGID)
    {
        if(response)
        {
            {
                ShowPlayerDialog(playerid, dialogid, 1 , "Airports", "/Cluckin1\n/Cluckin2\n/Cluckin3\n/Cluckin4\n/Cluckin5\n/pizza\n/burger\n/burger2\nagdsgasg\nagdgadgdagda\nadfdfaafdfadadf\nagdgagdagadagagd\nadgagadgagadsagdagd\nadfdfajfakdfasjfadjhafd\n", "button1", "button2");
            }
        }
        return 1;
    }
    return 0;
 }
I was just writing shit just to know how much lengthy dialog i can have...

Problem is - Whenever i click Airport , It go to list .. But instead of teleport list i am getting Weapons list.

And even after clicking weapon i am getting weapon.

P.S - I have edited Weapon pwn to this , I was damn lazy to make new dialog.
Help me if you can.

Thanks in advance.


Re: Teleport - Jankingston - 04.10.2013

show the script?


Re: Teleport - Deji - 04.10.2013

Sounds like you have a conflicting game mode or filterscript.


Re: Teleport - MAFIAWARS - 04.10.2013

Do,

pawn Код:
CMD:tele(playerid, params[])
{
 SetPlayerPos(PosX,PosY,PosZ);//You can search on ****** for Interiors Positions.
 SetPlayerInterior(playerid, 1); //Change the Interior ID of which Interior you want. (****** it also).
 return 1;
}
And If you don't want to Teleport in some interior and just want to teleport on some place in SAMP then do like that:

pawn Код:
CMD:tele(playerid, params[])
{
 SetPlayerPos(PosX,PosY,PosZ); // /save to that place where you want to be teleported and go documents/saved position to get the Co-ordinates.
 SetPlayerInterior(playerid, 0); //Set the Interior to 0.
 return 1;
}
Remember, You must have zcmd to make these type commands with CMD. Because It is very easy to make Commands.

Thanks !


Re: Teleport - Sliceofdeath - 04.10.2013

Weapon

pawn Код:
#include <a_samp>

#define DIALOGID 1337


public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/w", cmdtext, true, 10) == 0)
    {
        ShowPlayerDialog(playerid, DIALOGID, DIALOG_STYLE_LIST, "Weapon Lists", "Melee\nPistols\nSub-Machine Guns\nRifle's\nAssault\nShotgun's\nHeavy Weapons\nThrown\nMisc", "Select", "Cancel");
        return 1;
    }
    return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOGID)
    {
        if(response)
        {
            if(listitem == 0) // Meele
            {
                ShowPlayerDialog(playerid, DIALOGID+1, DIALOG_STYLE_LIST, "Select a Weapon", "Knuckle Dusters\nGolf Club\nNite Stick\nKnife(Admins only)\nBat\nShovel\nPool Cue\nKatana\nDildo\nSpray Can\nCane", "Select", "Cancel");
            }
            if(listitem == 1) // Pistols
            {
                ShowPlayerDialog(playerid, DIALOGID+2, DIALOG_STYLE_LIST, "Select a Weapon", "9mm\nSilenced 9mm\nDesert Eagle", "Select", "Cancel");
            }
            if(listitem == 2) // Sub-Machine Guns
            {
                ShowPlayerDialog(playerid, DIALOGID+3, DIALOG_STYLE_LIST, "Select a Weapon", "Uzi\nSMG\nTec9", "Select", "Cancel");
            }
            if(listitem == 3) // Rifles
            {
                ShowPlayerDialog(playerid, DIALOGID+4, DIALOG_STYLE_LIST, "Select a Weapon", "Country Rifle\nSniper Rifle", "Select", "Cancel");
            }
            if(listitem == 4) // Assault
            {
                ShowPlayerDialog(playerid, DIALOGID+5, DIALOG_STYLE_LIST, "Select a Weapon", "AK-47\nM4", "Select", "Cancel");
            }
            if(listitem == 5) // Shotguns
            {
                ShowPlayerDialog(playerid, DIALOGID+6, DIALOG_STYLE_LIST, "Select a Weapon", "Standard Shotgun\nSawnoff Shotgun\nCombat Shotgun", "Select", "Cancel");
            }
            if(listitem == 6) // Heavy Weaponry
            {
                ShowPlayerDialog(playerid, DIALOGID+7, DIALOG_STYLE_LIST, "Select a Weapon", "Rocket Laucher(Admins only)\nHeat Seaker(Admins only)\nMinigun(Admins only)\nChain Saw", "Select", "Cancel");
            }
            if(listitem == 7) // Thrown
            {
                ShowPlayerDialog(playerid, DIALOGID+8, DIALOG_STYLE_LIST, "Select a Weapon", "Granade(Admins only)\nTear Gas(Admins only)", "Select", "Cancel");
            }
            if(listitem == 8) // Misc
            {
                ShowPlayerDialog(playerid, DIALOGID+9, DIALOG_STYLE_LIST, "Select a Weapon", "Fire Extinguisher\nSatchel Charge(Admins only)\nParachute\nNightvision Goggles(Admins only)\nFlowers\nCamera", "Select", "Cancel");
            }
        }
        return 1;
    }

    if(dialogid == DIALOGID+1) // Meele
    {
        if(response)
        {
            if(listitem == 0)
            {
                GivePlayerWeapon(playerid, 1, 1);
            }
            if(listitem == 1)
            {
                GivePlayerWeapon(playerid, 2, 1);
            }
            if(listitem == 2)
            {
                GivePlayerWeapon(playerid, 3, 1);
            }
            if(listitem == 3)
            {
                if(IsPlayerAdmin(playerid))
                GivePlayerWeapon(playerid, 4, 1);
            }
            if(listitem == 4)
            {
                GivePlayerWeapon(playerid, 5, 1);
            }
            if(listitem == 5)
            {
                GivePlayerWeapon(playerid, 6, 1);
            }
            if(listitem == 6)
            {
                GivePlayerWeapon(playerid, 7, 1);
            }
            if(listitem == 7)
            {
                GivePlayerWeapon(playerid, 8, 1);
            }
            if(listitem == 8)
            {
                GivePlayerWeapon(playerid, 10, 1);
            }
            if(listitem == 9)
            {
                GivePlayerWeapon(playerid, 41, 500);
            }
            if(listitem == 10)
            {
                GivePlayerWeapon(playerid, 15, 1);
            }
        }
        return 1;
    }
   
    if(dialogid == DIALOGID+2) // Pistols
    {
        if(response)
        {
            if(listitem == 0)
            {
                GivePlayerWeapon(playerid, 22, 500);
            }
            if(listitem == 1)
            {
                GivePlayerWeapon(playerid, 23, 500);
            }
            if(listitem == 2)
            {
                GivePlayerWeapon(playerid, 24, 500);
            }
        }
        return 1;
    }
   
    if(dialogid == DIALOGID+3) // Sub's
    {
        if(response)
        {
            if(listitem == 0)
            {
                GivePlayerWeapon(playerid, 28, 500);
            }
            if(listitem == 1)
            {
                GivePlayerWeapon(playerid, 29, 500);
            }
            if(listitem == 2)
            {
                GivePlayerWeapon(playerid, 32, 500);
            }
        }
        return 1;
    }
   
    if(dialogid == DIALOGID+4) // Rifle's
    {
        if(response)
        {
            if(listitem == 0)
            {
                GivePlayerWeapon(playerid, 33, 500);
            }
            if(listitem == 1)
            {
                GivePlayerWeapon(playerid, 34, 500);
            }
        }
        return 1;
    }

    if(dialogid == DIALOGID+5) // Assault
    {
        if(response)
        {
            if(listitem == 0)
            {
                GivePlayerWeapon(playerid, 30, 500);
            }
            if(listitem == 1)
            {
                GivePlayerWeapon(playerid, 31, 500);
            }
        }
        return 1;
    }
   
    if(dialogid == DIALOGID+6) // Shotguns
    {
        if(response)
        {
            if(listitem == 0)
            {
                GivePlayerWeapon(playerid, 25, 500);
            }
            if(listitem == 1)
            {
                GivePlayerWeapon(playerid, 26, 500);
            }
            if(listitem == 2)
            {
                GivePlayerWeapon(playerid, 27, 500);
            }
        }
        return 1;
    }

    if(dialogid == DIALOGID+7) // Heavy Weapons
    {
        if(response)
        {
            if(listitem == 0)
            {
                if(IsPlayerAdmin(playerid))
                GivePlayerWeapon(playerid, 35, 500);
            }
            if(listitem == 1)
            {
                if(IsPlayerAdmin(playerid))
                GivePlayerWeapon(playerid, 36, 500);
            }
            if(listitem == 2)
            {
                if(IsPlayerAdmin(playerid))
                GivePlayerWeapon(playerid, 38, 500);
            }
            if(listitem == 3)
            {
                GivePlayerWeapon(playerid, 9, 500);
            }
        }
        return 1;
    }
   
    if(dialogid == DIALOGID+8) // Thrown
    {
        if(response)
        {
            if(listitem == 0)
            {
                if(IsPlayerAdmin(playerid))
                GivePlayerWeapon(playerid, 16, 500);
            }
            if(listitem == 1)
            {
                if(IsPlayerAdmin(playerid))
                GivePlayerWeapon(playerid, 17, 500);
            }
        }
        return 1;
    }
   
    if(dialogid == DIALOGID+9) // Misc Fire Extinguisher\nSatchel Charge\nParachute\nNightvision Goggles\nFlowers
    {
        if(response)
        {
            if(listitem == 0)
            {
                GivePlayerWeapon(playerid, 42, 500);
            }
            if(listitem == 1)
            {
                if(IsPlayerAdmin(playerid))
                GivePlayerWeapon(playerid, 39, 500);
                GivePlayerWeapon(playerid, 40, 1);
   }
            if(listitem == 2)
            {
                GivePlayerWeapon(playerid, 46, 1);
            }
            if(listitem == 3)
            {
                if(IsPlayerAdmin(playerid))
                GivePlayerWeapon(playerid, 44, 1);
            }
            if(listitem == 4)
            {
                GivePlayerWeapon(playerid, 14, 1);
            }
            if(listitem == 5)
            {
                GivePlayerWeapon(playerid, 43, 1);
            }
        }
        return 1;
    }
   
    return 0;
 }

Tele

pawn Код:
#include <a_samp>

#define DIALOGID 1337


public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/teles", cmdtext, true, 10) == 0)
    {
        ShowPlayerDialog(playerid, DIALOGID, DIALOG_STYLE_LIST, "EF - Teleports", "Airports\nStunts\nTuning\nDrift\nEating Place", "Select", "Cancel");
        return 1;
    }
    return 0;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOGID)
    {
        if(response)
        {
            {
                ShowPlayerDialog(playerid, dialogid, 1 , "Airports", "/Cluckin1\n/Cluckin2\n/Cluckin3\n/Cluckin4\n/Cluckin5\n/pizza\n/burger\n/burger2\nagdsgasg\nagdgadgdagda\nadfdfaafdfadadf\nagdgagdagadagagd\nadgagadgagadsagdagd\nadfdfajfakdfasjfadjhafd\n", "button1", "button2");
            }
        }
        return 1;
    }
    return 0;
 }



Re: Teleport - Konstantinos - 04.10.2013

Don't use to both weapons and tele dialogid 1337. That mixes them and as a result, one of them won't work.

Plus when you select, let's say Airports, then you need to use the listitem and if the listitem is 0, then the player selected Airports. If it's 2, then the player selected Stunts etc..


Re: Teleport - Deji - 04.10.2013

Well you have DIALOGID defined with the same value in both, so there's a problem. If your match for "dialogid == DIALOGID" is true in the weapon menu code, then that function will return true and as a result, not pass the callback onto the next handler.