[Tutorial] Making an TelePort Command with an menu.
#1

hello guys,I would show u today an little admin command.
Follow my steps and it will works.
This is my first tut.
if u got errors pm me or reply.

STEP 1
Put this where u got u include or top of the script in u new GM or what.
pawn Код:
#include <a_samp>
STEP 2
Put this under define's and include's
pawn Код:
new
    Menu:TeleMenu //U can change the name if u want.
;
STEP 3
New We make the text in our menu.
pawn Код:
TeleMenu = CreateMenu("TelePort's", 1, 200.0, 100.0, 150.0, 150.0); //tele menu means createmenu with telemenu as name.
    SetMenuColumnHeader(TeleMenu , 0, "Tele's"); // Mean the header. as name TeleMenu
    AddMenuItem(TeleMenu, 0, "Otto's");//0 means the id from u menu. and Otto's is the place where u will TPed.
    AddMenuItem(TeleMenu, 0, "WG");
    AddMenuItem(TeleMenu, 0, "FBI");
    AddMenuItem(TeleMenu, 0, "Police DP");
    AddMenuItem(TeleMenu, 0, "Amry");
    AddMenuItem(TeleMenu, 0, "Sf Air");
    AddMenuItem(TeleMenu, 0, "City Hall");
    AddMenuItem(TeleMenu, 0, "Bank");
    AddMenuItem(TeleMenu, 0, "Weapon Shop");
    AddMenuItem(TeleMenu, 0, "Supa Save");
    AddMenuItem(TeleMenu, 0, "HosPital");
STEP 4
Ok new we need to make this on the buttom of u script
New u can see above ^ we got 11 Name's
pawn Код:
public OnPlayerSelectedMenuRow(playerid, row)
Put this under u MenuROW
pawn Код:
public OnPlayerSelectedMenuRow(playerid, row)
{
    if(GetPlayerMenu(playerid) == TeleMenu)
    {
        switch(row)
        {
            case 0: SetPlayerPos(playerid,-1649.4952, 1218.6271, 7.1797); // The first case was Otto's
            case 1: SetPlayerPos(playerid, -1976.2963, 287.9316, 35.1719); //
            case 2: SetPlayerPos(playerid, 0, 0, 0); // ahh FBI need to fixed
            case 3: SetPlayerPos(playerid, -1604.4585, 718.0724, 11.7859); //
            case 4: SetPlayerPos(playerid, -1325.7643, 513.1606, 18.2363); //
            case 5: SetPlayerPos(playerid, -1417.1450, -301.5833, 14.0000); //
            case 6: SetPlayerPos(playerid, -2754.0276, 375.7080, 4.1391); //
            case 7: SetPlayerPos(playerid, -1500.6162, 920.3124, 7.1875); //
            case 8: SetPlayerPos(playerid, -2628.4146, 211.4967, 4.5519); //
            case 9: SetPlayerPos(playerid, -2442.8567, 745.0035, 35.0156); //
            case 10: SetPlayerPos(playerid, -2645.8389, 635.8371, 14.4531); //
        }
    }
    return 1;
}
Ok new U need to ingame and save u pos.
with /save SFPD
the open up u savedpos.
and u will see cordiantions.
like addplayerclass but u only needed.
NOTE:not the first numbers the skin id is that!
But u need like this
-2754.0276,375.7080,4.1391
STEP 5
NEW if u got -2754.0276,375.7080,4.1391
U need to make space's -2754.0276, 375.7080, 4.1391
Like this.
New if u done paste it in the 0.0.0 place (With THE Spaces.)
STEP 6 LAST!!!
Ok the last step is. the command for the menu.
U need to paste this under OnPlayerCommandText
Код:
if(strcmp(cmdtext, "/teleport", true) == 0)
{
    ShowMenuForPlayer(TeleMenu,playerid);
    return 1;
}
Also u can make it only for rcon.
with IsPlayerAdmin
Errors?
If u get any error's pm me or reply this are some errors can come
Q:I got an error like error 010: invalid function or declaration
A:U need to put return 1; under that things.
-------------------------------------------------------------------
Q:Pawno No works?? crashes.
A:Maybe, u got GetPlayerMenu other like me.
like... Current = GetPlayerMenu(playerid)
Other
If this not helped u can also go to
https://sampwiki.blast.hk/wiki/Creating_a_simple_Menu
Most thanks for ^

Thanks for reading,sorry for my bad English.
Reply
#2

Complicated even for me to make it. Please explain more.
Reply
#3

Where u stuck then.
I will help.
Reply
#4

I'm not stuck in any. I meant complicated for newbies to make. you should explain and be more specific that's what I meant.
Reply
#5

O yea but i try to make me english good i try me best.
Reply
#6

Nice and useful tut!
Reply
#7

Usefull Tutorial
Reply
#8

Thank you guys.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)