-
Posts
1,143 -
Joined
-
Last visited
-
Days Won
42
Everything posted by Patrick
-
logging in mta with data from registration in the mybb forum
Patrick replied to NoviceWithManyProblems's topic in Scripting
You can find the hashing function in /inc/functions_user.php (create_password) -
-- CLIENT SIDE addCommandHandler("hide", function() local vehicle = getPedOccupiedVehicle(localPlayer) if not vehicle then return outputChatBox("ERROR: You have to sit in a vehicle!") end setVehicleComponentVisible(vehicle, "bump_front_dummy", false) setVehicleComponentVisible(vehicle, "bump_rear_dummy", false) outputChatBox("SUCCESS: Bumpers are hided!") end)
-
First of all, read this before your next post: https://forum.multitheftauto.com/topic/94790-guidelines-and-formatting-for-this-section-read-before-posting/ onClientRender triggered ~60 times in a second, so play the sound ~60 times as long as the gear doesn't change. You need to limit it. g_player = getLocalPlayer() g_root = getRootElement() local alreadyPlayed = false function CurrentGear() local g_vehicle = getPedOccupiedVehicle(g_player) if g_vehicle then local gear = getVehicleCurrentGear(g_vehicle) if (gear == 2) then if (alreadyPlayed == false) then -- play sound if we haven't played it yet local sound = playSound("sounds/bov.wav",false) setSoundVolume(sound, 0.5) alreadyPlayed = true -- remember, we already played it end else alreadyPlayed = false -- reset alreadyPlayed, when gear not 2 end end end addEventHandler("onClientRender",g_root,CurrentGear)
-
In line 12 you need to use guiGetVisible.
-
Looks good. I think you spoil it elsewhere.
-
I think you can't do it with gui. You need to use dxDrawImageSection or renderTarget
-
Change image size when window resized. local window = guiCreateWindow(500, 500, 200, 200, "Background", false) local image = guiCreateStaticImage(0, 0, 1, 1, "img.png", true, window) addEventHandler("onClientGUISize", window, function() guiSetSize(image, 1, 1, true) end)
-
It's a bit complicated to explain and prepare. I recommend you download one from the community and see how it works. But. The center of the background map image is the 0,0,0 position in the game. You need to calculate 1m in game, how much pixels on the screen. And move in the right direction, from the middle.
-
I do not understand you.
-
https://wiki.multitheftauto.com/wiki/GetScreenFromWorldPosition
-
local screenX, screenY = guiGetScreenSize() local screenSource = dxCreateScreenSource(screenX, screenY) addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function() if getVersion ().sortable < "1.1.0" then outputChatBox("Resource is not compatible with this client.") return else blackWhiteShader, blackWhiteTec = dxCreateShader("fx/blackwhite.fx") if (not blackWhiteShader) then outputChatBox("Could not create shader. Please use debugscript 3.") else outputChatBox("shader " .. blackWhiteTec .. " was started.") end end end) function doBlackAndWhite() if (blackWhiteShader) then dxUpdateScreenSource(screenSource) dxSetShaderValue(blackWhiteShader, "screenSource", screenSource) dxDrawImage(0, 0, screenX, screenY, blackWhiteShader) end end local marker = createMarker(0, 0, 3, "cylinder", 2) addEventHandler("onClientMarkerHit", marker, function() addEventHandler("onClientPreRender", getRootElement(), doBlackAndWhite) end) addEventHandler("onClientMarkerLeave", marker, function() removeEventHandler("onClientPreRender", getRootElement(), doBlackAndWhite) end) Edit blackwhite.Lua
-
https://community.multitheftauto.com/index.php?p=resources&s=details&id=8466
-
https://wiki.multitheftauto.com/wiki/GetTimerDetails
-
This is an English forum section.
-
Show the full code.
-
I don't think this part is cause it. If you delete it, won't use many cpu? - Any error in debugscript 3?
-
Show me the code.
-
You can't cancel this event.
-
Possible by default. You don't have to do anything extra.
-
-- CLIENT addEventHandler("onClientGUIClick", BUTTON_ELEMENT, function() local some_button_data = 5 triggerServerEvent("doServerFunction", localPlayer, some_button_data) end) addEvent("doServerFunction:receiveResults", true) addEventHandler("doServerFunction:receiveResults", localPlayer, function(results_from_server_data) outputChatBox(results_from_server_data) -- print: 10 end) addEvent("doServerFunction", true) addEventHandler("doServerFunction", root, function(data_from_client) local need_to_return_this = data_from_client * 2 -- do some magic here triggerClientEvent(source, "doServerFunction:receiveResults", source, need_to_return_this) end) Need to do like this.
-
if ( bodypart == 9 and weapon == 24 or weapon == 25 or weapon == 34 ) then replace to: if ( bodypart == 9 and ( weapon == 24 or weapon == 25 or weapon == 34 ) ) then
-
Your code is not right and I have described what you need to do.
-
What do not you understand?
-
On server side, in the 18th row where you check the IDs, you need to use or instead of and.