Callum1243 Posted July 9, 2016 Posted July 9, 2016 I was wondering if anyone could help me with a script. Taking vehicle parts from vehicles in MTA DayZ. Skype: john.scottpla
pRemi Posted July 9, 2016 Posted July 9, 2016 This feature is available with the new MTA:DayZ. https://github.com/mtadayz/MTADayZ
Callum1243 Posted July 9, 2016 Author Posted July 9, 2016 It's in menu_client, I go into it and place the code: function takeVehicleComponent(veh,action,itemName) if getElementData(source,"Toolbox") > 0 then setPedAnimation (source,"BOMBER","BOM_Plant",3000,false,false,nil,false) setTimer(function(source,veh,action) if action == "takewheel" then local col = getElementData(veh,"parent") setElementData(col,"Tire_inVehicle",getElementData(col,"Tire_inVehicle")-1) setElementData(source,"Tire",getElementData(source,"Tire")+1) triggerClientEvent (source, "displayClientInfo", source,"Vehicle","You took a wheel out.",0,255,0) elseif action == "takeengine" then local col = getElementData(veh,"parent") setElementData(col,"Engine_inVehicle",getElementData(col,"Engine_inVehicle")-1) setElementData(source,"Engine",getElementData(source,"Engine")+1) triggerClientEvent (source, "displayClientInfo", source,"Vehicle","You took the engine out.",0,255,0) elseif action == "siphon" then local col = getElementData(veh,"parent") local fuel = getElementData(col,"fuel") if fuel >= 20 then setElementData(col,"fuel",getElementData(col,"fuel")-20) else setElementData(col,"fuel",0) end setElementData(source,"Full Gas Canister",getElementData(source,"Full Gas Canister")+1) setElementData(source,"Empty Gas Canister",getElementData(source,"Empty Gas Canister")-1) triggerClientEvent (source, "displayClientInfo", source,"Vehicle","You siphoned some fuel.",0,255,0) end end,3000,1,source,veh,action) else triggerClientEvent (source, "displayClientInfo", source,"Vehicle","You need a toolbox!",255,0,0) end end addEvent("takeVehicleComponent",true) addEventHandler("takeVehicleComponent",root,takeVehicleComponent) Yet it does nothing in game, why?
Captain Cody Posted July 9, 2016 Posted July 9, 2016 Because there are other things that this depends on
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