Jump to content

Patrick

Moderators
  • Posts

    1,143
  • Joined

  • Last visited

  • Days Won

    42

Everything posted by Patrick

  1. https://community.multitheftauto.com/index.php?p=resources&s=details&id=12699
  2. This function checks if a value is an element or not.
  3. Yes, better. Here it is: local startedEngines = {} function switchEngineState(player) local vehicle = getPedOccupiedVehicle(player) if isElement(vehicle) then local currentState = startedEngines[vehicle] or false if currentState then setVehicleEngineState(vehicle, false) startedEngines[vehicle] = nil removeEventHandler("onVehicleExplode", vehicle, onVehicleExplode) else setVehicleEngineState(vehicle, true) startedEngines[vehicle] = true addEventHandler("onVehicleExplode", vehicle, onVehicleExplode) end end end addEventHandler("onPlayerVehicleEnter", getRootElement(), function(vehicle, seat) if seat == 0 then setVehicleEngineState(vehicle, startedEngines[vehicle] or false) bindKey(source, "1", "down", switchEngineState) end end) addEventHandler("onPlayerVehicleExit", getRootElement(), function(vehicle, seat) if seat == 0 then unbindKey(source, "1", "down", switchEngineState) end end) function onVehicleExplode() startedEngines[source] = nil end
  4. Google translate gone sexual What do you want? We need more information.
  5. function switchEngineState(player) local vehicle = getPedOccupiedVehicle(player) if isElement(vehicle) then local currentState = getElementData(vehicle, "engineState") or false if currentState then setVehicleEngineState(vehicle, false) setElementData(vehicle, "engineState", false) else setVehicleEngineState(vehicle, true) setElementData(vehicle, "engineState", true) end end end addEventHandler("onPlayerVehicleEnter", getRootElement(), function(vehicle, seat) if seat == 0 then local currentState = getElementData(vehicle, "engineState") or false if currentState then setVehicleEngineState(vehicle, true) else setVehicleEngineState(vehicle, false) end bindKey(source, "1", "down", switchEngineState) end end) addEventHandler("onPlayerVehicleExit", getRootElement(), function(vehicle, seat) if seat == 0 then unbindKey(source, "1", "down", switchEngineState) end end)
  6. Try this: function switchEngineState(player) local vehicle = getPedOccupiedVehicle(player) if isElement(vehicle) then setVehicleEngineState(vehicle, (not getVehicleEngineState(vehicle))) end end addEventHandler("onPlayerVehicleEnter", getRootElement(), function(vehicle, seat) if seat == 0 then bindKey(source, "1", "down", switchEngineState) end end) addEventHandler("onPlayerVehicleExit", getRootElement(), function(vehicle, seat) if seat == 0 then unbindKey(source, "1", "down", switchEngineState) end end)
  7. Patrick

    Effect name

    "shootlight" maybe
  8. You can change only the texture. You need a skin model wich have separated textures (face,hair,tshirt,etc...) and change only the face's texture
  9. You can do it only with shaders, but you need custom models. Or you can use the default CJ clothes. (but compatible only with CJ skin)
  10. You need to store translations in a table, like this. -- shared script (You can use this table both on client and server side) languages = { ["exampleTranslateID"] = { ["en"] = "The text.", -- English translate ["de"] = "Der Text.", -- German translate ["hu"] = "A szöveg.", -- Hungarian translate }, } function getTranslate(translateID, languageID) if languages[translateID] and languages[translateID][languageID] then return languages[translateID][languageID] end return "#ERROR" end outputChatBox(getTranslate("exampleTranslateID", "en"))
  11. Patrick

    help armor

    https://wiki.multitheftauto.com/wiki/OnPlayerDamage https://wiki.multitheftauto.com/wiki/GetPedArmor When the player got a damage check his armor. If it <=0 destroy the armor object.
  12. Nice idea. I think this is working. ("This event is triggered when any text is output to chatbox, including MTA's hardcoded messages.")
  13. table1 = {} table2 = {} for _, v in ipairs(table2) do table.insert(table1, v) end
  14. Compile the client scripts. https://luac.multitheftauto.com/
  15. Like this: https://community.multitheftauto.com/index.php?p=resources&amp;s=details&amp;id=4002 It's just half DX, but maybe you can learn from it. (I know it looks awful)
  16. https://wiki.multitheftauto.com/wiki/Meta.xml Example: hide .lua file wich type is client <script src="client.lua" type="client" cache="false"/> Or try to use 'fileDelete' function. https://wiki.multitheftauto.com/wiki/FileDelete
  17. "I think you can't hide it."
  18. This is a built-in system, not a resource.
  19. I think you can't hide it. (because this is the default mta login system)
  20. I made it for you. https://community.multitheftauto.com/index.php?p=resources&amp;s=details&amp;id=15776
  21. onClientPlayerWeaponFire getPedWeaponMuzzlePosition createObject moveObject
×
×
  • Create New...