Jump to content

Fix vehicle help


Tsuki

Recommended Posts

Hey

I've got a problem with my script

I tried to make a vehicle repair script but it doesn't work

NO errors

  
function fixVehicle ( thePlayer, commandName) 
    if ( isPedInVehicle ( thePlayer ) ) then 
     
        local theVehicle = getPedOccupiedVehicle ( thePlayer) 
        local succes = fixVehicle ( theVehicle ) 
     
        if ( succes ) then 
            outputConsole (" Vehicle fixed. ", thePlayer ) 
        else 
            outputConsole ( "Failed to fix your vehicle.", thePlayer) 
        end 
    else 
        outputConsole ( "You must be in a vehicle!", thePlayer ) 
    end 
end 
addCommandHandler ( "vr", fixVehicle) 
  

Does someone now what's wrong

Greetz Tsuki

Link to comment
function repairVehicle ( thePlayer, commandName) -- never use a function name like fixVehicle because it can make problems. 
    if ( isPedInVehicle ( thePlayer ) ) then 
        local theVehicle = getPedOccupiedVehicle ( thePlayer) 
        local succes = fixVehicle ( theVehicle ) 
        if ( succes ) then 
            outputChatBox (" Vehicle fixed. ", thePlayer ) 
        else 
            outputChatBox ( "Failed to fix your vehicle.", thePlayer) 
        end 
    else 
        outputChatBox ( "You must be in a vehicle!", thePlayer ) 
    end 
end 
addCommandHandler ( "vr", repairVehicle) 

I think this should work, it's defined as server side on meta.xml?

Link to comment
Replace your fixVehicle function by fixVehicleCommand or something like this be cause you put the same name of the existing mta function :wink: .

You can't create a function with the same name of an other.

What's the point of posting what i already said?

Link to comment

You posted it three minutes just before me: when I've started to see what's wrong and write my response your post wasn't here.

And it's explain what is exactly wrong with this kind of problem...

Don't be so annoying Oo. I'm trying to help people, I'm spending time for the others and you try to say what with this kind of unpleasant posts ? I can't believe you take 30 secs just to tell me that which is not necessary...

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...