#1

i need help from you guys

how i can make /tune command when enter car for example sultan only show you the componets for sultan only and hide other not show all MenuItem help!
Reply
#2

Use an if statement that checks if the vehicle model of the player's vehicle is the same as the Sultan's model, then add the menu with the specific components to it. I assume that is what you want to achieve.
Reply
#3

how i can do this with this code :


Exhausts = CreateMenu("TuningMenu",1,20,120,150,40);
SetMenuColumnHeader(Exhausts,0,"Exhausts");
AddMenuItem(Exhausts,0,"Wheel Arch Alien Exhaust");
AddMenuItem(Exhausts,0,"Wheel Arch X-Flow Exhaust");
AddMenuItem(Exhausts,0,"Locos Low Chromer Exhaust");
Reply
#4

Top of script:
pawn Код:
new Menu:Exhausts;
pawn Код:
Exhausts = CreateMenu("TuningMenu",1,20,120,150,40);
pawn Код:
SetMenuColumnHeader(Exhausts,0,"Exhausts");
pawn Код:
AddMenuItem(Exhausts,0,"Wheel Arch Alien Exhaust");
AddMenuItem(Exhausts,0,"Wheel Arch X-Flow Exhaust");
AddMenuItem(Exhausts,0,"Locos Low Chromer Exhaust");
OnPlayerCommandText
pawn Код:
if(strcmp(cmdtext,"/tune",true)==0)
{
    If(GetVehicleModel(GetPlayerVehicleID(playerid)) == 560)
    {
         ShowMenuForPlayer(Exhaust, playerid);
         return 1;
    }
}
Lower script
pawn Код:
public OnPlayerSelectedMenuRow(playerid, row)
{
    new Menu:current;
    current = GetPlayerMenu(playerid);
    if(current == Exhaust)
    {
        switch(row)
        {
             case 0:
             {
                 //First menu item, do something here            
             }
             case 1:
             {
                 //second menu item, do something here            
             }
             case 2:
             {
                 //third menu item, do something here            
             }
         }
    }
    return 1;
}
Reply
#5

AddVehicleComponent
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)