-
Posts
1,143 -
Joined
-
Last visited
-
Days Won
43
Everything posted by Patrick
-
marker = createMarker(137.39999, 1850.4, 16.6, "cylinder", 1.5, 230, 251, 3, 153) function camera(hitElement) if getElementType(hitElement) == "player" then fadeCamera(hitElement, false, 0.5) setTimer(function() setCameraMatrix(hitElement, 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316) fadeCamera(hitElement, true, 0.5) end, 500, 1) end end addEventHandler("onMarkerHit", marker, camera)
-
Because: true == true is true (So, true == true and true are same.)
-
In line 5, at the end have a invisible character, delete it.
-
No, 0 and 1 is Integer. So, 1 means 1 and 0 means 0.
-
When player logged in, you don't set "guests" elementdata to false/nil. So, (getElementData(localPlayer, "guests") == 1) always returns true. (==> don't check second condition) You can solve it, if you set "guest" false/nil, when player logged in. btw: - "else if" is incorrect, the correct is "elseif" - guest and players tables are unused, so you can remove it - use /debugscript 3 One solution: -- SERVER function login() setElementData(source, "loggedin", true) end addEventHandler("onPlayerLogin", getRootElement(), login) -- CLIENT function check() if (getElementData(localPlayer, "loggedin")) then outputChatBox("You are a player") else outputChatBox("You are a guest") end end addCommandHandler("data", check)
-
https://wiki.multitheftauto.com/wiki/OOP https://wiki.multitheftauto.com/wiki/SetElementData
-
Ez nem az a hely, ahol ilyenekben segítünk. Erre használd az elfajzott, magyar MTA Facebook csoportokat.
- 1 reply
-
- 1
-
-
[HUN ]Szia! Nem tudom hogy miért így akarod cserélni a szavakat, de itt van egy megoldás a te példádra. (én nem használnám, felesleges export, függvényhívás, loop) Ebben az esetben a funkció elvárja, hogy a következőképpen kapja meg az argumenteket: replaceWords(EREDETI_SZOVEG, MIT_CSERELJEN, MIRE_CSERELJE, ..., MIT_CSERELJEN, MIRE_CSERELJE, és így tovább...) function replaceWords(text, ...) local args = {...} for i=1, #args do if (i%2 == 1) then text = text:gsub(args[i], args[i+1]) end end return text end print(replaceWords("#PLAYERNAME has #PLAYERMONEY dollar!", "#PLAYERNAME", "Patrick", "#PLAYERMONEY", 100)) (A % jeleket hanyagolnod kell, mivel az egy helyettesítő karakter. Cseréltem őket #-re.)
-
Then try to inscare the load distance. engineSetModelLODDistance(YOUR_MODEL_ID, 300) (I think your model is too big, and if you go far from the center, the object is unloading.)
-
https://wiki.multitheftauto.com/wiki/SetOcclusionsEnabled
-
Oh, you thief... ? It's my signature xd
-
local filename = "yourobjectfilename" -- replace with your model's file name engineImportTXD(engineLoadTXD(filename..".txd"), 1318) engineReplaceModel(engineLoadDFF(filename..".dff"), 1318)
-
Ez egy client oldali script, ott futtatod? És a hatodik sorban van egy hiba, amit észrevettem ránézésre. Sima zárójelet raktál kapcsos helyett. Javítás: setElementData(veh, "lightFlash:color", {0, 0, 255}, false);
-
A videóbán látszik, hogy működik. The video shows how it works.
-
[HUN] Maga az oldal betölt, szóval a script jó. Szerintem az MTA beállításoknál neked le van tiltva a javascript futtatás. [ENG] I think the script is okay, only you ignored the javascript in your mta settings.
- 1 reply
-
- 1
-
-
You can move player with: https://wiki.multitheftauto.com/wiki/SetPedControlState If that's what you mean.
-
I think you can't make difference between bind and command use. (not sure) But you can block function use, when command is binded to any key. -- CLIENT ONLY function useitem(cmd) if not getKeyBoundToCommand(cmd) then outputChatBox("Item used!") else outputChatBox("Unbind this command first!") end end addCommandHandler("useitem", useitem)
-
-- CLIENT SIDE function OpenWin() if getElementData(localPlayer, "Group") == "HellsAngels" then -- elementdata is a shared variable, so you can get it on client side if guiGetVisible ( GUIEditor.window[1] ) then guiSetVisible ( GUIEditor.window[1], false ) showCursor(false) guiSetInputEnabled(false) else guiSetVisible ( GUIEditor.window[1], true ) showCursor(true) guiSetInputEnabled(true) end end end addCommandHandler('grouppanel', OpenWin) -- SERVER SIDE NOT NEED
-
Is it possible to load 2 different types of mods on the same model?
Patrick replied to FlyingSpoon's topic in Scripting
I meant you have to know which model do you want to load for the client. You can store info about it in accountdata or where you want. -- CLIENT SIDE -- Load random model for the client at join local randommodel = math.random(1,2) if randommodel == 1 then -- type 1 engineImportTXD(...) engineReplaceModel(...) elseif randommodel == 2 then -- type 2 engineImportTXD(...) engineReplaceModel(...) end -
Is it possible to load 2 different types of mods on the same model?
Patrick replied to FlyingSpoon's topic in Scripting
Possible. Only run different script for clients.
