Das Tactics Script läuft ohne eine Datenbank. Das musst du alles selbst scripten.
Beiträge von #Xilent*
-
-
Die Sounds sind schon enthalten.
-
-
Tagchen, mich kennst du bereits, bin HazaN. bzw. Wayne_Johnson
Willkommen -
Du solltest dir den Wiki Eintrag von setElementPosition nochmal angucken, denn dann kannst du auch erkennen, dass man da keine Rotationwerte eingeben darf. Der Aufbau ist folgendermaßen: setElementPosition ( auto, x, y, z (,true oder false))
Bei deinem Code ist bei 5. Stelle eine Nummer (0), obwohl da true oder false stehen muss. -
parent: This is the parent that the gui label is attached to. If the relative argument is true, sizes and positioning will be made relative to this parent. If the relative argument is false, positioning will be the number of offset pixels from the parent's origin. If no parent is passed, the parent will become the screen - causing positioning and sizing according to screen positioning.
Sprich, du musst auf deinem Bild ein Label erstellen, damit das Label immer auf deinem Bild bleibt. Dazu musst du deine Werte beim Label relativieren(keine Ahnung, ob das so heißt) und dann von dem false ein true machen und dann noch ein ", lobbyData.Race" hinten anhängen.
-
Lua
local state if getVehicleEngineState ( veh ) == true then state = "An" else state = "Aus" end dxDrawBorderedText("Motorstatus: "..state, 0, 0, 230 * resolutionFactor, 40 * resolutionFactor, clr, 2 * resolutionFactor, "default", "right", "bottom", true)
Versuchs so, habs mit dem Handy geschrieben -
Bist du dir sicher, dass du das Script clientseitig eingetragen hast? Denn der Fehler deutet darauf hin, dass guiCreateWindow nicht existiert, wäre ja auch logisch, wenn du es serverseitig eingetragen hättest.
-
Guten Abend, ich habe folgendes Problem
Ich wollte jeden Spieler in sein jeweiliges Team setzen. Nur leider werden nur die Teams gezeichnet, aber der Spieler wird nicht gezeichnet und auch nicht in das Team gesetzt.Lua
Alles anzeigenlocal scdatas = {} scdatas.bcolor = tocolor(255,255,255,150) scdatas.x, scdatas.y = guiGetScreenSize() scdatas.width = 800 scdatas.alignx, scdatas.aligny = "left","top" scdatas.set1,scdatas.set2,scdatas.set3 = false,false,true scdatas.colorcoded = true scdatas.textscale = 0.8 scdatas.textfont = "default-bold" scdatas.textfontheight = dxGetFontHeight(scdatas.textscale,scdatas.textfont) scdatas.textfontcalc = scdatas.textfontheight + 2 scdatas.titlefont = "default-bold" scdatas.titlestats = "Name Kills Deaths Money Ping" scdatas.titlefontheight = dxGetFontHeight(10,scdatas.titlefont)--state statt money <----------------------------------------------------------------------------------------------------- scdatas.titlefontcalc = scdatas.titlefontheight + 2 scdatas.titlecolor = {} scdatas.titlecolor = tocolor(0,0,0,255) scdatas.titlecolorfont = tocolor(255,255,255,255) scdatas.titlebgheight = 25 scdatas.titleplayertextwidth = scdatas.x/2+270 scdatas.headcolor = tocolor(0,0,0,200) scdatas.headtitlecolor = tocolor(255,255,255,255) scdatas.playercolor = tocolor(255,255,255,255) scdatas.playerfont = "default-bold" scdatas.id = 0 scdatas.playerbgheight = 548 scdatas.playerbgcolor = tocolor(0,0,0,200) local playerTeam = getPlayerTeam ( localPlayer ) scdatas.enabled = false scdatas.players = { team1 = {}, team2 = {}, team3 = {} } bindKey("tab","down",function() for id, pl in ipairs(getElementsByType("player")) do if getPlayerTeam( pl ) then addEventHandler("onClientRender",root,drawScoreboard) scdatas.enabled = true end end end) bindKey("tab","up",function() if scdatas.enabled == true then -- scdatas.enabled = false removeEventHandler("onClientRender",root,drawScoreboard) end end) function drawScoreboard() scdatas.height = scdatas.y/2 - (#getElementsByType("player")) scdatas.titletext = "Testserver "..#getElementsByType("player").."/30" dxDrawRectangle(scdatas.x/2 - scdatas.width/2, scdatas.y/2 - scdatas.height/2.2, scdatas.width, 25, tocolor(0,0,0,255)) dxDrawText(scdatas.titletext,scdatas.x/2-scdatas.width/2 + 10, scdatas.y/2 - scdatas.height/2 + 10, scdatas.x, scdatas.y, tocolor(255,255,255,255), 1, "default-bold", "left", "top", false, false, true, true) dxDrawText(scdatas.titlestats,scdatas.x/2-scdatas.width/2 + 10, scdatas.y/1.99 - scdatas.height/2 + 25, scdatas.x, scdatas.y, tocolor(255,255,255,255), 1, "default-bold", "left", "top", false, false, true, true) for id, pl in ipairs(getElementsByType("player")) do scdatas.name = getPlayerName(pl) scdatas.kills = "-" scdatas.deaths = "-" scdatas.money = "-" scdatas.ping = getPlayerPing(pl) local playerTeam = getPlayerTeam ( localPlayer ) if getElementData(pl,"login") == true then scdatas.kills = tonumber(getElementData(pl,"kills")) scdatas.deaths = tonumber(getElementData(pl,"deaths")) scdatas.money = getPlayerMoney().."$" end if playerTeam == "Team 1" then table.insert(scdatas.players.team1, { name = scdatas.name, kills = scdatas.kills, deaths = scdatas.deaths, money = scdatas.money, ping = scdatas.ping } ) table.sort(scdatas.players.team1) elseif playerTeam == "Team 2" then table.insert(scdatas.players.team2, { name = scdatas.name, kills = scdatas.kills, deaths = scdatas.deaths, money = scdatas.money, ping = scdatas.ping } ) table.sort(scdatas.players.team1) elseif playerTeam == "Team 3" then table.insert(scdatas.players.team2, { name = scdatas.name, kills = scdatas.kills, deaths = scdatas.deaths, money = scdatas.money, ping = scdatas.ping } ) table.sort(scdatas.players.team1) end scdatas.rowid = 0 scdatas.rowid = scdatas.rowid + 1 for id, team1 in ipairs(scdatas.players.team1) do dxDrawText(scdatas.name, scdatas.x/2 - scdatas.width/2 + 10, scdatas.y/2 - scdatas.height/2 + 30 + ( 20 * scdatas.rowid) + 1, scdatas.x, scdatas.y, tocolor(255,255,255,255), 1, "default-bold", "left", "top", false, false, true, true) dxDrawText(scdatas.kills, scdatas.x/2 - scdatas.width/2 + 332, scdatas.y/2 - scdatas.height/2 + 30 + ( 20 * scdatas.rowid)+ 1, scdatas.x, scdatas.y, tocolor(255,255,255,255), 1, "default-bold", "left", "top", false, false, true, true) dxDrawText(scdatas.deaths, scdatas.x/2 - scdatas.width/2 + 489, scdatas.y/2 - scdatas.height/2 + 30 + ( 20 * scdatas.rowid)+1, scdatas.x, scdatas.y, tocolor(255,255,255,255), 1, "default-bold", "left", "top", false, false, true, true) dxDrawText(scdatas.money, scdatas.x/2 - scdatas.width/2 + 606, scdatas.y/2 - scdatas.height/2 + 30 + ( 20 * scdatas.rowid)+ 1, scdatas.x, scdatas.y, tocolor(255,255,255,255), 1, "default-bold", "left", "top", false, false, true, true) -- dxDrawText(scdatas.country, scdatas.x/2 - scdatas.width/2 + 640, scdatas.y/2 - scdatas.height/2 + 30 + ( 20 * scdatas.rowid)+ 1, scdatas.x, scdatas.y, tocolor(255,255,255,255), 1, "default-bold", "left", "top", false, false, true, true) dxDrawText(scdatas.ping, scdatas.x/2 - scdatas.width/2 + 770, scdatas.y/2 - scdatas.height/2 + 30 + ( 20* scdatas.rowid)+ 1, scdatas.x, scdatas.y, tocolor(255,255,255,255), 1, "default-bold", "left", "top", false, false, true, true) dxDrawRectangle(scdatas.x/2 - scdatas.width/2, scdatas.y/2 - scdatas.height/2 + 30 + ( 20 * scdatas.rowid), scdatas.width, dxGetFontHeight(1,"default-bold")+2, tocolor(0,0,0,150)) scdatas.rowid = scdatas.rowid + 1 end dxDrawText("Team 1", scdatas.x/2 - scdatas.width/2 + 10, scdatas.y/2 - scdatas.height/2 + 30 + ( 20 * scdatas.rowid) - 3, scdatas.x, scdatas.y, tocolor(0,238,0,255), 1, "default-bold", "left", "top", false, false, true, true) dxDrawRectangle(scdatas.x/2 - scdatas.width/2, scdatas.y/2 - scdatas.height/2 + 30 + ( 20 * scdatas.rowid)- 3, scdatas.width, dxGetFontHeight(1,"default-bold")+2, tocolor(0,0,0,150)) scdatas.rowid = scdatas.rowid + 1 for id, team2 in ipairs(scdatas.players.team2) do dxDrawText(scdatas.name, scdatas.x/2 - scdatas.width/2 + 10, scdatas.y/2 - scdatas.height/2 + 30 + ( 20 * scdatas.rowid) + 1, scdatas.x, scdatas.y, tocolor(255,255,255,255), 1, "default-bold", "left", "top", false, false, true, true) dxDrawText(scdatas.kills, scdatas.x/2 - scdatas.width/2 + 332, scdatas.y/2 - scdatas.height/2 + 30 + ( 20 * scdatas.rowid)+ 1, scdatas.x, scdatas.y, tocolor(255,255,255,255), 1, "default-bold", "left", "top", false, false, true, true) dxDrawText(scdatas.deaths, scdatas.x/2 - scdatas.width/2 + 489, scdatas.y/2 - scdatas.height/2 + 30 + ( 20 * scdatas.rowid)+1, scdatas.x, scdatas.y, tocolor(255,255,255,255), 1, "default-bold", "left", "top", false, false, true, true) dxDrawText(scdatas.money, scdatas.x/2 - scdatas.width/2 + 606, scdatas.y/2 - scdatas.height/2 + 30 + ( 20 * scdatas.rowid)+ 1, scdatas.x, scdatas.y, tocolor(255,255,255,255), 1, "default-bold", "left", "top", false, false, true, true) -- dxDrawText(scdatas.country, scdatas.x/2 - scdatas.width/2 + 640, scdatas.y/2 - scdatas.height/2 + 30 + ( 20 * scdatas.rowid)+ 1, scdatas.x, scdatas.y, tocolor(255,255,255,255), 1, "default-bold", "left", "top", false, false, true, true) dxDrawText(scdatas.ping, scdatas.x/2 - scdatas.width/2 + 770, scdatas.y/2 - scdatas.height/2 + 30 + ( 20* scdatas.rowid)+ 1, scdatas.x, scdatas.y, tocolor(255,255,255,255), 1, "default-bold", "left", "top", false, false, true, true) dxDrawRectangle(scdatas.x/2 - scdatas.width/2, scdatas.y/2 - scdatas.height/2 + 30 + ( 20 * scdatas.rowid), scdatas.width, dxGetFontHeight(1,"default-bold")+2, tocolor(0,0,0,150)) scdatas.rowid = scdatas.rowid + 1 end dxDrawText("Team 2", scdatas.x/2 - scdatas.width/2 + 10, scdatas.y/2 - scdatas.height/2 + 30 + ( 20 * scdatas.rowid) - 6, scdatas.x, scdatas.y, tocolor(255,140,0,255), 1, "default-bold", "left", "top", false, false, true, true) dxDrawRectangle(scdatas.x/2 - scdatas.width/2, scdatas.y/2 - scdatas.height/2 + 30 + ( 20 * scdatas.rowid)- 6, scdatas.width, dxGetFontHeight(1,"default-bold")+2, tocolor(0,0,0,150)) scdatas.rowid = scdatas.rowid + 1 for id, team3 in ipairs(scdatas.players.team3) do dxDrawText(scdatas.name, scdatas.x/2 - scdatas.width/2 + 10, scdatas.y/2 - scdatas.height/2 + 30 + ( 20 * scdatas.rowid) + 1, scdatas.x, scdatas.y, tocolor(255,255,255,255), 1, "default-bold", "left", "top", false, false, true, true) dxDrawText(scdatas.kills, scdatas.x/2 - scdatas.width/2 + 332, scdatas.y/2 - scdatas.height/2 + 30 + ( 20 * scdatas.rowid)+ 1, scdatas.x, scdatas.y, tocolor(255,255,255,255), 1, "default-bold", "left", "top", false, false, true, true) dxDrawText(scdatas.deaths, scdatas.x/2 - scdatas.width/2 + 489, scdatas.y/2 - scdatas.height/2 + 30 + ( 20 * scdatas.rowid)+1, scdatas.x, scdatas.y, tocolor(255,255,255,255), 1, "default-bold", "left", "top", false, false, true, true) dxDrawText(scdatas.money, scdatas.x/2 - scdatas.width/2 + 606, scdatas.y/2 - scdatas.height/2 + 30 + ( 20 * scdatas.rowid)+ 1, scdatas.x, scdatas.y, tocolor(255,255,255,255), 1, "default-bold", "left", "top", false, false, true, true) -- dxDrawText(scdatas.country, scdatas.x/2 - scdatas.width/2 + 640, scdatas.y/2 - scdatas.height/2 + 30 + ( 20 * scdatas.rowid)+ 1, scdatas.x, scdatas.y, tocolor(255,255,255,255), 1, "default-bold", "left", "top", false, false, true, true) dxDrawText(scdatas.ping, scdatas.x/2 - scdatas.width/2 + 770, scdatas.y/2 - scdatas.height/2 + 30 + ( 20* scdatas.rowid)+ 1, scdatas.x, scdatas.y, tocolor(255,255,255,255), 1, "default-bold", "left", "top", false, false, true, true) dxDrawRectangle(scdatas.x/2 - scdatas.width/2, scdatas.y/2 - scdatas.height/2 + 30 + ( 20 * scdatas.rowid), scdatas.width, dxGetFontHeight(1,"default-bold")+2, tocolor(0,0,0,150)) scdatas.rowid = scdatas.rowid + 1 end dxDrawText("Team 3", scdatas.x/2 - scdatas.width/2 + 10, scdatas.y/2 - scdatas.height/2 + 30 + ( 20 * scdatas.rowid) - 9, scdatas.x, scdatas.y, tocolor(255,255,255,255), 1, "default-bold", "left", "top", false, false, true, true) dxDrawRectangle(scdatas.x/2 - scdatas.width/2, scdatas.y/2 - scdatas.height/2 + 30 + ( 20 * scdatas.rowid)- 9, scdatas.width, dxGetFontHeight(1,"default-bold")+2, tocolor(0,0,0,150)) scdatas.rowid = scdatas.rowid + 1 end end
Wie man sieht, wurde es mit Tables gemacht.
Im Debugscript werden keine Errors... angezeigt.MFG
-
Ich kann auf eure Seite nicht mehr zugreifen: Diese Website ist nicht verfügbar.
-
Diesen Fehler habe ich auch sehr oft, ich werde mal probieren, wie sbx320 gesagt hat, auf Strg zu drücken. Mal gucken, ob es dann funktioniert.
-
Willkommen, kenne dich von GTS und Vatos Locos
Bin Wayne_Johnson / HazaN. -
So mein ich das nicht. Wenn man in der meta die Clientseitigen Scripts nicht cachen lässt, sind sie natürlich trotzdem im Arbeitsspeicher, solange du auf dem Server bist. Erfahrene Nutzer können sich den ganzen Spaß aus dem RAM auslesen.
Das sind aber dann meistens die Leute, die einfach keine anderen Hobbys haben. Außerdem sind es wenige, die das auch können. Du könntest es auch natürlich hier compilen http://luac.mtasa.com/
und dann trotzdem in der meta eintragen, dass das Script nicht gecached wird.MFG
-
Die beste und sicherste Methode ist es, in der meta.xml einzutragen, dass das Script nicht im Cache gespeichert werden soll.
-
Du musst diesen Code
Luafunction math.round(number, decimals, method) decimals = decimals or 0 local factor = 10 ^ decimals if (method == "ceil" or method == "floor") then return math[method](number * factor) / factor else return tonumber(("%."..decimals.."f"):format(number)) end end
über deinen HUD-Code einfügen. Dann noch:LuadxDrawText(""..math.round(health, 0, "ceil").."%", 1166, 24, 1356, 50, tocolor(255, 255, 255, 255), 1.00, "pricedown", "center", "center", false, false, true, false, false)
MFG
-
Da ist nichts definiert!
https://wiki.multitheftauto.com/wiki/DestroyElement
https://wiki.multitheftauto.com/wiki/DestroyElement
https://wiki.multitheftauto.com/wiki/DestroyElement
https://wiki.multitheftauto.com/wiki/DestroyElement
https://wiki.multitheftauto.com/wiki/DestroyElement
https://wiki.multitheftauto.com/wiki/DestroyElement
https://wiki.multitheftauto.com/wiki/DestroyElement
https://wiki.multitheftauto.com/wiki/DestroyElement
https://wiki.multitheftauto.com/wiki/DestroyElement
https://wiki.multitheftauto.com/wiki/DestroyElement -
-
Sehr gute Arbeit und sehr guter Mapper! Ich würde gerne mal wissen, wie lange du an so einer Map sitzt.
MfG
-
Meines Wissens nach sollte es gehen. Versuchs einfach mal, wenns nicht geht, melde dich.
-
Einfach nach der if-Abfrage Funktion2()