-
Posts
1,143 -
Joined
-
Last visited
-
Days Won
42
Everything posted by Patrick
-
-- SERVER SIDE local adminACLGroupNames = {"Tuladjonos", "Fejlesztő", "SzuperAdmin", "FőAdmin", "Admin5", "Admin4", "Admin3", "Admin2", "Admin1"} local function isAdmin(player) local accName = getAccountName(getPlayerAccount(player)) for _, groupName in ipairs(adminACLGroupNames) do if isObjectInACLGroup("user."..accName, aclGetGroup(groupName)) then return groupName end end return false end addCommandHandler("a", function(player, cmd, ...) local adminGroupName = isAdmin(player) if adminGroupName then local text = table.concat({...}, " ") local name = getPlayerName(player) for _, p in ipairs(getElementsByType("player")) do if isAdmin(p) then outputChatBox("[AdminChat]: "..adminGroupName.." "..name..": "..text, p, 255, 255, 255, true) end end end end) Ez egy baromi csúnya kód, nem is teszteltem, de elméletileg nincs benne hiba.
-
I don't fully understand what you want, but maybe you're looking for it. https://wiki.multitheftauto.com/wiki/Call
-
HUNGARIAN A táblázatodban a sorok indexe a player elementje és nem számok, növekvő sorrendben. Ezért ipairs helyett pairs-t kell használnod. Lényegében ezt veheted egy "szabálynak" is, ha saját indexű sorokat használsz, és nem table.insert-el adod hozzá a sorokat a táblázathoz, akkor pairs-t kell használni és jó lesz. ENGLISH Because you use custom indexed array (index is the player's element), you need to use pairs instead of ipairs. for element, value in pairs(Admins) do outputChatBox(getPlayerName(element) .. " is admin!") end
-
What I sent is working, just crouch and aim.
-
Try this. Temporary download link
-
Send the animation, see what I can do.
-
addEventHandler("onMarkerHit", enBANKN, function(element, mdim) if mdim and getElementType(element) == "player" and not getPedOccupiedVehicle(element) then fadeCamera(element, false, 0.5) setTimer(function() fadeCamera(element, true, 0.5) setElementInterior(element, 5, 1504.953, 156.857, 1804.164) setElementDimension(element, 5) end, 600, 1) end end)
-
You can. function playerLogin(player) -- or smth like that (this is your login function) dbquery ... local mysql_result = dbPoll(...) local name_from_mysql = mysql_result[1].name setElementData(player, "name", name_from_mysql) end outputToChat(" " ..(getElementData(source,"name") or "Unknown").. " say: " ..message, v, 255, 100, 200, true) This is not the exact code, just a sketch.
-
When the player logs in, save the 'name' variable to an elementData and use it.
-
Lehetőségek: - mta_item resource nem létezik / nem fut - hasItem funkció nem létezik - hasItem funkció nincs exportálva (metában) - hasItem funkció client oldali, de server oldalról akarod meghívni, vagy fordítva.
-
-- CLIENT SIDE -- Ezt client oldalra másold be valahova addEvent("playAsaySound", true) addEventHandler("playAsaySound", root, function() playSound("valami.mp3") -- ide a fájlod elérsi útvonalát end) -- SERVER SIDE -- Ezzel tudod meghívni server oldalról triggerClientEvent("playAsaySound", resourceRoot) -- SERVER SIDE -- VALAHOGY íGY function globalMessage(thePlayer, cmd, ...) local message = table.concat ( { ... }, " " ) local name = getPlayerName(thePlayer) outputChatBox("#ed1c24[Tulajdonos]#ed1c24 "..name..": #ed1c24"..message, players, 255, 255, 255, true) triggerClientEvent("playAsaySound", resourceRoot) end addCommandHandler("asay", globalMessage)
-
HUNGARIAN Ezt kell használnod hozzá: https://wiki.multitheftauto.com/wiki/DxDrawTextOnElement Találsz példákat is. Egyébként, ha ehhez a fórumhoz írsz, akkor írj angolul is, vagy használd a magyar fórum részleget. Link: https://forum.multitheftauto.com/forum/141-hungarian-magyar/
-
Ja igen, bocsi. Engedélyezni kell a színkódok megjelenítését. outputChatBox sort bővítsd ki így: outputChatBox("#E1DCDC" .. getTimePrefix() .. getPlayerName(source) .. " meghalt!", root, 255, 255, 255, true)
-
-- SERVER SIDE SCRIPT function getTimePrefix() local realtime = getRealTime() return ("[%d-%02d-%02d %02d:%02d:%02d] "):format(realtime.year+1900, realtime.month+1, realtime.monthday, realtime.hour, realtime.minute, realtime.second) end addEventHandler("onPlayerWasted", root, function() outputChatBox("#E1DCDC" .. getTimePrefix() .. getPlayerName(source) .. " meghalt!", root) end)
-
-- SERVER SIDE SCRIPT function getTimePrefix() local realtime = getRealTime() return ("[%d-%02d-%02d %02d:%02d:%02d] "):format(realtime.year+1900, realtime.month+1, realtime.monthday, realtime.hour, realtime.minute, realtime.second) end addEventHandler("onPlayerWasted", root, function() outputChatBox(getTimePrefix() .. getPlayerName(source) .. " meghalt!", root) end)
-
https://wiki.multitheftauto.com/wiki/StartResource https://wiki.multitheftauto.com/wiki/StopResource https://wiki.multitheftauto.com/wiki/GetResourceFromName
-
HUNGARIAN Természetesen, lennie kell valahol egy /kick és egy /ban funkciónak már, ha működnek a parancsok.
-
HUNGARIAN - Elsőnek is. A kód az működik? -> Ha elindítod az infobox resourcet, akkor megjelenik a "!!!!!!!KICK/BAN!!!!!!!!" infó? - Ha nem, akkor több gond is van. - Ha igen, akkor elsőnek is másold be ezt a fájl végére: [createInfoBox("!!!!!!!KICK/BAN!!!!!!!!","info") sorok helyére, lényegében] addEvent("createInfoBox", true) addEventHandler("createInfoBox", root, createInfoBox) Ezután fogod tudni meghívni más resourceokból triggerEvent, vagy triggerClientEvent -el. Ha CLIENT oldalról szeretnéd meghívni, akkor így teheted meg: -- Ezt akkor tudod használni, ha például client oldalon tesz valamit a player és infót akarsz adni neki róla, de természetesen ezt csak ő fogja látni. triggerEvent("createInfoBox", localPlayer, "SZÖVEG", "info") Ha SERVER oldalról szeretnéd meghívni, akkor így teheted meg: -- Ezt akkor tudod használni, ha például server oldalon tesz valamit egy player és MINDENKINEK el akarod küldeni. triggerClientEvent(root, "createInfoBox", root, "SZÖVEG", "info")
-
Az alapján amit leírtál, nem. Gondolom 3ds Max-ot használsz, a kész modelled attachold egybe, helyezd pontosan a 0,0,0 koordinátára és úgy exportáld ki a COL-t. Velem már olyan is volt, hogy a fentebb leírtak alapján csináltam, mégsem volt jó. Egy TUBE nem tetszett az MTA-nak és egy csomó láthatatlan falat csinált, nem tudom miért, nem értek hozzá. Itt egy magyar leírás, hátha segít: https://www.bmatyas.com/education/ Sok sikert.
-
Custom Chat elhelyezése Rendertargetben
Patrick replied to NONAME_1224's topic in Hungarian / Magyar
Szia! Elsőnek is, erre a célra ne használj renderTargetet, mert felesleges és nagyon sok erőforrást használ. Szerintem az a legjobb, ha a sorokat egy táblázatba rakod, a megfelelő sorokat íratod ki egymás alá. (pl. az utolsó tíz sort) Valahogy így: -- CLIENT SIDE CODE -- EZ EGY EGYSZERŰ PÉLDA, CSAK MAGADNAK TUDSZ SZÖVEGET KIíRNI VELE, MÁS NEM FOGJA LÁTNI -- SZERVER OLDALRÓL KELL TRIGGERELNED, HOGY MIT SZERETNÉL KIíRATNI local chat_lines = {} local displayLinesCount = 10 function addLine(text) table.insert(chat_lines, text) end addEventHandler("onClientRender", root, function() local offset = 0 for i, line_text in ipairs(chat_lines) do if i > #chat_lines-displayLinesCount then dxDrawText(line_text, 20, 500 + offset, 20, 500, tocolor(255,255,255,255), 1, "default", "left", "center") offset = offset + 30 end end end) function chatOOC(cmd, ...) local text = table.concat({...}, " ") addLine(text) end addCommandHandler("ooc", chatOOC) bindKey("b", "down", "chatbox", "ooc") Sortörést pedig csak színkódok nélkül használhatsz, de ez OOC chatnél általában nem probléma. -
Tisztában vagy vele, hogy ennek a Fórumnak semmi köze egyetlen szerverhez sem?
-
https://wiki.multitheftauto.com/wiki/SetVehicleNitroActivated -- CLIENT SIDE bindKey("lalt", "both", function(key, keystate) local vehicle = getPedOccupiedVehicle(localPlayer) if vehicle then setVehicleNitroActivated(vehicle, keystate == "down") end end)