Need Someone!
#1

I need help, can someone add a selection --Wheels-- to the job?
When you click on the ''wheels'' it opens a menu with all of the wheels in the game. and each set of wheels costs money.
Code-1
PHP код:
    else if(dialogid == 9// Mechanic
    
{
        if(
response)
        {
            switch(
listitem)
            {
                case 
0// Repair Vehicle
                
{
                    new 
string[128];
                    new 
Float:vHGetVehicleHealth(GetPlayerVehicleID(playerid), vH);
                    new 
Float:vel[3]; GetVehicleVelocity(GetPlayerVehicleID(playerid), vel[0], vel[1], vel[2]);
                    if(
vH 250) return SendClientMessage(playeridCOLOR_GREY"The vehicle's engine is too hot to be repaired.");
                    if(
GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playeridCOLOR_GREY"You must be in the driver seat to repair a vehicle.");
                    if(
vel[0] != || vel[1] != || vel[2] != 0) return SendClientMessage(playeridCOLOR_GREY"You can't repair a vehicle while it's moving.");
                    
RepairVehicle(GetPlayerVehicleID(playerid));
                    
PlayerInfo[playerid][pJobSkill][JOB_MECHANIC] ++;
                    
PlayerPlaySound(playerid,1133,0.0,0.0,0.0);
                    
format(stringsizeof(string), "* %s has completely repaired the vehicle they're inside."RPN(playerid));
                    
SendNearbyMessage(playerid15stringCOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLE);
                }
                case 
1// Add/Remove Nitros
                
{
                    new 
string[128];
                    new 
Float:vel[3]; GetVehicleVelocity(GetPlayerVehicleID(playerid), vel[0], vel[1], vel[2]);
                    if(
GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playeridCOLOR_GREY"You must be in the driver seat to repair a vehicle.");
                    if(
vel[0] != || vel[1] != || vel[2] != 0) return SendClientMessage(playeridCOLOR_GREY"You can't add/remove nitros to a vehicle while it's moving.");
                    if(
GetVehicleComponentInSlot(GetPlayerVehicleID(playerid),GetVehicleComponentType(1009)) != 1009// Check if the vehicle has no nitro
                    
{
                        
AddVehicleComponent(GetPlayerVehicleID(playerid),1009);
                        
PlayerPlaySound(playerid,1133,0.0,0.0,0.0);
                        
format(stringsizeof(string), "* %s has installed a 2x nitros cylinder into the vehicle."RPN(playerid));
                    }
                    else
                    {
                        
RemoveVehicleComponent(GetPlayerVehicleID(playerid),1009);
                        
PlayerPlaySound(playerid,1133,0.0,0.0,0.0);
                        
format(stringsizeof(string), "* %s has removed the nitros cylinders from the vehicle."RPN(playerid));
                    }
                    
SendNearbyMessage(playerid15stringCOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLE);
                }
                case 
2// Add/Remove Hydraulics
                
{
                    new 
string[128];
                    new 
Float:vel[3]; GetVehicleVelocity(GetPlayerVehicleID(playerid), vel[0], vel[1], vel[2]);
                    if(
GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playeridCOLOR_GREY"You must be in the driver seat to repair a vehicle.");
                    if(
vel[0] != || vel[1] != || vel[2] != 0) return SendClientMessage(playeridCOLOR_GREY"You can't add/remove nitros to a vehicle while it's moving.");
                    if(
GetVehicleComponentInSlot(GetPlayerVehicleID(playerid),GetVehicleComponentType(1087)) != 1087// Check if the vehicle has no hydraulics
                    
{
                        
AddVehicleComponent(GetPlayerVehicleID(playerid),1087);
                        
PlayerPlaySound(playerid,1133,0.0,0.0,0.0);
                        
format(stringsizeof(string), "* %s has installed hydraulics system into the vehicle."RPN(playerid));
                    }
                    else
                    {
                        
RemoveVehicleComponent(GetPlayerVehicleID(playerid),1087);
                        
PlayerPlaySound(playerid,1133,0.0,0.0,0.0);
                        
format(stringsizeof(string), "* %s has removed the hydraulics from the vehicle."RPN(playerid));
                    }
                    
SendNearbyMessage(playerid15stringCOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLE);
                }
            }
        }
    } 
code-2
PHP код:
        case 9// Mechanic
        
{
            
ShowPlayerDialog(playerid9DIALOG_STYLE_LIST"Mechanic Tools""Repair Vehicle\nAdd/Remove Nitros\nAdd/Remove Hydraulics""Choose""Cancel");
        } 
Reply


Messages In This Thread
Need Someone! - by k2rl - 02.08.2014, 10:12
Re: Need Someone! - by SlimDkhili - 02.08.2014, 11:24
Re: Need Someone! - by k2rl - 02.08.2014, 13:05
Re: Need Someone! - by Drago987 - 02.08.2014, 13:32
Re: Need Someone! - by k2rl - 02.08.2014, 13:34
Re: Need Someone! - by k2rl - 02.08.2014, 14:06

Forum Jump:


Users browsing this thread: 2 Guest(s)