[HELP] Menu not working when clicking space bar.
#1

Ok the problem is when i do /v mod the menu shows up which is good but when i click space bar on the items non of them work.heres my code sorry for poor indention
pawn Код:
vWModM  = CreateMenu("Wheels", 1, 50.0, 180.0, 200.0, 200.0);
    AddMenuItem(vWModM, 0, "Wheel Arch Angels Wheel type 6 - $750");
    AddMenuItem(vWModM, 0, "Wheel Arch Angels Wheel type 3 - $750");
    AddMenuItem(vWModM, 0, "Wheel Arch Angels Wheel type 2 - $750");
    AddMenuItem(vWModM, 0, "Loco' Low Co. Wheel type 4");
    AddMenuItem(vWModM, 0, "Loco' Low Co. Wheel type 1");
    AddMenuItem(vWModM, 0, "Loco' Low Co. Wheel type 3");
    AddMenuItem(vWModM, 0, "Wheel Arch Angels Wheel type 1");
    AddMenuItem(vWModM, 0, "Wheel Arch Angels Wheel type 5");
    AddMenuItem(vWModM, 0, "Wheel Arch Angels Wheel type 4");
    AddMenuItem(vWModM, 0, "Transfender Wheel type 1");
    AddMenuItem(vWModM, 0, "Loco' Low Co. Wheel type 2");
    AddMenuItem(vWModM, 0, "Loco' Low Co. Wheel type 5");
    AddMenuItem(vWModM, 0, "Transfender Wheel type 2");
    AddMenuItem(vWModM, 0, "Transfender Wheel type 3");
    AddMenuItem(vWModM, 0, "Transfender Wheel type 4");
    AddMenuItem(vWModM, 0, "Transfender Wheel type 5");

    vModM = CreateMenu("Modification", 1, 50.0, 180.0, 200.0, 200.0);
    AddMenuItem(vModM, 0, "Engine Repair(250$)");
    AddMenuItem(vModM, 0, "Body Repair($500)");
    AddMenuItem(vModM, 0, "Wheels(750$)");
pawn Код:
else if(Current == vModM) {
        switch(row) {
            case 0:
            {
                new vehicleid = GetPlayerVehicleID(playerid);
                SetVehicleHealth(vehicleid, 1000.0);



            }
            case 1:
            {
                new vehicleid = GetPlayerVehicleID(playerid);
                RepairVehicle(vehicleid);
            }
            case 2:
            {
            ShowMenuForPlayer(vWModM, playerid);
            }


    }
}

else if(Current == vWModM) {
    switch(row) {
    case 0:
    {
    new vehicleid = GetPlayerVehicleID(playerid);
    AddVehicleComponent(vehicleid, 1073);
    GivePlayerPCash(playerid,-750);
    CarInfo[VehicleOwned[vehicleid]][cMod][0] = 1073;
    SaveCars();
    }
    case 1:
    {
        new vehicleid = GetPlayerVehicleID(playerid);
GivePlayerPCash(playerid,-750);
            AddVehicleComponent(vehicleid, 1074);
            CarInfo[VehicleOwned[vehicleid]][cMod][0] = 1074;
            SaveCars();
    }
    case 2:
    {
        new vehicleid = GetPlayerVehicleID(playerid);
GivePlayerPCash(playerid,-750);
            AddVehicleComponent(vehicleid, 1075);
                CarInfo[VehicleOwned[vehicleid]][cMod][0] = 1075;
            SaveCars();
    }
    case 3:
    {
        new vehicleid = GetPlayerVehicleID(playerid);
GivePlayerPCash(playerid,-750);
            AddVehicleComponent(vehicleid, 1076);
            CarInfo[VehicleOwned[vehicleid]][cMod][0] = 1076;
            SaveCars();
    }
    case 4:
    {
        new vehicleid = GetPlayerVehicleID(playerid);
GivePlayerPCash(playerid,-750);
            AddVehicleComponent(vehicleid, 1077);
            CarInfo[VehicleOwned[vehicleid]][cMod][0] = 1077;
            SaveCars();
    }
    case 5:
    {
        new vehicleid = GetPlayerVehicleID(playerid);
GivePlayerPCash(playerid,-750);
            AddVehicleComponent(vehicleid, 1078);
            CarInfo[VehicleOwned[vehicleid]][cMod][0] = 1078;
            SaveCars();
    }
    case 6:
    {
        new vehicleid = GetPlayerVehicleID(playerid);
GivePlayerPCash(playerid,-750);
            AddVehicleComponent(vehicleid, 1079);
                CarInfo[VehicleOwned[vehicleid]][cMod][0] = 1079;
            SaveCars();
    }
    case 7:
    {
        new vehicleid = GetPlayerVehicleID(playerid);
GivePlayerPCash(playerid,-750);
            AddVehicleComponent(vehicleid, 1080);
                CarInfo[VehicleOwned[vehicleid]][cMod][0] = 1080;
            SaveCars();
    }
    case 8:
    {
        new vehicleid = GetPlayerVehicleID(playerid);
GivePlayerPCash(playerid,-750);
            AddVehicleComponent(vehicleid, 1081);
            CarInfo[VehicleOwned[vehicleid]][cMod][0] = 1081;
            SaveCars();
    }
    case 9:
    {
        new vehicleid = GetPlayerVehicleID(playerid);
GivePlayerPCash(playerid,-750);
            AddVehicleComponent(vehicleid, 1082);
            CarInfo[VehicleOwned[vehicleid]][cMod][0] = 1082;
            SaveCars();
    }
    case 10:
    {
        new vehicleid = GetPlayerVehicleID(playerid);
GivePlayerPCash(playerid,-750);
            AddVehicleComponent(vehicleid, 1083);
                CarInfo[VehicleOwned[vehicleid]][cMod][0] = 1083;
            SaveCars();
    }
    case 11:
    {
        new vehicleid = GetPlayerVehicleID(playerid);
GivePlayerPCash(playerid,-750);
            AddVehicleComponent(vehicleid, 1084);
            CarInfo[VehicleOwned[vehicleid]][cMod][0] = 1084;
            SaveCars();
    }
    case 12:
    {
        new vehicleid = GetPlayerVehicleID(playerid);
GivePlayerPCash(playerid,-750);
            AddVehicleComponent(vehicleid, 1085);
            CarInfo[VehicleOwned[vehicleid]][cMod][0] = 1085;
            SaveCars();
    }
    case 13:
    {
        new vehicleid = GetPlayerVehicleID(playerid);
GivePlayerPCash(playerid,-750);
            AddVehicleComponent(vehicleid, 1096);
            CarInfo[VehicleOwned[vehicleid]][cMod][0] = 1096;
            SaveCars();
    }
    case 14:
    {
        new vehicleid = GetPlayerVehicleID(playerid);
GivePlayerPCash(playerid,-750);
            AddVehicleComponent(vehicleid, 1097);
                CarInfo[VehicleOwned[vehicleid]][cMod][0] = 1097;
            SaveCars();
    }
    case 15:
    {
        new vehicleid = GetPlayerVehicleID(playerid);
GivePlayerPCash(playerid,-750);
            AddVehicleComponent(vehicleid, 1098);
                CarInfo[VehicleOwned[vehicleid]][cMod][0] = 1098;
            SaveCars();
            }
            }

    }
}
Reply
#2

Sorry for super early reply but please can someone tell me whats wrong or fix it for me thanks.
Reply
#3

your problem can be that it dosen't find your keyboard at all (space bar)
Reply
#4

Because it works for other menus.
Reply
#5

Wait so you created a menu, and you want to select an item by pressing space? Does it work if you click with mouse?
Reply
#6

idk i havent tried that.
Reply
#7

But isn't every menu supposed to work with space bar to click the item?Ok mine works when you press w thats wierd.
Reply
#8

Im not sure how you make it work with space button, try to see if mouse works tho

pawn Код:
This forum requires that you wait 120 seconds between posts. Please try again in 33 seconds.
Reply
#9

Fixed it nvm.
Reply
#10

Alright mind sharing what problem was, for future references.

Код:
This forum requires that you wait 120 seconds between posts. Please try again in 80 seconds.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)