koragg

Members
  • Content count

    519
  • Joined

  • Last visited

Community Reputation

83 Popular

7 Followers

About koragg

  • Rank
    Playa Partner
  • Birthday 11/02/97

Details

  • Gang
    [SiK] Speed is King
  • Location
    Sofia, Bulgaria
  • Occupation
    Racer
  • Interests
    (: Android, Mountain Biking, GTA SA & Selena Gomez :)

Recent Profile Visitors

1,949 profile views
  1. Emergency Lighting System (ELM,ELS)

    I doubt that you'll find exactly what you're looking for. Better download one of the given resources and edit it with your preferences (on / off switch for everything, adding sirens etc).
  2. Scoreboard flags not showing

    Here you go: https://www.mediafire.com/file/bk1ipa4vhq1swal/scoreboard.zip
  3. [HELP] Want to make the Vehicle and Nitro disappear i

    Here you go. By the way instead of removing it when you're spectating you can make it update the health and nitro level of the person you're spectating so it shows their values. Anyway, code to remove both if you're spectating below, let me know if you want to sync it instead and I'll be glad to help you out (it's ready for me, just copy-paste xd). local sx, sy = guiGetScreenSize() local px, py = 1600, 900 local x, y = (sx/px), (sy/py) function drawHealthAndNOS() local playerVehicle = getPedOccupiedVehicle(localPlayer) if playerVehicle then local vehicleHealth = getElementHealth(playerVehicle) local vehicleSpeed = getElementVelocity(playerVehicle) if isPedDead(localPlayer) then return end local state = getElementData(localPlayer, "player state") if state == "spectating" then return end dxDrawLine(x*1293, y*802, x*1590, y*802, tocolor(0, 0, 0, 255), 3, true) dxDrawLine(x*1293, y*886, x*1590, y*886, tocolor(0, 0, 0, 255), 3, true) dxDrawLine(x*1293, y*801, x*1293, y*887, tocolor(0, 0, 0, 255), 3, true) dxDrawLine(x*1590, y*800, x*1590, y*886, tocolor(0, 0, 0, 255), 3, true) dxDrawRectangle(x*1294, y*803, x*297, y*83, tocolor(0, 0, 0, 170), true) -- Rahmen dxDrawRectangle(x*1454, y*814, x*126, y*23, tocolor(44, 44, 44, 255), true) -- Health dxDrawRectangle(x*1454, y*814, x*126/1000*vehicleHealth, y*23, tocolor(59, 141, 0, 255), true) -- Health dxDrawText((math.floor(vehicleHealth/10)).."% Health", x*1440, y*810, x*1604, y*842, tocolor(255, 255, 255, 255), 1.30, "default-bold", "center", "center", false, false, true, false, false) -- Health sx, sy, sz = getElementVelocity (getPedOccupiedVehicle(localPlayer)) -- Speed vehiclekmh = math.floor(((sx^2 + sy^2 + sz^2)^(0.5))*180) -- Speed dxDrawText(""..tostring(vehiclekmh).." kmh", x*1358, y*857, x*1522, y*877, tocolor(255, 255, 255, 255), 1.20, "default-bold", "center", "center", false, false, true, false, false) -- Speed end end addEventHandler("onClientRender", root, drawHealthAndNOS) function nitroShow() if isPedInVehicle(localPlayer) then local car = getPedOccupiedVehicle(localPlayer) local nitro = getVehicleNitroLevel(car) if isPedDead(localPlayer) then return end local state = getElementData(localPlayer, "player state") if state == "spectating" then return end if nitro ~= false and nitro ~= nil and nitro > 0 then dxDrawRectangle(x*1305, y*814, x*126, y*23, tocolor(44, 44, 44, 255), true) -- Nos Show dxDrawRectangle(x*1305, y*814, x*126/10*10*nitro, y*23, tocolor(0, 70, 149, 255), true) -- Nos Show dxDrawText((math.floor(nitro/1*100)).."% Nitro", x*1290, y*810, x*1454, y*842, tocolor(255, 255, 255, 255), 1.30, "default-bold", "center", "center", false, false, true, false, false) -- Nos Show else dxDrawText("No Nitro", x*1290, y*810, x*1454, y*842, tocolor(255, 255, 255, 255), 1.30, "default-bold", "center", "center", false, false, true, false, false) -- Nos Hide end end end addEventHandler("onClientRender", root, nitroShow) And in the post window there are two opposite arrows in the control bar at the top. Something like '<>'. Click that and paste your code there so it looks like in Notepad++
  4. Scoreboard flags not showing

    I'm from phone so can't give any code but i did notice one thing. You can't set the flag just by setting element data as you can other things. To put flags in the scoreboard you have to use dxDrawImage. I'll give you my scoreboard's flags lines tomorrow so you see how it's made. I can give you my modified scoreboard actually. It puts flags and full country names in column called "Country". Reply here if you want it. (It didn't work by using a 3rd party resource for me neither when i tried to use one from community.)
  5. [HELP] Want to make the Vehicle and Nitro disappear i

    I used the same resource in my server since the design is so simplistic yet awesome looking. Try this for your case (also fixed up code a bit since it wasn't positioned correctly): local sx, sy = guiGetScreenSize() local px, py = 1600, 900 local x, y = (sx/px), (sy/py) function drawHealthAndNOS() local playerVehicle = getPedOccupiedVehicle(localPlayer) if playerVehicle then local vehicleHealth = getElementHealth ( playerVehicle ) local vehicleSpeed = getElementVelocity ( playerVehicle ) if isPedDead(localPlayer) then return end dxDrawLine(x*1293, y*802, x*1590, y*802, tocolor(0, 0, 0, 255), 3, true) dxDrawLine(x*1293, y*886, x*1590, y*886, tocolor(0, 0, 0, 255), 3, true) dxDrawLine(x*1293, y*801, x*1293, y*887, tocolor(0, 0, 0, 255), 3, true) dxDrawLine(x*1590, y*800, x*1590, y*886, tocolor(0, 0, 0, 255), 3, true) dxDrawRectangle(x*1294, y*803, x*297, y*83, tocolor(0, 0, 0, 170), true) -- Rahmen dxDrawRectangle(x*1454, y*814, x*126, y*23, tocolor(44, 44, 44, 255), true) -- Health dxDrawRectangle(x*1454, y*814, x*126/1000*vehicleHealth, y*23, tocolor(59, 141, 0, 255), true) -- Health dxDrawText((math.floor(vehicleHealth/10)).."% Health", x*1440, y*810, x*1604, y*842, tocolor(255, 255, 255, 255), 1.30, "default-bold", "center", "center", false, false, true, false, false) -- Health sx, sy, sz = getElementVelocity (getPedOccupiedVehicle(localPlayer)) -- Speed vehiclekmh = math.floor(((sx^2 + sy^2 + sz^2)^(0.5))*180) -- Speed dxDrawText(""..tostring(vehiclekmh).." kmh", x*1358, y*857, x*1522, y*877, tocolor(255, 255, 255, 255), 1.20, "default-bold", "center", "center", false, false, true, false, false) -- Speed end end addEventHandler("onClientRender", root, drawHealth) function nitroShow() if isPedInVehicle(localPlayer) then local car = getPedOccupiedVehicle(localPlayer) local nitro = getVehicleNitroLevel(car) if isPedDead(localPlayer) then return end if nitro ~= false and nitro ~= nil and nitro > 0 then dxDrawRectangle(x*1305, y*814, x*126, y*23, tocolor(44, 44, 44, 255), true) -- Nos Show dxDrawRectangle(x*1305, y*814, x*126/10*10*nitro, y*23, tocolor(0, 70, 149, 255), true) -- Nos Show dxDrawText((math.floor(nitro/1*100)).."% Nitro", x*1290, y*810, x*1454, y*842, tocolor(255, 255, 255, 255), 1.30, "default-bold", "center", "center", false, false, true, false, false) -- Nos Show else dxDrawText("No Nitro", x*1290, y*810, x*1454, y*842, tocolor(255, 255, 255, 255), 1.30, "default-bold", "center", "center", false, false, true, false, false) -- Nos Hide end end end addEventHandler("onClientRender", root, nitroShow)
  6. [QUESTION] setVehiclePlateText() doubt

    Edited a bit and tested with a real-life player (woah ). Everything works perfect, also optimized a bit as you suggested @IIYAMA.
  7. [QUESTION] setVehiclePlateText() doubt

    It just refused to work without a slight delay after the map has started OK, I'll try to fix it up a bit after dinner and report back soon. PS: i just saw there's no need to trigger client event on login logout and namechange will just put licence plate function in server side.
  8. [QUESTION] setVehiclePlateText() doubt

    Thanks for your input @IIYAMA but setTimer says: timesToExecute: The number of times you want the timer to execute, or 0 for infinite repetitions. And I set it to '1' so that it executes just once on every map start. Am I missing something? Shouldn't it be '0' to be an infinite timer?
  9. [QUESTION] setVehiclePlateText() doubt

    Here goes. So I wasted ~ 1 hour and did the following things: Cliend-side stuff: visual = { -- Standard Settings, 0 = off -- ["plate"] = string.sub(getPlayerName(localPlayer):gsub('#%x%x%x%x%x%x', ''), 1, 8), } ------------------------------------------------------------------------------------------------------------------------- function visual_ButtonHandler() if source == GUIEditor.button["plate"] then local nr = guiGetText(GUIEditor.edit["plate"]) if not nr then outputChatBox("Please insert a string to use as your licence plate before clicking ok.") return end if nr == nil or nr == "" or nr == " " or nr == " " or nr == " " or nr == " " or nr == " " or nr == " " or nr == " " or nr == " " then outputChatBox("Your licence plate cannot be empty. Changed to default one. ") nr = string.sub(getPlayerName(localPlayer):gsub('#%x%x%x%x%x%x', ''), 1, 8) end local veh = getPedOccupiedVehicle(localPlayer) if veh then if getElementData(localPlayer, "LoggedIn") ~= true then outputChatBox("You need to register and login in order to set a custom licence plate!", 255, 153, 0, true) return end setVehiclePlateText(veh, nr) setElementData(localPlayer, "savedPlate", nr) setElementData(localPlayer, "plate", nr) visual["plate"] = nr v_setSaveTimer() end end end end addEventHandler("onClientGUIClick", resourceRoot, visual_ButtonHandler) ------------------------------------------------------------------------------------------------------------------------- function visual_LoadSettings() for w, c in pairs(visual) do -- Move settings to visual table -- local theChild = xmlFindChild( v_loadXML, w, 0 ) if not theChild then local theChild = xmlCreateChild( v_loadXML, w ) xmlNodeSetValue( theChild, c ) end if w ~= "nitrocolor" and w ~= "plate" then -- nitrocolor is not a number value local val = xmlNodeGetValue( theChild ) visual[w] = tonumber(val) else local val = xmlNodeGetValue( theChild ) visual[w] = val end if w == "plate" then local veh = getPedOccupiedVehicle(localPlayer) setElementData(localPlayer, "savedPlate", c) setElementData(localPlayer, "plate", c) local pltTxt = c if getElementData(localPlayer, "LoggedIn") ~= true then pltTxt = string.sub(getPlayerName(localPlayer):gsub('#%x%x%x%x%x%x', ''), 1, 8) end if veh then setVehiclePlateText(veh, pltTxt) end end end setVisualGUI() end addEventHandler("onClientResourceStart", resourceRoot, visual_LoadSettings) ------------------------------------------------------------------------------------------------------------------------- addEvent("changePlateOnLogout", true) function changePlateOnLogout(veh, pltTxt) if veh and pltTxt then setVehiclePlateText(veh, pltTxt) end end addEventHandler("changePlateOnLogout", root, changePlateOnLogout) ------------------------------------------------------------------------------------------------------------------------- addEvent("changePlateOnLogin", true) function changePlateOnLogin(veh, pltTxt) if veh and pltTxt then setVehiclePlateText(veh, pltTxt) end end addEventHandler("changePlateOnLogin", root, changePlateOnLogin) ------------------------------------------------------------------------------------------------------------------------- addEvent("changePlateOnNickChange", true) function changePlateOnNickChange(veh, pltTxt) if veh and pltTxt then setVehiclePlateText(veh, pltTxt) end end addEventHandler("changePlateOnNickChange", root, changePlateOnNickChange) ------------------------------------------------------------------------------------------------------------------------- function setVisualGUI() for f, u in pairs(visual) do if f == "plate" then if u ~= nil or u ~= "" or u ~= " " or u ~= " " or u ~= " " or u ~= " " or u ~= " " or u ~= " " or u ~= " " or u ~= " " then guiSetText(GUIEditor.edit["plate"], u) local veh = getPedOccupiedVehicle(localPlayer) if veh then if getElementData(localPlayer, "LoggedIn") ~= true then outputChatBox("You need to register and login in order to set a custom licence plate!", 255, 153, 0, true) return end setVehiclePlateText(veh, u) setElementData(localPlayer, "savedPlate", u) setElementData(localPlayer, "plate", u) visual["plate"] = u end else local plate local veh = getPedOccupiedVehicle(localPlayer) if veh then plate = getVehiclePlateText(veh) end if plate then guiSetText(GUIEditor.edit["plate"], plate) end end end end end Server-side stuff: addEvent("onMapStarting", true) function setLicencePlate() setTimer(function() for k,v in ipairs(getElementsByType("player")) do local account = getPlayerAccount(v) if account and isGuestAccount(account) then return end local veh = getPedOccupiedVehicle(v) local plateText = getElementData(v, "plate") if veh and plateText and plateText ~= nil then setVehiclePlateText(veh, plateText) end end end, 50, 1) end addEventHandler("onMapStarting", root, setLicencePlate) addEventHandler("onPlayerSpawn", root, setLicencePlate) addEventHandler("onPlayerJoin", root, setLicencePlate) ------------------------------------------------------------------------------------------------------------------------- function onPlayerLogout() local vehicle = getPedOccupiedVehicle(source) local newPlate = string.sub(getPlayerName(source):gsub('#%x%x%x%x%x%x', ''), 1, 8) triggerClientEvent(root, "changePlateOnLogout", source, vehicle, newPlate) end addEventHandler("onPlayerLogout", root, onPlayerLogout) ------------------------------------------------------------------------------------------------------------------------- function onPlayerLogin() local newPlate local vehicle = getPedOccupiedVehicle(source) local savedPlate = getElementData(source, "savedPlate") if savedPlate then newPlate = string.sub(savedPlate:gsub('#%x%x%x%x%x%x', ''), 1, 8) else newPlate = string.sub(getPlayerName(source):gsub('#%x%x%x%x%x%x', ''), 1, 8) end triggerClientEvent(root, "changePlateOnLogin", source, vehicle, newPlate) end addEventHandler("onPlayerLogin", root, onPlayerLogin) ------------------------------------------------------------------------------------------------------------------------- function onPlayerChangeNick(oldNick, newNick) local account = getPlayerAccount(source) local savedPlate = getElementData(source, "savedPlate") if savedPlate and account and not isGuestAccount(account) then return end local vehicle = getPedOccupiedVehicle(source) local newPlate = string.sub(newNick:gsub('#%x%x%x%x%x%x', ''), 1, 8) triggerClientEvent(root, "changePlateOnNickChange", source, vehicle, newPlate) end addEventHandler("onPlayerChangeNick", root, onPlayerChangeNick) ------------------------------------------------------------------------------------------------------------------------- function onPlayerLogin() local playeraccount = getPlayerAccount(source) if playeraccount then if not isGuestAccount(playeraccount) then setElementData(source, "LoggedIn", true) else setElementData(source, "LoggedIn", false) end end end addEventHandler("onPlayerLogin", root, onPlayerLogin) Obviosly this is just the part for the plates (there is a :~load of code for other settings in the resource). For me - it works. No bugs, no problems. But would it be synced to all other players is my question? Like, when I change my licence plate to a custom one from the GUI, would a player next to me or spectating me see the updated custom plate? If anyone can take a look at the above lines and tell me, I'd appreciate it.
  10. [QUESTION] setVehiclePlateText() doubt

    Bummer, that's what I thought too. Will be harder to sync than I though
  11. I found this function on the wiki and my question is: If I set my licence plate client-side from a GUI text box, would it show updated for other players spectating me or not? https://wiki.multitheftauto.com/wiki/SetVehiclePlateText
  12. load data in tab

    I may be wrong but I've never seen triggerServerEvent be used like this, assigned to a variable.
  13. [HELP] NEED HELP pls

    He gave another line as the error to me
  14. [HELP] NEED HELP pls

    OK, first of all, you misspelled "getPlayerMaxAviableSlots()". Should be "getPlayerMaxAvailableSlots()" Try this: if itemName and (getPlayerCurrentSlots() + getItemSlots(itemName) <= getPlayerMaxAviableSlots()) then local col = getElementData(getLocalPlayer(), "currentCol") if #getElementsWithinColShape(col, "player") > 1 or getNetworkStats().packetlossLastSecond > 1 then return end end
  15. [HELP] NEED HELP pls

    Which line is 944 ?