HG Snuuk

Members
  • Content Count

    44
  • Joined

  • Last visited

Community Reputation

0 Neutral

About HG Snuuk

  • Rank
    Rat

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Olá Tudo Bom , é que não sei o pq , scripts geralmente vem com esse dx padrão aki , porem geralmente tambem vem seguidos por codigos html de cor , porem não sei o pq ele não esta saindo colorido os texto e por conta disso , fica os codigos atrapalhando a leitura do usuario , gostaria de saber se tem como ativar para aparecer os codigos de cor nos textos . local displayWidth, displayHeight = guiGetScreenSize(); local notificationData = {}; local notificationFont = dxCreateFont('font/roboto.ttf', 12 * 2, false); local iconsFont = dxCreateFont('font/icons.ttf', 12 * 2, false); addEventHandler('onClientRender', root, function() for k, v in pairs(notificationData) do if (v.State == 'fadeIn') then local alphaProgress = (getTickCount() - v.AlphaTick) / 650; local alphaAnimation = interpolateBetween(0, 0, 0, 255, 0, 0, alphaProgress, 'Linear'); if (alphaAnimation) then v.Alpha = alphaAnimation; else v.Alpha = 255; end if (alphaProgress > 1) then v.Tick = getTickCount(); v.State = 'openTile'; end elseif (v.State == 'fadeOut') then local alphaProgress = (getTickCount() - v.AlphaTick) / 650; local alphaAnimation = interpolateBetween(255, 0, 0, 0, 0, 0, alphaProgress, 'Linear'); if (alphaAnimation) then v.Alpha = alphaAnimation; else v.Alpha = 0; end if (alphaProgress > 1) then notificationData = {}; end elseif (v.State == 'openTile') then local tileProgress = (getTickCount() - v.Tick) / 350; local tilePosition = interpolateBetween(v.StartX, 0, 0, v.EndX, 0, 0, tileProgress, 'Linear'); local tileWidth = interpolateBetween(0, 0, 0, v.Width, 0, 0, tileProgress, 'Linear'); if (tilePosition and tileWidth) then v.CurrentX = tilePosition; v.CurrentWidth = tileWidth; else v.CurrentX = v.EndX; v.CurrentWidth = v.Width; end if (tileProgress > 1) then v.State = 'fixTile'; setTimer(function() v.Tick = getTickCount(); v.State = 'closeTile'; end, string.len(v.Text) * 45 + 5000, 1); end elseif (v.State == 'closeTile') then local tileProgress = (getTickCount() - v.Tick) / 350; local tilePosition = interpolateBetween(v.EndX, 0, 0, v.StartX, 0, 0, tileProgress, 'Linear'); local tileWidth = interpolateBetween(v.Width, 0, 0, 0, 0, 0, tileProgress, 'Linear'); if (tilePosition and tileWidth) then v.CurrentX = tilePosition; v.CurrentWidth = tileWidth; else v.CurrentX = v.StartX; v.CurrentWidth = 0; end if (tileProgress > 1) then v.AlphaTick = getTickCount(); v.State = 'fadeOut'; end elseif (v.State == 'fixTile') then v.Alpha = 255; v.CurrentX = v.EndX; v.CurrentWidth = v.Width; end roundedRectangle(v.CurrentX, 20, 25 + v.CurrentWidth, 25, tocolor(0, 0, 0, 150 * v.Alpha / 255), _, true); dxDrawRectangle(v.CurrentX, 20, 25, 25, tocolor(0, 0, 0, 255 * v.Alpha / 255), true); if (v.Alpha == 255) then dxDrawText(v.Text, v.CurrentX + 25 + 10, 20, v.CurrentX + 25 + 10 + v.CurrentWidth - 20, 20 + 25, tocolor(255, 255, 255, 255), 0.40, notificationFont, 'center', 'center', false, false, true); end if (v.Type == 'error') then dxDrawText('', v.CurrentX + 5, 20, v.CurrentX + 5 + 25 - 10, 20 + 25, tocolor(215, 90, 90, v.Alpha), 0.50, iconsFont, 'center', 'center', false, false, true); elseif (v.Type == 'warning') then dxDrawText('', v.CurrentX + 5, 20, v.CurrentX + 5 + 25 - 10, 20 + 25, tocolor(220, 180, 80, v.Alpha), 0.50, iconsFont, 'center', 'center', false, false, true); elseif (v.Type == 'info') then dxDrawText('', v.CurrentX + 5, 20, v.CurrentX + 5 + 25 - 10, 20 + 25, tocolor(85, 180, 245, v.Alpha), 0.50, iconsFont, 'center', 'center', false, false, true); elseif (v.Type == 'success') then dxDrawText('', v.CurrentX + 5, 20, v.CurrentX + 5 + 25 - 10, 20 + 25, tocolor(235, 154, 13, v.Alpha), 0.50, iconsFont, 'center', 'center', false, false, true); end end end ) addEvent('addNotification', true); function addNotification(text, type) if (text and type) then if (notificationData ~= nil) then table.remove(notificationData, #notificationData); end table.insert(notificationData, { StartX = (displayWidth / 2) - (25 / 2), EndX = (displayWidth / 2) - ((dxGetTextWidth(text, 0.40, notificationFont) + 20 + 25) / 2), Text = text, Width = dxGetTextWidth(text, 0.40, notificationFont) + 20, Alpha = 0, State = 'fadeIn', Tick = 0, AlphaTick = getTickCount(), CurrentX = (displayWidth / 2) - (25 / 2), CurrentWidth = 0, Type = type or 'info' } ); playSoundFrontEnd(11); end end addEventHandler('addNotification', root, addNotification); function roundedRectangle(x, y, w, h, borderColor, bgColor, postGUI) if (x and y and w and h) then if (not borderColor) then borderColor = tocolor(0, 0, 0, 200); end if (not bgColor) then bgColor = borderColor; end dxDrawRectangle(x, y, w, h, bgColor, postGUI); dxDrawRectangle(x + 2, y - 1, w - 4, 1, borderColor, postGUI); dxDrawRectangle(x + 2, y + h, w - 4, 1, borderColor, postGUI); dxDrawRectangle(x - 1, y + 2, 1, h - 4, borderColor, postGUI); dxDrawRectangle(x + w, y + 2, 1, h - 4, borderColor, postGUI); end end
  2. Opa tudo bom , tou fazendo aki um ped porem ele quando eu dou true no frozen ele fica virado pra rotação 0 , só quando eu dou false que ele vai para rotação correta que seria 180° . teria algum geito de resolver porque se eu não dou frozen ele fica dando tp local agenciaPed = createPed(240, 246.7, 120.4, 1003.3) setElementInterior(agenciaPed, 10) setElementDimension(agenciaPed, 0) setPedRotation(agenciaPed, 180) setElementFrozen(agenciaPed,true) function Cancel_Damage () cancelEvent() end addEventHandler("onClientPedDamage", agenciaPed, Cancel_Damage) sou muito burro depois que eu parei pra pensar um pouco tentei fazer colocar a rotação dps da posição "z" e funcionou .
  3. eu recentemente adicionei uma linha pra mostrar a porcentagem do level porem esta dando erro , a hud n aparece e fica dando esse erro no debugscript , attempt to perform arithemetic on global 'level' (a nil value) oque foi adicionado v local needexp = level * 1500
  4. -- text local ID = getElementData(player, "ID") or "N/A" local w = dxGetTextWidth(ID, 0.1, "default-bold") local h = dxGetFontHeight(1, "default-bold") dxDrawText ( ID ), px, py, px, py, tocolor(255, 255, 255, 195), 1.00, "default-bold", "left", "top", false, false, false, true, false) end troquei aki porem não aparece mais nem o nome e nem o id do jogador debugscript esta assim , : ERROR: Loading script falied: s-voice\cDrawIcon.Lua:73:unexpected Symbol near ','
  5. opa tudo bom ? , eu queria saber pq esta aparecendo o nome sendo que era pra aparecer o id do jogador que esta falando script do < voice > local g_screenX,g_screenY = guiGetScreenSize() local BONE_ID = 8 local WORLD_OFFSET = 0.4 local ICON_PATH = "images/voice.png" local ICON_WIDTH = 0.35*g_screenX -- local ICON_HEIGHT = 0.213333333333*g_screenY -- local iconHalfWidth = ICON_WIDTH/2 -- local iconHalfHeight = ICON_HEIGHT/2 local ICON_DIMENSIONS = 16 local ICON_LINE = 20 local ICON_TEXT_SHADOW = tocolor ( 0, 0, 0, 255 ) --Draw the voice image addEventHandler ( "onClientRender", root, function() local index = 0 if not bShowChatIcons then return end for player in pairs(voicePlayers) do local color = tocolor(255, 255, 255) dxDrawVoiceLabel ( player, index, color ) index = index + 1 while true do --is he streamed in? if not isElementStreamedIn(player) then break end --is he on screen? if not isElementOnScreen(player) then break end local headX,headY,headZ = getPedBonePosition(player,BONE_ID) headZ = headZ + WORLD_OFFSET --is the head position on screen? local absX,absY = getScreenFromWorldPosition ( headX,headY,headZ ) if not absX or not absY then break end local camX,camY,camZ = getCameraMatrix() --is there anything obstructing the icon? if not isLineOfSightClear ( camX, camY, camZ, headX, headY, headZ, true, false, false, true, false, true, false, player ) then break end dxDrawVoice ( absX, absY - 2, color, getDistanceBetweenPoints3D(camX, camY, camZ, headX, headY, headZ) ) break end end end ) function dxDrawVoice ( posX, posY, color, distance ) distance = 1/distance dxDrawImage ( posX - iconHalfWidth*distance, posY - iconHalfWidth*distance, ICON_WIDTH*distance, ICON_WIDTH*distance, ICON_PATH, 0, 0, 0, tocolor(255, 255, 255, 195), false ) end function dxDrawVoiceLabel ( player, index, color ) local sx, sy = guiGetScreenSize () local scale = sy / 800 local spacing = ( ICON_LINE * scale ) local px, py = sx - 200, sy * 0.7 + spacing * index local icon = ICON_DIMENSIONS * scale dxDrawImage ( px, py, icon, icon, ICON_PATH, 0, 0, 0, tocolor(255, 255, 255, 195), false ) px = px + spacing -- text local ID = getElementData(player, "ID") or "N/A" local w = dxGetTextWidth(ID, 0.1, "default-bold") local h = dxGetFontHeight(1, "default-bold") dxDrawText ( getPlayerName ( player ), px, py, px, py, tocolor(255, 255, 255, 195), 1.00, "default-bold", "left", "top", false, false, false, true, false) end
  6. opa vlw consigui coloquei 0.05 deu uma abaixada legal pra quem fica no 100% volume do mta
  7. g_VehicleList = {} local radioStreams = 0 local defaultRadio = "http://listen.shoutcast.com:80/RadioHunter-TheHitzChannel" addEventHandler("onResourceStart", resourceRoot, function() for i,veh in ipairs(getElementsByType("vehicle")) do g_VehicleList[veh] = { } g_VehicleList[veh].radio = false g_VehicleList[veh].radioStation = defaultRadio g_VehicleList[veh].volume = 0.2 end end ) addEventHandler("onPlayerJoin", root, function() for i,veh in ipairs(getElementsByType("vehicle")) do if g_VehicleList[veh] ~= nil then if g_VehicleList[veh].radio == true then triggerClientEvent(source, "onServerToggleRadio", root, true, g_VehicleList[veh].radioStation, veh, g_VehicleList[veh].volume) end end end end ) eu abaixei para 0.2 porem continua alta
  8. ja tentei de tudo mais nada ta fazendo enviar a mensagem dx pro jogador
  9. g_VehicleList[veh].volume = 1 seria o volume default ?
  10. eu gostaria de estar baixando o volume da radio tando dentro quanto fora do carro porem n consiguo achar a linha correta g_VehicleList = {} local radioStreams = 0 local defaultRadio = "http://listen.shoutcast.com:80/RadioHunter-TheHitzChannel" addEventHandler("onResourceStart", resourceRoot, function() for i,veh in ipairs(getElementsByType("vehicle")) do g_VehicleList[veh] = { } g_VehicleList[veh].radio = false g_VehicleList[veh].radioStation = defaultRadio g_VehicleList[veh].volume = 1.0 end end ) addEventHandler("onPlayerJoin", root, function() for i,veh in ipairs(getElementsByType("vehicle")) do if g_VehicleList[veh] ~= nil then if g_VehicleList[veh].radio == true then triggerClientEvent(source, "onServerToggleRadio", root, true, g_VehicleList[veh].radioStation, veh, g_VehicleList[veh].volume) end end end end ) addEventHandler("onVehicleExplode", root, function() if g_VehicleList[source] ~= nil then if g_VehicleList[source].radio == true then triggerClientEvent("onServerToggleRadio", root, false, nil, source) g_VehicleList[source].radio = false killTimer(g_VehicleList[source].idleTimer) if radioStreams ~= 0 then radioStreams = radioStreams + 1 end end end end ) addEventHandler("onElementDestroy", root, function() if g_VehicleList[source] ~= nil then if g_VehicleList[source].radio == true then triggerClientEvent("onServerToggleRadio", root, false, nil, source) g_VehicleList[source].radio = false killTimer(g_VehicleList[source].idleTimer) if radioStreams ~= 0 then radioStreams = radioStreams + 1 end end end end ) addEvent("onPlayerToggleRadio", true) addEventHandler("onPlayerToggleRadio", root, function() if source and getElementType(source) == "player" then toggleRadio(source) end end ) function toggleRadio(player) local veh = getPedOccupiedVehicle(player) if veh then local occupants = getVehicleOccupants(veh) local seats = getVehicleMaxPassengers(veh) local playerSeat = getPedOccupiedVehicleSeat(player) if playerSeat ~= 0 and playerSeat ~= 1 then return end if g_VehicleList[veh] == nil then g_VehicleList[veh] = { } g_VehicleList[veh].radio = false g_VehicleList[veh].radioStation = defaultRadio g_VehicleList[veh].volume = 1 end if g_VehicleList[veh].radio == false then if not get("toggleAntifloodTick") or not get("streamLimit") or not get("radioEnabledIdleTime") then return end local settingToggleAntifloodTick = get("toggleAntifloodTick") local settingStreamLimit = get("streamLimit") local idleTime = get("radioEnabledIdleTime") if g_VehicleList[veh].lastTick and (getTickCount() - g_VehicleList[veh].lastTick) <= settingToggleAntifloodTick then return end if radioStreams >= settingStreamLimit then outputChatBox("*[Rádio] O limite de correntes atingiu (" .. settingStreamLimit .. ")", player, 255, 255, 255) return end local x, y, z = getElementPosition(veh) g_VehicleList[veh].radio = true g_VehicleList[veh].lastTick = getTickCount() g_VehicleList[veh].turnedOnBy = getPlayerName(player) radioStreams = radioStreams + 1 for seat = 0, seats do local occupant = occupants[seat] if occupant and getElementType(occupant) == "player" then triggerClientEvent("onServerToggleRadio", root, true, g_VehicleList[veh].radioStation, veh, g_VehicleList[veh].volume) local r, g, b = getPlayerNametagColor(player) colorHex = string.format("%02X%02X%02X", r, g, b) outputChatBox("#" .. colorHex .. "" .. getPlayerName(player) .. " #696969Rádio: [#00ff00Ligada#696969]", occupant, 0, 0, 0, true) end end else g_VehicleList[veh].radio = false radioStreams = radioStreams + 1 for seat = 0, seats do local occupant = occupants[seat] if occupant and getElementType(occupant) == "player" then triggerClientEvent("onServerToggleRadio", root, false, nil, veh, g_VehicleList[veh].volume) local r, g, b = getPlayerNametagColor(player) colorHex = string.format("%02X%02X%02X", r, g, b) outputChatBox("#" .. colorHex .. "" .. getPlayerName(player) .. " #696969Rádio: [#ff0000Desligada#696969]", occupant, 0, 0, 0, true) end end end end end addEvent("onPlayerRadioVolumeChange", true) addEventHandler("onPlayerRadioVolumeChange", root, function(currentVol, volumeUp) local veh = getPedOccupiedVehicle(source) if veh then local playerSeat = getPedOccupiedVehicleSeat(source) if playerSeat == 0 or playerSeat == 1 then if volumeUp == true then g_VehicleList[veh].volume = currentVol + 0.05 if g_VehicleList[veh].volume >= 1.00 then g_VehicleList[veh].volume = 1.00 end else g_VehicleList[veh].volume = currentVol - 0.05 if g_VehicleList[veh].volume <= 0.00 then g_VehicleList[veh].volume = 0.00 end end triggerClientEvent("onServerVolumeChangeAccept", root, veh, g_VehicleList[veh].volume) end end end ) function cmdChangeRadioURL(source, commandName, url) if not url then outputChatBox("*[Rádio] Use: setradio url", source, 255, 255, 255) return end local veh = getPedOccupiedVehicle(source) if veh then local occupants = getVehicleOccupants(veh) local seats = getVehicleMaxPassengers(veh) if g_VehicleList[veh] == nil then local x, y, z = getElementPosition(veh) g_VehicleList[veh] = { } g_VehicleList[veh].radio = true g_VehicleList[veh].lastTick = getTickCount() g_VehicleList[veh].radioStation = defaultRadio g_VehicleList[veh].volume = 1 end local playerSeat = getPedOccupiedVehicleSeat(source) if playerSeat ~= 0 and playerSeat ~= 1 then outputChatBox("*[Rádio] Você não pode mudar a rádio porquê você é passageiro!", source, 255, 255, 255) return end for seat = 0, seats do local occupant = occupants[seat] if occupant and getElementType(occupant) == "player" then g_VehicleList[veh].radioStation = url g_VehicleList[veh].changedBy = getPlayerName(source) if g_VehicleList[veh].radio == true then triggerClientEvent("onServerRadioURLChange", root, g_VehicleList[veh].radioStation, veh, g_VehicleList[veh].volume) end local r, g, b = getPlayerNametagColor(source) colorHex = string.format("%02X%02X%02X", r, g, b) outputChatBox("#" .. colorHex .. "" .. getPlayerName(source) .. " #FFFFFFMudou a Rádio!", occupant, 255, 255, 255, true) end end end end addCommandHandler("setradio", cmdChangeRadioURL)
  11. sim aki ele tambem funciona só que ele esta dentro de um arquivo save-system por que eu falo que ele volta com a skin salvada mais dps ele troca pro cj
  12. mais oque eu realmente queria é que ele salvasse a skin que ele esta utilizando agora pra ele dar respawn com a mesma skin , porem o script sempre ta voltando com a skin do cj -- Configurações para quando um jogador entrar -- XYZ coördinates local joinX = 1480.8 local joinY = -1757.571 local joinZ = 17.831 -- Armas e tiros local joinWeapon = 0 local joinAmmo = 0 -- Menssagem para o jogador local joinMessage = "" -- Pele do jogador local joinSkin = 0 -- Configurações para quando um jogador morrer -- XYZ coördinates local spawnX = 1179.063 local spawnY = -1324.557 local spawnZ = 14.351 -- Armas e tiros local spawnWeapon = 0 local spawnAmmo = 0 -- Definições para as quantidades de dinheiro -- Dinheiro por matar um jogador local killerMoney = 0 -- O dinheiro retirado do jogador quando morrem local deadPlayerMoney = 0 -- Dinheiro ganho quando entra no server local joinMoney = 2000 -- Functions -- This function spawns players when they join function spawnOnJoin() spawnPlayer(source, joinX, joinY, joinZ, 0 , joinSkin) fadeCamera(source, true) setCameraTarget(source, source) outputChatBox(joinMessage, source) giveWeapon(source, joinWeapon, joinAmmo) givePlayerMoney(source, joinMoney) end -- This function spawns players after they died function spawnOnDead(ammo, killer, weapon, bodypart) outputChatBox() takePlayerMoney(source, deadPlayerMoney) if (killer) and (killer ~= source) then givePlayerMoney(killer, killerMoney) end setTimer(spawnPlayer, 3000, 1, source, spawnX, spawnY, spawnZ, 0, spawnSkin) setCameraTarget(source, source) setTimer(giveWeapon, 3000, 1, source, spawnWeapon, spawnAmmo) end -- Event handlers addEventHandler("onPlayerJoin", getRootElement(), spawnOnJoin) addEventHandler("onPlayerWasted", getRootElement(), spawnOnDead)
  13. ta limpo https://prnt.sc/p0h4d9
  14. s , essa parte aki funciona correta porem as outras não envia a mensagem a que funciona é esta aki -------------------------------------------------------------------- canceltimer={} function fix(source,cmd,pname) if getElementData(source, "ocupacao" ) == "Policial" then local cliente = getPlayerFromPartialName(pname) if isElement(cliente) then if cliente == source then exports.Scripts_Dxmessages:outputDx(source, "Você não Pode Pedir sua Propria Identidade!", "error") return end local policial = getElementData(cliente,"cliente:policial") if isElement(policial) then exports.Scripts_Dxmessages:outputDx(source, "O Jogador "..getPlayerName(cliente).." Ja Esta Sendo Atendido Por um Policial!", "error") else local cx,cy,cz = getElementPosition(cliente) local x,y,z = getElementPosition(source) local dist = getDistanceBetweenPoints3D(x,y,z,cx,cy,cz) if dist <= 7 then setElementData(cliente,"cliente:policial",source) exports.Scripts_Dxmessages:outputDx(source, "Você Solicitou a Identidade do Jogador "..getPlayerName(cliente), "warning") exports.Scripts_Dxmessages:outputDx(cliente, "O Policial "..getPlayerName(source).." Pediu sua Identidade, Digite /Mostrar ou /Recusar.", "warning") canceltimer[cliente] = setTimer(cancelfix,15000,1,cliente) end end else exports.Scripts_Dxmessages:outputDx(source, "O Jogador Não Foi Encontrado", "error") end end end addCommandHandler(cmd1,fix)
  15. local screenW,screenH = guiGetScreenSize() local resW, resH = 1366,768 local x, y = (screenW/resW), (screenH/resH) local components = { "area_name", "radio", "vehicle_name" } local font = dxCreateFont('files/fonts/font.ttf', 10, false); local font2 = dxCreateFont('files/fonts/font.ttf', 14, false); function f_hud( ... ) if (not isPlayerMapVisible()) then local money = convertNumber(getPlayerMoney(getLocalPlayer())) local bank = convertNumber(getElementData(localPlayer, "Bank:Royal") or "0") local realName = getPlayerName(getLocalPlayer()) local Cargo_Atual = getElementData(localPlayer, "DNL:Cargo") local weapon = getPedWeapon ( getLocalPlayer() ) local arma = getWeaponNameFromID ( weapon ) local showammo1 = getPedAmmoInClip (localPlayer,getPedWeaponSlot(localPlayer)) local showammo2 = getPedTotalAmmo(localPlayer)-getPedAmmoInClip(localPlayer) local showammo3 = getPedTotalAmmo(getLocalPlayer()) if arma == Fist then arma = Sono end dxDrawRectangle(x*1180, y*50, x*160, y*35, tocolor(0, 0, 0, 230), false) dxDrawRectangle(x*1180, y*100, x*160, y*35, tocolor(0, 0, 0, 230), false) dxDrawRectangle(x*1180, y*150, x*160, y*35, tocolor(0, 0, 0, 230), false) dxDrawLine(x*1340, y*85, x*1180, y*85, tocolor(255, 0, 90, 255), 3, false) dxDrawLine(x*1340, y*135, x*1180, y*135, tocolor(255, 0, 90, 255), 3, false) dxDrawLine(x*1340, y*185, x*1180, y*185, tocolor(255, 0, 90, 255), 3, false) dxDrawImage(x*1180, y*155, x*35, y*35, "files/img/card.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(x*1180, y*110, x*22, y*20, "files/img/money.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawImage(x*1185, y*60, x*20, y*20, "files/img/maleta.png", 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("R$: "..money, x*1240, y*110, x*1132, y*37, tocolor(255, 255, 255, 221), 1.00, font, "left", "top", false, false, false, true, false) dxDrawText("R$: "..bank, x*1240, y*160, x*1132, y*37, tocolor(255, 255, 255, 221), 1.00, font, "left", "top", false, false, false, true, false) dxDrawText("Arma: "..arma.. " | Pente: " ..tostring (showammo1).." / "..tostring (showammo2), x*1187, y*400, x*1160, y*10, tocolor(255, 255, 255, 255), x*0.7, font, "left", "center", false, false, true, false, false) local Encaminhado = getElementData ( localPlayer, "Emprego") or "Desempregado" dxDrawText(Encaminhado, x*1230, y*60, x*1470, y*30, tocolor(255, 255, 255, 221), x*1.00, font, "left", "top", false, false, false, false, false) end end addEventHandler("onClientRender", root, f_hud) function toggleF11() if isVisible then addEventHandler("onClientRender", root, f_hud) else removeEventHandler("onClientRender", root, f_hud) end isVisible = not isVisible end bindKey ("F11", "down", toggleF11) function setHud() setPlayerHudComponentVisible("armour", false) setPlayerHudComponentVisible("wanted", false) setPlayerHudComponentVisible("weapon", false) setPlayerHudComponentVisible("money", false) setPlayerHudComponentVisible("health", false) setPlayerHudComponentVisible("clock", false) setPlayerHudComponentVisible("breath", false) setPlayerHudComponentVisible("ammo", false) setPlayerHudComponentVisible("radar", false) for _, component in ipairs( components ) do setPlayerHudComponentVisible( component, false ) end end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), setHud) function removeHud() setPlayerHudComponentVisible("armour", true) setPlayerHudComponentVisible("wanted", true) setPlayerHudComponentVisible("weapon", true) setPlayerHudComponentVisible("money", true) setPlayerHudComponentVisible("health", true) setPlayerHudComponentVisible("clock", true) setPlayerHudComponentVisible("breath", true) setPlayerHudComponentVisible("ammo", true) setPlayerHudComponentVisible("radar", true) end addEventHandler("onClientResourceStop", getResourceRootElement(getThisResource()), removeHud) function convertNumber ( number ) local formatted = number while true do formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1.%2') if ( k==0 ) then break end end return formatted end function getPedMaxHealth(ped) assert(isElement(ped) and (getElementType(ped) == "ped" or getElementType(ped) == "player"), "Bad argument @ 'getPedMaxHealth' [Expected ped/player at argument 1, got " .. tostring(ped) .. "]") local stat = getPedStat(ped, 24) local maxhealth = 100 + (stat - 569) / 4.31 return math.max(1, maxhealth) end