SA-MP Forums Archive
Help - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help (/showthread.php?tid=269090)



Help - [MKD]Max - 14.07.2011

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!


Re: Help - SWEMike - 14.07.2011

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.


Re: Help - [MKD]Max - 14.07.2011

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");


Re: Help - Adil - 14.07.2011

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;
}



Re: Help - Markx - 14.07.2011

AddVehicleComponent