'LinKin Posted July 25, 2013 Share Posted July 25, 2013 Hi guys, I wanna make a script so that the user can change his vehicle's doors state. I wanna make it so that for example when the use types /doors 0 4 , the hood turns missing, or if he types /doors 3 3 , the Front right door turns Ajar, damaged. This is what I've done, but without success. I hope someone can help me. function Doorless(localPlayer, doors, state, a, b) local car = getPedOccupiedVehicle(localPlayer) state = setVehicleDoorState ( car, tonumber(a), tonumber(b) ) outputChatBox("The reurn was: "..tostring(state)) end addCommandHandler("doors", Doorless) Regards, LinKin Link to comment
Dealman Posted July 25, 2013 Share Posted July 25, 2013 Try this; (Server-side!) function Doorless(thePlayer, ...) if(isPedInVehicle(thePlayer)) then local theVehicle = getPedOccupiedVehicle(thePlayer) local message = table.concat({...}, " ") local arrayString = split(message, " ") vehicleStates = setVehicleDoorState(theVehicle, tonumber(arrayString[1]), tonumber(arrayString[2])) else outputChatBox("[server]: #FF0000You must be in a Vehicle to use this!", thePlayer, 69, 69, 69, true) end end addCommandHandler("doors", Doorless) Haven't tried it though 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