-
Posts
28 -
Joined
-
Last visited
-
Days Won
2
Everything posted by P[ow]er
-
GUIEditor = { checkbox = {}, label = {}, timer = nil } local f1State = false local guiVisible = false local deathmatchDisabled = false addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.label[1] = guiCreateLabel(341, 118, 130, 14, "Disable deathmatch", false) GUIEditor.checkbox[1] = guiCreateCheckBox(325, 117, 17, 17, "", false, false) guiSetVisible(GUIEditor.label[1], false) guiSetVisible(GUIEditor.checkbox[1], false) addEventHandler("onClientGUIClick", GUIEditor.checkbox[1], checkBox, false) end ) function checkBox() deathmatchDisabled = guiCheckBoxGetSelected(GUIEditor.checkbox[1]) local vehicle = getPedOccupiedVehicle(localPlayer) if vehicle and getVehicleController(vehicle) == localPlayer then local model = getElementModel(vehicle) if model == 520 or model == 425 or model == 432 or model == 476 then toggleControl("vehicle_fire", not deathmatchDisabled) end end end addEventHandler("onClientVehicleEnter", root, function(thePed, seat) if thePed == localPlayer and seat == 0 then local model = getElementModel(source) if model == 520 or model == 425 or model == 432 or model == 476 then toggleControl("vehicle_fire", not deathmatchDisabled) end end end) addEventHandler("onClientVehicleExit", root, function(thePed, seat) if thePed == localPlayer and seat == 0 then toggleControl("vehicle_fire", true) end end)
-
function onClientResourceStart() map = Map.new():init() map:setBounds(x*30, y*30, x*1306, y*708) map:setAlpha(200) radar = Map.new():init() radar:setBounds(x*20, y*560, x*281, y*193) radar:setStyle(2) radar:setAlpha(200) radar:setBlipSize(x*24) radar:setVisible(true) -- Variables to track mouse movement mouseDown = false lastX, lastY = 0, 0 map.Switch = function() local wasVisible = map:isVisible() map:setVisible(not wasVisible) radar:setVisible(not wasVisible) showChat(not wasVisible) -- Only show cursor and bind keys when map is visible if not wasVisible then showCursor(true) addEventHandler("onClientCursorMove", root, handleMouseMovement) addEventHandler("onClientMouseWheel", root, handleMouseWheel) addEventHandler("onClientClick", root, handleMouseClick) bindKey("mouse_wheel_up", "down", function() zoomMap("in") end) bindKey("mouse_wheel_down", "down", function() zoomMap("out") end) else showCursor(false) removeEventHandler("onClientCursorMove", root, handleMouseMovement) removeEventHandler("onClientMouseWheel", root, handleMouseWheel) removeEventHandler("onClientClick", root, handleMouseClick) unbindKey("mouse_wheel_up", "down") unbindKey("mouse_wheel_down", "down") end end bindKey('F11', 'down', map.Switch) setPlayerHudComponentVisible("radar", false) toggleControl("radar", false) end -- Function to handle mouse clicks for dragging function handleMouseClick(button, state) if map:isVisible() and button == "left" then if state == "down" then mouseDown = true local x, y = getCursorPosition() lastX, lastY = x, y else mouseDown = false end end end -- Function to handle mouse movement for dragging the map function handleMouseMovement(_, _, x, y) if map:isVisible() and mouseDown then local currentX, currentY = x, y local deltaX, deltaY = currentX - lastX, currentY - lastY -- Move map based on mouse movement local mapX, mapY, mapW, mapH = map:getBounds() -- Adjust movement sensitivity as needed local moveSpeed = 1.5 map:setBounds(mapX - deltaX * moveSpeed, mapY - deltaY * moveSpeed, mapW, mapH) lastX, lastY = currentX, currentY end end -- Function to handle mouse wheel for zooming function handleMouseWheel(direction) if map:isVisible() then zoomMap(direction > 0 and "in" or "out") end end -- Centralized zoom function function zoomMap(direction) if not map:isVisible() then return end local x, y, width, height = map:getBounds() local zoomFactor = 0.1 -- Adjust for faster/slower zooming if direction == "in" then -- Zoom in: decrease size, adjust position to zoom toward center local newWidth = width * (1 - zoomFactor) local newHeight = height * (1 - zoomFactor) local newX = x + (width - newWidth) / 2 local newY = y + (height - newHeight) / 2 map:setBounds(newX, newY, newWidth, newHeight) else -- Zoom out: increase size, adjust position to zoom from center local newWidth = width * (1 + zoomFactor) local newHeight = height * (1 + zoomFactor) local newX = x - (newWidth - width) / 2 local newY = y - (newHeight - height) / 2 map:setBounds(newX, newY, newWidth, newHeight) end end addEventHandler("onClientResourceStart", resourceRoot, onClientResourceStart) function onClientResourceStop() setPlayerHudComponentVisible("radar", true) toggleControl("radar", true) -- Clean up any remaining event handlers if map:isVisible() then removeEventHandler("onClientCursorMove", root, handleMouseMovement) removeEventHandler("onClientMouseWheel", root, handleMouseWheel) removeEventHandler("onClientClick", root, handleMouseClick) end end addEventHandler("onClientResourceStop", resourceRoot, onClientResourceStop)
-
local minFOV, defaultFOV, maxFOV = 50, 70, 120 local currentFOV = defaultFOV addEventHandler('onClientKey', root, function(button, press) if press and getControlState("aim_weapon") then local change = (button == 'mouse_wheel_up' and 5) or (button == 'mouse_wheel_down' and -5) or 0 if change ~= 0 then currentFOV = math.clamp(currentFOV + change, minFOV, maxFOV) end end end) addEventHandler("onClientRender", root, function() setCameraFieldOfView("player", currentFOV) end)
-
local sx, sy = guiGetScreenSize() local sw, sh = sx / 1680, sy / 1050 local panelVisible = false loadstring(exports.dxlibrary:dxGetLibrary())() -- Carregar a fonte Inter-Medium.ttf local fontLoaded = dxCreateFont('assets/fonts/Inter-Medium.ttf', 12, true) if not fontLoaded then outputDebugString("Falha ao carregar a fonte Inter-Medium.ttf") else outputDebugString("Fonte Inter-Medium.ttf carregada com sucesso") end function showPanel() outputDebugString("showPanel() chamado") if not panelVisible then dxEditor = {} dxEditor['dxWindow'] = {} dxEditor['dxGridList'] = {} dxEditor['dxEdit'] = {} dxEditor['dxButton'] = {} dxEditor['dxLabel'] = {} dxEditor['dxWindow'][1] = dxWindow(136 * sw, 271 * sh, 584 * sw, 256 * sh, 'Painel de Vendas', false, 7, nil, -15856105, -1, -15856105) dxEditor['dxGridList'][1] = dxGridList(160 * sw, 315 * sh, 154 * sw, 179 * sh, dxEditor['dxWindow'][1], -15461346, -1, -12177770, -14474451, nil, nil, nil) dxEditor['dxEdit'][1] = dxEdit(361 * sw, 346 * sh, 323 * sw, 24 * sh, '', dxEditor['dxWindow'][1], false, -1, nil, -13426320, -12177770) dxEditor['dxEdit'][2] = dxEdit(396 * sw, 421 * sh, 96 * sw, 24 * sh, '', dxEditor['dxWindow'][1], false, -1, nil, -13426320, -12177770) dxEditor['dxButton'][1] = dxButton(438 * sw, 475 * sh, 76 * sw, 25 * sh, 'ENVIAR', dxEditor['dxWindow'][1], 2, -12177770, -1, -12506991) dxEditor['dxButton'][2] = dxButton(539 * sw, 475 * sh, 76 * sw, 25 * sh, 'FECHAR', dxEditor['dxWindow'][1], 2, -12177770, -1, -12506991) -- Alterar a fonte dos labels para Inter-Medium dxEditor['dxLabel'][1] = dxLabel(488 * sw, 323 * sh, 78 * sw, 20 * sh, 'DESCRIÇÃO', dxEditor['dxWindow'][1], 'center', 'top', nil, -1, -1, nil) if fontLoaded then dxSetFont(dxEditor['dxLabel'][1], fontLoaded) end dxEditor['dxLabel'][2] = dxLabel(421 * sw, 397 * sh, 47 * sw, 20 * sh, 'VALOR', dxEditor['dxWindow'][1], 'center', 'top', nil, -1, -1, nil) if fontLoaded then dxSetFont(dxEditor['dxLabel'][2], fontLoaded) end dxEditor['dxLabel'][3] = dxLabel(576 * sw, 397 * sh, 67 * sw, 20 * sh, 'CONTATO', dxEditor['dxWindow'][1], 'center', 'top', nil, -1, -1, nil) if fontLoaded then dxSetFont(dxEditor['dxLabel'][3], fontLoaded) end dxEditor['dxEdit'][3] = dxEdit(560 * sw, 421 * sh, 96 * sw, 24 * sh, '', dxEditor['dxWindow'][1], false, -1, nil, -13426320, -12177770) dxEditor['dxLabel'][4] = dxLabel(201 * sw, 314 * sh, 78 * sw, 20 * sh, 'categorias', dxEditor['dxWindow'][1], 'center', 'top', nil, -1, -1, nil) if fontLoaded then dxSetFont(dxEditor['dxLabel'][4], fontLoaded) end panelVisible = true showCursor(true) end end function hidePanel() if panelVisible then -- Fechar todos os elementos do painel aqui -- Exemplo: destroyElement(dxEditor['dxWindow'][1]) panelVisible = false showCursor(false) end end function onPlayerCommand(cmd) outputDebugString("Comando recebido: " .. cmd) if cmd == "anunciar" then showPanel() end end addCommandHandler("anunciar", onPlayerCommand)
-
Object Preview - Showing Player Skin and vehicle
P[ow]er replied to DeletedAccount1111's topic in Scripting
local scx, scy = guiGetScreenSize() local myObject, myElement, guiWindow = nil, nil, nil local myRotation = {180, 180, 0} function showPlayerSkin() local x1, y1, z1 = getCameraMatrix() myElement = createPed(getElementModel(getLocalPlayer()), x1, y1, z1) myObject = exports.object_preview:createObjectPreview(myElement, 0, 0, 0, 1, 1, 1, 1, true, true, false) guiWindow = guiCreateWindow((scx / 2) - 100, (scy / 2) - 100, 200, 200, "Test area", false, false) guiSetAlpha(guiWindow, 0.05) end function updatePlayerSkin() if isElement(myElement) then destroyElement(myElement) end local x1, y1, z1 = getCameraMatrix() myElement = createPed(getElementModel(getLocalPlayer()), x1, y1, z1) exports.object_preview:setObjectElement(myObject, myElement) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), showPlayerSkin) addEventHandler("onClientElementModelChange", root, function(changedElement) if changedElement == getLocalPlayer() then updatePlayerSkin() end end) addEventHandler("onClientVehicleEnter", root, function(vehicle, seat) if source == getLocalPlayer() and seat == 0 then if isElement(myElement) then destroyElement(myElement) end local x1, y1, z1 = getCameraMatrix() myElement = createVehicle(getElementModel(vehicle), x1, y1, z1) exports.object_preview:setObjectElement(myObject, myElement) end end) addEventHandler("onClientVehicleExit", root, function(vehicle, seat) if source == getLocalPlayer() and seat == 0 then updatePlayerSkin() end end) addEventHandler("onClientPreRender", root, function() if not myElement or not myObject then return end local projPosX, projPosY = guiGetPosition(guiWindow, true) local projSizeX, projSizeY = guiGetSize(guiWindow, true) exports.object_preview:setRotation(myObject, myRotation[1], myRotation[2], myRotation[3]) exports.object_preview:setProjection(myObject, projPosX, projPosY, projSizeX, projSizeY, true, true) end, true, "high") addEventHandler("onClientResourceStop", getResourceRootElement(getThisResource()), function() exports.object_preview:destroyObjectPreview(myObject) end) -
function ItemMove() for i, slot in ipairs(slots) do if isMouseInPosition(sx * slot[1], sy * slot[2], sx * slot[3], sy * slot[4]) then slots[DragNDrop[2]][5], slot[5] = slot[5], slots[DragNDrop[2]][5] local itemId = slots[DragNDrop[2]][5][1] if itemId and slots[DragNDrop[2]][5][2] > items[itemId][3] then print("Stack overflow in slot", DragNDrop[2]) end DragNDrop = nil return end end slots[DragNDrop[2]][5] = DragNDrop[1] DragNDrop = nil end ddEventHandler("onClientClick", root, function(Button, State) if IsInvShow then for i, slot in ipairs(slots) do if isMouseInPosition(sx * slot[1], sy * slot[2], sx * slot[3], sy * slot[4]) then if Button == "right" and State == "down" and slot[5][1] then ClickOnItem(slot[5], i) return elseif Button == "left" then if not slot[5][1] then if State == "down" then WindowMove = {getCursorPosition() - InvPos[1], getCursorPosition() - InvPos[2]} else WindowMove = {false, false} end else if State == "down" then DragNDrop = {slot[5], i} slot[5] = {false} elseif DragNDrop then ItemMove() end end end return end end end end)
-
function sendTurfPayout() local playerJobs = {} -- getting all police for i, player in ipairs(getElementsByType('player')) do local job = exports.NGJobs:getPlayerJob(player) if (job == 'Police Officer') then if (playerJobs[player] == nil) then playerJobs[player] = 0 end playerJobs[player] = playerJobs[player] + 1 end end -- pay the players for player, count in pairs(playerJobs) do local cash = count * tonumber(get("*PAYOUT_CASH")) givePlayerMoney(player, cash) exports.NGMessages:sendClientMessage("Police: Here is $" .. tostring(cash) .. " payout.", player, 0, 255, 0) end end -- set the timer local payoutTimeStr = get("*PAYOUT_TIME") if payoutTimeStr ~= false and type(payoutTimeStr) == "string" then local payoutTimeInt= tonumber(payoutTimeStr) if type(payoutTimeInt) == "number" and payoutTimeInt > 0 then setTimer(sendTurfPayout,payoutInt*60*1000,0) else outputDebugString("Warning! Invalid *PAYOUT_TIME set in meta file",2); end else outputDebugString("warning No *PAYOUT_TIME parameter foundin meta file",2); end try this please
-
function onPlayerLogin() local playerID = getPlayerID(source) local currentDate = getDateString() -- get the current date in string format -- save the login information to the database dbExec("INSERT INTO player_logins (player_id, last_login_date) VALUES (?, ?)", playerID, currentDate) end function onCommandLastLogin(player, cmd, targetPlayerID) if not targetPlayerID then outputChatBox("Usage: /lastlogin <playerID>") return end -- retrieve the last login date from the database local result = dbQuery("SELECT last_login_date FROM player_logins WHERE player_id=?", targetPlayerID) local row = dbPoll(result, -1)[1] if not row then outputChatBox("Player not found or has not logged in before.") else local lastLoginDate = row.last_login_date outputChatBox("Player "..targetPlayerID.." last logged in on "..lastLoginDate) end end
-
function onVehicleStartEnter(player, seat, jacked) local vehicle = getPedOccupiedVehicle(player) if vehicle and getElementModel(vehicle) == 480 then cancelEvent() outputChatBox("You cannot enter this vehicle.") end end addEventHandler("onVehicleStartEnter", getRootElement(), onVehicleStartEnter)
-
local func_str = "function(player) return getPlayerName(player) == owner end" local loadstringed = loadstring("local owner = 'owner'; return function(player) "..func_str.." end") local myFunc = loadstringed() -- Call the function with a parameter local testPlayer = getPlayerFromName("player1") local result = myFunc(testPlayer) print(result) -- true --- local func_str = "function(player) return getPlayerName(player) == 'owner' end" local loadstringed = loadstring("return "..func_str) local success, myFunc = pcall(loadstringed) -- Call the function with a parameter local testPlayer = getPlayerFromName("player1") local success2, isOwner = pcall(myFunc, testPlayer) print(success2, isOwner) -- true false
-
handler help creating a shift drift script.
P[ow]er replied to weverton gabriel's topic in Scripting
Here is an example of how you could achieve this: Detecting the shift key press: function onClientKey ( button, press ) if ( button == "lshift" and press ) then -- Change the car handling end end addEventHandler ( "onClientKey", root, onClientKey ) Changing the car handling: function changeHandling () local handlingTable = getVehicleHandling ( getPedOccupiedVehicle ( localPlayer ) ) -- Modify the handling table to make the car more suitable for drifting setVehicleHandling ( getPedOccupiedVehicle ( localPlayer ), handlingTable ) end You would need to modify the changeHandling function to adjust the handling table to make the car more suitable for drifting. You could increase the car's rear-wheel grip, reduce its weight, or increase its acceleration, for example. You can find more information on MTA scripting in the official MTA wiki: https://wiki.multitheftauto.com/ -
function sendTurfPayout() local playerJobs = {} for i, policeOfficer in ipairs(getElementsByType('player')) do local jobName = exports.NGJobs:getPlayerJob(policeOfficer) if jobName == 'Police Officer' then local jobLevel = exports.NGJobs:getPlayerJobLevel(policeOfficer, jobName) if jobLevel and jobLevel > 0 then local payout = jobLevel * tonumber(get('*PAYOUT_CASH')) givePlayerMoney(policeOfficer, payout) exports.NGMessages:sendClientMessage(policeOfficer, 'Police: Here is $'..payout..' payout', 0, 255, 0) end end end end setTimer(sendTurfPayout, (60 * tonumber(get('*PAYOUT_TIME'))) * 1000, 0) Try it and say if it works please
-
how can i upload files from my own website to my ftp server ? now ?
-
hey i have a question how can i uploads maps site to my server's ftp but site isnt server's site sorry for my english...
-
Admin panelin sağ alt tarafında anonymous diye bir tik işareti vardır ona tik atarsan banladığın, kick veya mute attığın kişilerin kimin tarafından atıldığını kimse göremez
-
Merhaba arkadaşlar DM oynayanlarınız varsa 2009-2014 arası çığır açan bir dm serveri olduğunu bi çoğunuz bilirsiniz gta.ru nun 2014 ten sonra server büyük düşüşe uğradı dm serveri komple bana devredildi adminler ayrıldı tek ben kaldım Sağlam olmasada gerçek anlamda kodlama yapabilen bir scripter ve server içerisinde yönetecek bir admin arıyorum ilgilenecek varsa Bana bu numaralardan ulaşabilirsiniz Aramak için +90 530 120-95-99 Whatsapp için +7 978 267-63-41 Konuşturkan sonra tecrübeliyse ve beğenirsem alacam
-
Scriptin o kısmını yansıtırsan yardımcı olabilirim
-
but i dont know how to fix it...
-
lol dude my spectator like this i need this script
-
no one can help ??? PLEASE
-
hi i have a question when a player watching me i see who is whatching me but when i watch other player he is too see know who watch himself but i cant see who watching him and nothing in debug anyone can help me ? this is race_client.lua setTimer( function() --Specs local snr = 0 for k, v in ipairs(getElementsByType("player")) do local label = getPlayerNametagText(v) if getElementData(v, 'spectates') == getLocalPlayer() then snr = snr + 1 if posLabel[label] ~= nil then setElementData(posLabel[label], "spectated", true) setElementData(playerLabel[label], "spectated", true) end else if posLabel[label] ~= nil then setElementData(posLabel[label], "spectated", false) setElementData(playerLabel[label], "spectated", false) end end end end ,50,0) and this rankingboard_client.lua addEventHandler("onClientRender", getRootElement(), function() for id, elem in pairs(playerLabel) do if guiGetVisible(elem) and string.len(guiGetText(elem)) > 4 then local x,y = guiGetPosition(elem, false) local a = guiGetAlpha(elem) * 255 if not getKeyState("tab") then dxDrawColoredLabel(string.gsub(guiGetText(elem)," ", " ",1), 65,y,200,y+17, tocolor(255,255,255,a),{255,255,255,a},1, font, "left", "center", false,false,false) if getElementData(playerLabel[id], "spectated") ~= nil then if getElementData(playerLabel[id], "spectated") then dxDrawImage(17,y,16,16,"img/eye.png", 0,0,0,tocolor(255,255,255,255), false) end end end if x < 100 then guiSetPosition(elem, sx+100,y,false) end end end for id, elem in pairs(posLabel) do if guiGetVisible(elem) and string.len(guiGetText(elem)) <= 4 then local x,y = guiGetPosition(elem, false ) local a = guiGetAlpha(elem) * 255 if not getKeyState("tab") then if getElementData(posLabel[id],"spectated") == true then dxDrawText(guiGetText(elem), 1,y+1,56,y+18, tocolor(0,0,0,math.floor(a*0.8)), 1, font, "right", "center", false,false,false) dxDrawText(guiGetText(elem), 0,y,55,y+17, tocolor(127,255,212,a), 1, font, "right", "center", false,false,false) else dxDrawText(guiGetText(elem), 1,y+1,56,y+18, tocolor(0,0,0,math.floor(a*0.8)), 1, font, "right", "center", false,false,false) dxDrawText(guiGetText(elem), 0,y,55,y+17, tocolor(255,255,255,a), 1, font, "right", "center", false,false,false) end end if x < 100 then guiSetPosition(elem, sx+100,y,false) end end end end)
-
hello guys there's cods and it gives clan colour to player by RGBToHex(r,g,b) but if the player isn't in the clan dxdrawtext or nothing else works , whats the reason of this? thanks https://wiki.multitheftauto.com/wiki/RGBToHex function RGBToHex(red, green, blue, alpha) if((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alpha and (alpha < 0 or alpha > 255))) then return nil end if(alpha) then return string.format("#%.2X%.2X%.2X%.2X", red,green,blue,alpha) else return string.format("#%.2X%.2X%.2X", red,green,blue) end end dxDrawText("Nick:"..RGBToHex(r,g,b)..""..getPlayerName(localPlayer), 1095*sW, 567*sH, 1265*sW, 700*sH, tocolor(255, 255, 255, 255), 1.20, "default-bold", "left", "top", false, true, false, true, false)
-
hello everyone , I joined to the clan which is in the pic , but there's no colour of it and when I use another scoreboard there's colour of it. Why does that happen? Can someone help me , codes are under of the picture , thanks This is Clientside local sX,sY = guiGetScreenSize() local g_Me = getLocalPlayer() local root = getRootElement() local players = getElementsByType("player") scoreboard = {} local scrolldownby = 2 local lastscrolldown = 0 local scrollupby = 1 local scrollbarWidth = 1 local ServerMaxPlayer = 32 local rowsCount = math.floor(sY/21) - 2 local start = 3 local fps = 0 local fpstick = nil local rotateimage= 0 local ourTeamName = "nothing" local donatorsTeamName = "Donators" fonts = {} fonts["normal"] = { dxCreateFont("font/segoeuil.ttf",8), dxCreateFont("font/segoeuil.ttf",10), dxCreateFont("font/segoeuil.ttf",12), dxCreateFont("font/segoeuil.ttf",14), dxCreateFont("font/segoeuil.ttf",16), dxCreateFont("font/segoeuil.ttf",18), dxCreateFont("font/segoeuil.ttf",20), dxCreateFont("font/segoeuil.ttf",22), dxCreateFont("font/segoeuil.ttf",24), dxCreateFont("font/segoeuil.ttf",26), } fonts["bold"] = { dxCreateFont("font/segoeuib.ttf",8), dxCreateFont("font/segoeuib.ttf",10), dxCreateFont("font/segoeuib.ttf",12), dxCreateFont("font/segoeuib.ttf",14), dxCreateFont("font/segoeuib.ttf",16), dxCreateFont("font/segoeuib.ttf",18), dxCreateFont("font/segoeuib.ttf",20), dxCreateFont("font/segoeuib.ttf",22), dxCreateFont("font/segoeuib.ttf",24), dxCreateFont("font/segoeuib.ttf",26), } bindKey("mouse_wheel_down", "down", function() if rowsCount > #scoreboard then return end local time = getTickCount() if time - lastscrolldown < 60 then scrolldownby = math.min(scrolldownby + 3, 16) else if time - lastscrolldown < 120 then scrolldownby = math.min(scrolldownby + 2, 16) end scrolldownby = 1 end lastscrolldown = time local rCount = math.min(#scoreboard, rowsCount - 1) start = math.min(#scoreboard - rCount, start + scrolldownby) end ) bindKey("mouse_wheel_up", "down", function() if rowsCount > #scoreboard then return end local time = getTickCount() if time - lastscrolldown < 100 then scrollupby = math.min(scrollupby + 2, 16) else scrollupby = 1 end lastscrolldown = time start = math.max(1, start - scrollupby) end ) local uptadePlayers = function() scoreboard = {} table.insert(scoreboard,{}) players = getElementsByType("player") local teams = getElementsByType("team") local teamID = {} for id,team in ipairs(teams) do teamID[getTeamName(team)] = id end local playersOrderedByTeams = {} for i = 1, #teams + 1 do playersOrderedByTeams[i] = {} end for id,player in ipairs(players) do local pTeam = getPlayerTeam(player) if pTeam then pTeam = teamID[getTeamName(pTeam)] + 1 else pTeam = 1 end table.insert(playersOrderedByTeams[pTeam], player) end for tID,playersInTeam in ipairs(playersOrderedByTeams) do if tID-1 >= 1 then if #getPlayersInTeam(teams[tID - 1]) >= 1 then table.insert(scoreboard, {"team", teams[tID-1]}) end end for id,player in ipairs(playersInTeam) do table.insert(scoreboard, {"player", player,getPlayerName(player)}) end end end uptadePlayers() local TextFadeUp = true local TextStartTime = nil local TextTimer = nil setTimer(function() TextTimer = setTimer(function() TextTimer = nil TextFadeUp = false TextStartTime = getTickCount() end, 2600, 1) TextFadeUp = true TextStartTime = getTickCount() end,4000,0) local isDrawing = false; local isFading = false; local fadeState = true; -- true = in | false = out local fadeStart = 0; local nameState, nameTick = true, 0; local drawScoreboard = function() if(not isDrawing) then return; end uptadePlayers() showCursor(getKeyState("mouse2")) local rCount = math.min(#scoreboard-1, rowsCount -1) start = math.min(#scoreboard - rCount, start) local c = 0 local cx, cy = 0,0 local a = 255; local ap = 100; if isCursorShowing() then cx, cy = getCursorPosition() cx = cx * sX cy = cy * sY end local ax, ay = sX / 2 - 320, sY / 2 - rCount * 20 / 2+25 local x, y = ax, ay; if(isFading) then local elapsed = (getTickCount() - fadeStart) / (fadeState and 0 or 0); --snelheid if(not fadeState) then isDrawing = false; end end dxDrawRectangle(x, y-2, 35, rCount * 20+2, tocolor(0, 0, 0, (140/100) * ap)) dxDrawRectangle(x, y-2, 640, rCount * 20+2, tocolor(0, 0, 0, (160/100) * ap)) rotateimage = rotateimage +2 dxDrawRectangle(x, y - 47, 640, 30, tocolor(0,0,0, a)) local nr, ng, nb local elapsed = getTickCount() - nameTick; local progress = elapsed / 2500; if(nameState) then nr, ng, nb = interpolateBetween(0, 128, 255, 0, 128, 255, progress, "Linear"); else nr, ng, nb = interpolateBetween(0, 128, 255, 0, 128, 255, progress, "Linear"); end if(progress >= 1) then nameState = not nameState; nameTick = getTickCount(); end dxDrawText("GTA.Ru | DM | 24/7", x + 10, y - 70, x + 640, y, tocolor(255, 255, 255, 255), 1, fonts["normal"][5], "left", "center",false,false,false,true) --dxDrawText(#getElementsByType("player") .. " / #ffffff"..ServerMaxPlayer, x + 10, y - 65, x + 630, y, tocolor(255, 255, 255, a), 1,fonts["normal"][5], "right", "center",false,false,false,true) dxDrawText(#getElementsByType("player").." / "..ServerMaxPlayer, x + 10, y - 65, x + 630, y, tocolor(255, 255, 255, 255), 1,fonts["normal"][5], "right", "center",false,false,false,true) dxDrawRectangle(x, y-17, 640, 15, tocolor(60,60,60,140)) dxDrawText("ID", x+14.5 , y-20, x + 640, y, tocolor(220,220,220, 255), 1,fonts["normal"][2], "left", "center") dxDrawText("Name", x +45, y-20, x + 640, y, tocolor(220,220,220, 255), 1, fonts["normal"][2], "left", "center") dxDrawText("Money", x +280, y-20, x + 640, y, tocolor(220,220,220, 255), 1, fonts["normal"][2], "left", "center") dxDrawText("Exp", x +370, y-20, x + 640, y, tocolor(220,220,220, 255), 1, fonts["normal"][2], "left", "center") dxDrawText("Rank", x +430, y-20, x + 640, y, tocolor(220,220,220, 255), 1, fonts["normal"][2], "left", "center") dxDrawText("State", x +488, y-20, x + 640, y, tocolor(220,220,220, 255), 1, fonts["normal"][2], "left", "center") dxDrawText("Country", x +195, y-20, x + 640, y, tocolor(220,220,220, 255), 1, fonts["normal"][2], "left", "center") dxDrawText("FPS", x +555, y-20, x + 640, y, tocolor(220,220,220, 255), 1, fonts["normal"][2], "left", "center") dxDrawText("Ping", x +600, y-20, x + 640, y, tocolor(220,220,220, 255), 1, fonts["normal"][2], "left", "center") for id,element in ipairs(scoreboard) do if start < id and id <= start + rCount then c = c + 1 if element[1] == "player" and isElement(element[2]) then if isCursorShowing() and x <= cx and cx < x + 640 and y + (c - 1) * 20 <= cy and cy < y + (c) * 20 then dxDrawRectangle(x + 35, y-1 + (c - 1) * 20, 605, 20, tocolor(255, 255, 255, 50)) end local r, g, b = 255, 255, 255 local RainbowColorNameHex = getElementData(element[2],"donatorRainbowColorNameHEX") or "" if not getElementData(element[2], "AFK") then dxDrawText(RainbowColorNameHex..element[3], x + 40, y-5 + (c - 1) * 20, x + 200, y + (c) * 20, tocolor(r, g, b, a), 1, "default-bold", "left", "center", false, false, false, true) else dxDrawText(RainbowColorNameHex..element[3], x + 68, y-5 + (c - 1) * 20, x + 200, y + (c) * 20, tocolor(r, g, b, a), 1, "default-bold", "left", "center", false, false, false, true) dxDrawText("#ff0000AFK", x + 40, y-5 + (c - 1) * 20, x + 200, y + (c) * 20, tocolor(r, g, b, a), 1, "default-bold", "left", "center", false, false, false, true) end --ID dxDrawText(getElementData(element[2],"ID") or "?", x, y-5 + (c - 1) * 20, x + 35, y + (c) * 20, tocolor(255,255,255, a), 1, "default-bold", "center", "center") --Country country = getElementData(element[2],"country") or "?" dxDrawText(string.upper(country) or "?", x+215, y-5 + (c - 1) * 20, x + 200, y + (c) * 20, tocolor(255,255,255, a), 1, "default-bold", "left", "center") if country and fileExists("flags/"..country..".png") then dxDrawImage(x+195, y-5 + (c - 1) * 20+4,16,16,"flags/"..country..".png",0,0,0,tocolor(255,255,255,a)) end --Money local money if getElementData(element[2],"Cash") then money = getElementData(element[2],"Cash") else money = "Guest" end dxDrawText(money, x+275, y-5 + (c - 1) * 20, x+275+45, y + (c) * 20, tocolor(255,255,255, a), 1, "default-bold", "center", "center") --Points
-
hello I have a problem , actually when I open debugscript3 , everywhere is green except this. how can I solve this problem? ERROR: server trigered clientside event onNextMap, but event is not added clientside