stefutz101 Posted September 6, 2015 Posted September 6, 2015 Hi , i have a problem with cars . When i enter in a car in debug script output this message : http://s24.postimg.org/45gl0ra5h/mta_sc ... _02_10.png Thanks in advance .
Fist Posted September 6, 2015 Posted September 6, 2015 Probably problem is in your new vehicle hud, try to disable it and then check again or it give those errors or no.
stefutz101 Posted September 6, 2015 Author Posted September 6, 2015 I disable hud for cars the same problem . function onPlayerEnterDayzVehicle(veh,seat) local col = getElementData(veh,"parent") local id = getElementModel(veh) if not seat == 1 then return end local tires,engine = getVehicleAddonInfos (id) setVehicleEngineState ( veh, false ) setElementData(veh,"maxfuel",getVehicleMaxFuel(col)) setElementData(veh,"needtires",tires) setElementData(veh,"needengines",engine) if ((getElementData(col,"Tire_inVehicle") or 0) < tonumber(tires)) then setVehicleEngineState ( veh, false ) return end if ((getElementData(col,"Engine_inVehicle") or 0) < tonumber(engine)) then setVehicleEngineState ( veh, false ) return end if (getElementData(col,"fuel") or 0) <= 1 then if not getElementModel(veh) == 509 then triggerClientEvent (source, "displayClientInfo", source,"Vehicle","No tank left in this vehicle!",22,255,0) setVehicleEngineState ( veh, false ) return end end setVehicleEngineState ( veh, true ) bindKey(source,"k","down",setEngineStateByPlayer) outputChatBox("Press 'K' to turn the engine on/off!",source) end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), onPlayerEnterDayzVehicle ) Now i have error only for "setElementData(veh,"maxfuel",getVehicleMaxFuel(col))" .
Markeloff Posted September 6, 2015 Posted September 6, 2015 You need to add these lines; vehicleFuelTable = { -- {MODEL ID, MAX. FUEL}, {422,80}, {470,100}, {468,30}, {433,140}, {437,140}, {509,0}, {487,60}, {497,60}, {453,60}, } function getVehicleMaxFuel(loot) local modelID = getElementModel(getElementData(loot,"parent")) for i,vehicle in ipairs(vehicleFuelTable) do if modelID == vehicle[1] then return vehicle[2] end end return false end Some people want it to happen, some wish it would happen, others make it happen.
stefutz101 Posted September 6, 2015 Author Posted September 6, 2015 I already try . I test again and nothing the same error . I think this error cauze that error it's true ? : http://s24.postimg.org/ik4n0c277/mta_sc ... _31_14.png Thanks for try
Moderators IIYAMA Posted September 6, 2015 Moderators Posted September 6, 2015 So much work on a gamemode like that and such a crappy quality. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Fist Posted September 6, 2015 Posted September 6, 2015 So much work on a gamemode like that and such a crappy quality. quality crappy if because he uses low resolution, but that effects if u make/or add crappy looking resources, too.
Moderators IIYAMA Posted September 6, 2015 Moderators Posted September 6, 2015 So much work on a gamemode like that and such a crappy quality. quality crappy if because he uses low resolution, but that effects if u make/or add crappy looking resources, too. I am talking about the code(dayz), not his screenshot. I am not that stupid... Quality code doesn't show errors or warnings. Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Tekken Posted September 7, 2015 Posted September 7, 2015 So much work on a gamemode like that and such a crappy quality. quality crappy if because he uses low resolution, but that effects if u make/or add crappy looking resources, too. I am talking about the code(dayz), not his screenshot. I am not that stupid... Quality code doesn't show errors or warnings. That's beasause this gamemode was compiled and who decompiled made his own edits and as you can see didn't do a good job, also the original code made by Marwin is messed up (I know that cause I have it). Resources I made: attachToBones - A newer bone_attach. Simple Level system - Just a simple level system. Do not PM me for help with leaked scripts! I WILL NOT HELP YOU!
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