Tsuki Posted March 7, 2011 Share Posted March 7, 2011 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
Castillo Posted March 7, 2011 Share Posted March 7, 2011 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
InDev Posted March 7, 2011 Share Posted March 7, 2011 Replace your fixVehicle function by fixVehicleCommand or something like this be cause you put the same name of the existing mta function . You can't create a function with the same name of an other. Link to comment
Castillo Posted March 7, 2011 Share Posted March 7, 2011 Replace your fixVehicle function by fixVehicleCommand or something like this be cause you put the same name of the existing mta function .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
InDev Posted March 7, 2011 Share Posted March 7, 2011 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
Castillo Posted March 7, 2011 Share Posted March 7, 2011 Oh, my bad, excuse me, i didn't wanted to insult you Link to comment
InDev Posted March 7, 2011 Share Posted March 7, 2011 No problem but, be careful next time ^^ Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now