-
Posts
1,143 -
Joined
-
Last visited
-
Days Won
42
Everything posted by Patrick
-
https://community.multitheftauto.com/index.php?p=resources&s=details&id=12699
-
This function checks if a value is an element or not.
-
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
-
Google translate gone sexual What do you want? We need more information.
-
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)
-
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)
-
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
-
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)
-
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"))
-
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.
-
Accessing the MTA built in database from outside
Patrick replied to keymetaphore's topic in Scripting
https://wiki.multitheftauto.com/wiki/PHP_SDK -
Nice idea. I think this is working. ("This event is triggered when any text is output to chatbox, including MTA's hardcoded messages.")
-
table1 = {} table2 = {} for _, v in ipairs(table2) do table.insert(table1, v) end
-
Compile the client scripts. https://luac.multitheftauto.com/
-
Like this: https://community.multitheftauto.com/index.php?p=resources&s=details&id=4002 It's just half DX, but maybe you can learn from it. (I know it looks awful)
-
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
-
"I think you can't hide it."
-
This is a built-in system, not a resource.
-
I think you can't hide it. (because this is the default mta login system)
-
I made it for you. https://community.multitheftauto.com/index.php?p=resources&s=details&id=15776
-
onClientPlayerWeaponFire getPedWeaponMuzzlePosition createObject moveObject