What's Wrong with this Menu?
#1

Okay I am creating a menu for weapons, and I am using the tutorial on SAMP Wiki, it all makes sense, but it doesn't compile.

Here is my OnGameModeInIt()
pawn Код:
public OnGameModeInit()
{
    SetGameModeText("Test gamemode");
    //----Player Class Selection
    AddPlayerClass(23,2038.5416,1342.3601,10.6719,270.0824,0,0,0,0,0,0);
    AddPlayerClass(46,1831.0970,-1682.6102,13.5469,88.3051,0,0,0,0,0,0);
    AddPlayerClass(45,1481.3297,-1748.6530,15.4453,359.7071,0,0,0,0,0,0);
    AddPlayerClass(83,723.3815,-1494.9203,1.9343,359.2792,0,0,0,0,0,0);
    AddPlayerClass(92,1126.6831,-1425.8101,15.7969,357.7497,0,0,0,0,0,0);
    //---------------------------[SERVER VEHICLES]------------------------------
    AddStaticVehicle(502,1478.9257,-1737.8595,13.2929,270.0982,0,0);
    //Weapons Menu
    Weaponsmenu = CreateMenu("Weaponsmenu", 1, 200.0, 100.0, 150.0, 150.0);
    AddMenuItem(Weaponsmenu, 0, "Sawnoff");
    AddMenuItem(Weaponsmenu, 0, "Sniper");
    AddMenuItem(Weaponsmenu, 0, "Deagle");
    AddMenuItem(Weaponsmenu, 0, "M4");
    AddMenuItem(Weaponsmenu, 0, "Tec-9");
    AddMenuItem(Weaponsmenu, 0, "MP5");
    return 1;
}
I have these near the top of my script
pawn Код:
new Menu:Weaponsmenu;
new Menu:CurrentMenu = GetPlayerMenu(playerid);
Here is my "if" things, I don't know where to place this in the script
pawn Код:
if (CurrentMenu == Weaponsmenu)
{
    switch(row)
    {
        case 0: //Sawnoff
        {
            GivePlayerWeapon(playerid, 26, 500);
            SendClientMessage(playerid, 0xFFFFFFFF, "You have been given a Sawnoff");
        }
        case 1: //Sniper
        {
            GivePlayerWeapon(playerid, 34, 50);
            SendClientMessage(playerid, 0xFFFFFFFF, "You have been given a Sniper");
        }
        case 2: //Deagle
        {
            GivePlayerWeapon(playerid, 24, 250);
            SendClientMessage(playerid, 0xFFFFFFFF, "You have been given a Deagle");
        }
        case 3: //M4
        {
            GivePlayerWeapon(playerid, 31, 300);
            SendClientMessage(playerid, 0xFFFFFFFF, "You have been given an M4");
        }
        case 4: //Tec-9
        {
            GivePlayerWeapon(playerid, 32, 500);
            SendClientMessage(playerid, 0xFFFFFFFF, "You have been given a Tec-9");
        }
        case 5: //MP5
        {
            GivePlayerWeapon(playerid, 29, 350);
            SendClientMessage(playerid, 0xFFFFFFFF, "You have been given an MP5");
        }
    }
}
Finally here is the command to bring the menu on the screen
pawn Код:
if (strcmp("/weapons", cmdtext, true, 8))
    {
        ShowMenuForPlayer(weaponsmenu,playerid);
        return 1;
    }
Thanks for reading, I hope you can help me
Reply


Messages In This Thread
What's Wrong with this Menu? - by Zach7 - 07.08.2013, 00:54
Re: What's Wrong with this Menu? - by Zach7 - 07.08.2013, 01:32
Re: What's Wrong with this Menu? - by Pk93 - 07.08.2013, 01:34
Re: What's Wrong with this Menu? - by cray1100 - 07.08.2013, 01:34
Re: What's Wrong with this Menu? - by Zach7 - 07.08.2013, 01:36
Re: What's Wrong with this Menu? - by Pk93 - 07.08.2013, 01:40
Re: What's Wrong with this Menu? - by cray1100 - 07.08.2013, 01:49
Re: What's Wrong with this Menu? - by Zach7 - 07.08.2013, 01:58
Re: What's Wrong with this Menu? - by Zach7 - 07.08.2013, 02:08
Re: What's Wrong with this Menu? - by Edix - 07.08.2013, 02:11

Forum Jump:


Users browsing this thread: 1 Guest(s)