Jump to content

Tails

Members
  • Posts

    740
  • Joined

  • Days Won

    16

Everything posted by Tails

  1. Hi codylewiz, Here's something I wrote just now. It does exactly what you want. I've added in a function to reset every handling property globally so you can play around with different properties and settings. This isn't necessary because if you remove one of the properties in the second function then those properties won't get reset to their default values. Hope this helps, Tails function resetHandling() for _,veh in pairs(getElementsByType("vehicle")) do local model = getElementModel(veh) local propTable = getOriginalHandling(model) for k,v in pairs(propTable) do setVehicleHandling(veh,k,v) end end end addEventHandler("onResourceStart",root,resetHandling) function changeHandling(veh) local model = getElementModel(veh) local propTable = getOriginalHandling(model) local prop = "tractionLoss" local value = propTable[prop] setVehicleHandling(veh,prop,value-0.25) outputChatBox("Original "..prop.." value: "..value,source) local prop = "tractionBias" local value = propTable[prop] setVehicleHandling(veh,prop,value+0.20) outputChatBox("Original "..prop.." value: "..value,source) end addEventHandler("onPlayerVehicleEnter",root,changeHandling)
  2. Thank you both for your help! I managed to do it the way you described it jingzhi. Never knew about that function. addEventHandler("onVehicleStartEnter",root, function(player,seat) local e_state = getVehicleEngineState(source) if seat == 0 and e_state == false then function onEnter(player) setVehicleEngineState(source,false) removeEventHandler("onVehicleEnter",root,onEnter) end addEventHandler("onVehicleEnter",root,onEnter) end end ) This way you don't have to use tables or setElementData, JanriKallas.
  3. That's not getting the initial state. When a player gets in a vehicle it turns on the engine by itself so it's always going to be true. I could set the engine state to false through onPlayerVehicleEnter but that's not what I'm looking for. Because with my code, I can choose to leave the engine on when I exit a vehicle. But when I choose to leave the engine off and exit en re-enter the vehicle it'll turn the engine back on. So to be more clear: When I leave the engine off and exit, when I enter again and use getVehicleEngineState then it will return true because the engine turns back on by it self. I hope you understand what I mean.
  4. Try use getVehicleController https://wiki.multitheftauto.com/wiki/Ge ... Controller
  5. This tool lets you hide everything on your screen: https://community.multitheftauto.com/in ... ls&id=8010
  6. Hello everybody, I'm working on a script that lets you control the state of the engine. Is there any way to get a vehicle's initial engine state? For example, I need to know whether the engine of the vehicle you're entering is on or off. So when the engine is off and you're entering it, the engine should stay off and vice versa. I can easily manage this but it won't work as soon as I enter another vehicle. So if we had some sort of function to detect a vehicle's initial engine state then that would solve the problem. Any help is much appreciated, Tails
  7. I got this little code but it's not doing the job very well and it seems inefficient to me. function moveBG() guiMoveToBack(bg) end addEventHandler("onClientGUIClick",bg,moveBG,false)
  8. Thanks. I got it to work now for other websites but it only shows text, no images or text formatting whatsoever.
  9. Tails

    Green Candy

    That's nice to hear.
  10. So, I've been testing out the new browser scripting features for MTA 1.5 and made myself a browser. All works good but it only seems to load https://www.youtube.com/. I've tried other websites but they just don't show up. I looked at the whitelist and requestBrowserDomains functions but couldn't quite figure it out yet. Any ideas?
  11. Tails

    Green Candy

    Yes, I spoke to him a couple months ago. He said the EIR is still very close to his heart but was lacking documentation which made it very difficult for him to work on it. He's planning a documentation framework which should simplify his work, after that he'll continue his project.
  12. Excited to show you guys some new stuff on our current build, Enjoy!
  13. Tails

    Scale > 1

    It's not possible but it has been officially requested: https://bugs.mtasa.com/view.php?id=1278
  14. Tails

    firefighter

    They got this working in SA-MP and it's pretty dang accurate. Not sure how they did it though, but it looked like just regular fire.
  15. Tails

    firefighter

    You can do it with colshapes, effects and onVehicleWeaponFire or OnClientWeaponFire. I'm sure any experienced lua programmer can pull this off easily. I've tried it before but I couldn't do it, but that's only because I have a very limited knowledge of lua. H7gus, try asking Solidsnake, one of the mods of this forum. I'm sure he can do it for you for a small price.
  16. If you replaced an existing physical object then the physics should still be there. At least, I know that if you don't replace the collisions, it will move any custom object but only if you hit or touch the original collision. I can't say it works if you have replaced the collisions for them.
  17. Works! That gunfire was driving me nuts! Thanks
  18. Hello, Is there any way to disable the gunshot sounds that you hear often even though nobody is shooting? Thanks in advance
  19. Thanks! I didn't know you could change the alpha.
  20. Hello, I was wondering if there's any way to replace the default cursor in MTA:SA with a custom one. I've also seen cursors with a red border around them, how do I get one like that? Thanks in advance
  21. Hi Quindo, You can find the answer to your question in this thread: https://forum.multitheftauto.com/viewtopic.php?f=91&t=63832
  22. The kill messages resources comes with the MTA server by default. Just type /start killmessages
  23. I believe sam is going to add in options so you can disable those for yourself.
  24. That is quite strange it should work, any sort of errors you can tell me of. Yeah, forgot the /onoff switch. It's working now
×
×
  • Create New...