-
Posts
69 -
Joined
-
Last visited
Everything posted by HG Snuuk
-
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
-
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 .
-
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
-
-- 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 ','
-
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
-
opa vlw consigui coloquei 0.05 deu uma abaixada legal pra quem fica no 100% volume do mta
-
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
-
ja tentei de tudo mais nada ta fazendo enviar a mensagem dx pro jogador
-
g_VehicleList[veh].volume = 1 seria o volume default ?
-
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)
-
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
-
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)
-
ta limpo https://prnt.sc/p0h4d9
-
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)
-
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
-
Opa tudo bom é que o script só manda a mensagem dx tanto para o policial quanto para o player sómente na hora de dar os comandos /revistar , porem na outra parte caso o player mostre a identidade ou ele se recuse a mostrar n ta executando a função de mostrar a mensagem dx mostrando que foi recusado ou que foi mostrado a identidade cmd0 = "verificar" cmd1 = "revistar" cmd2 = "recusar" cmd3 = "mostrar" -------------------------------------------------------------------- function BuscarIDVTR (source, cmd, pname) if getElementData ( source, "ocupacao" ) == "Policial" then local vehicle = getPedOccupiedVehicle (source) local cliente = getPlayerFromPartialName(pname) if isElement(cliente) then if cliente == source then exports.Scripts_Dxmessages:outputDx(source, "Você não Pode Verificar sua Propria Ficha!", "error") return end if getElementData ( cliente, "AirNew_BuscaID_Perm" ) == "Sim" then if isElement(vehicle) then if (getElementType(vehicle) == "vehicle" ) then if (getVehicleType(vehicle) == "Automobile") or (getVehicleType(vehicle) == "Bike") then local id = getElementModel ( vehicle ) if id == 433 or id == 579 or id == 427 or id == 490 or id == 528 or id == 523 or id == 470 or id == 596 or id == 598 or id == 599 or id == 597 or id == 432 or id == 601 then local RG = getElementData ( cliente, "AirNew_RG" ) or "N/C" setElementData ( source, "PM_AirNew_RG", RG ) local Data = getElementData ( cliente, "AirNew_DataExpedicao" ) or "N/C" setElementData ( source, "PM_AirNew_DataExpedicao", Data ) local Nome = getElementData ( cliente, "Nome" ) or "N/C" setElementData ( source, "PM_AirNew_RG_NomeCompleto", Nome ) local DataNas = getElementData ( cliente, "Ano" ) or "N/C" setElementData ( source, "PM_AirNew_RG_DataDeNascimento", DataNas ) local LocalNas = getElementData ( cliente, "AirNew_RG_LocalDeNascimento" ) or "N/C" setElementData ( source, "PM_AirNew_RG_LocalDeNascimento", LocalNas ) local ProcuradoNivel = getPlayerWantedLevel ( cliente ) setElementData ( source, "PM_AirNew_RG_Procurado", ProcuradoNivel ) local Drogas = getElementData ( cliente, "drogas" ) or "N/C" setElementData ( source, "PM_AirNew_Drogas", Drogas ) local Dinheiro_AirNewSCR = getElementData ( cliente, "Dinheiro_AirNewSCR" ) or "N/C" setElementData ( source, "Dinheiro_AirNewSCR_Abordado", Dinheiro_AirNewSCR ) local AirNewSCR_Porte_de_Armas = getElementData ( cliente, "AirNewSCR_Porte_de_Armas" ) or "N/C" setElementData ( source, "PM_AirNewSCR_Porte_de_Armas", AirNewSCR_Porte_de_Armas ) setElementData ( source, "AirNew_SolicitarAbrirFicha", "Sim" ) -- Abrir Ficha end end end else exports.Scripts_Dxmessages:outputDx(source, "Entre Dentro da Viatura para Poder Utilizar esse Comando!", "error") end else exports.Scripts_Dxmessages:outputDx(source, "Você não pode puxar uma Ficha sem a Identidade do Jogador!", "error") end end end end addCommandHandler ( cmd0, BuscarIDVTR ) -------------------------------------------------------------------- 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) -------------------------------------------------------------------- function recusar(source) local policial = getElementData(source,"cliente:policial") if isElement(policial) then exports.Scripts_Dxmessages:outputDx(policial, "O Jogador "..getPlayerName(source).." Se Recusou a Mostrar a Identidade, +1 Nivel de Procurado!", "error") -- Policial exports.Scripts_Dxmessages:outputDx(source, "Você se Recusou a Entregar a Identidade, e Agora esta Procurado!", "warning") Procurado = getPlayerWantedLevel ( source ) setPlayerWantedLevel ( source, Procurado+1 ) end setElementData(source,"cliente:policial",nil) if isTimer(canceltimer[source]) then killTimer(canceltimer[source]) end end addCommandHandler(cmd2,recusar) -------------------------------------------------------------------- function aceitar(source) local policial = getElementData(source,"cliente:policial") if isElement(policial) then exports.Scripts_Dxmessages:outputDx(policial, "O Jogador "..getPlayerName(source).." Lhe mostrou a Identidade, Verifique Dentro da Viatura /Verificar Nick. (Você tem 60 Segundos)", "success") exports.Scripts_Dxmessages:outputDx(source, "Você mostrou sua identidade ao Policial "..getPlayerName(policial).." #ffffff( ele tem tem 60 Segundos pra verificar na viatura!)", "success") local cx,cy,cz = getElementPosition(policial) local x,y,z = getElementPosition(source) local dist = getDistanceBetweenPoints3D(x,y,z,cx,cy,cz) if dist <= 7 then --setElementData ( policial, "AirNew_BuscaID", ""..getPlayerName(source).."" ) setElementData ( source, "AirNew_BuscaID_Perm", "Sim" ) setTimer ( function() setElementData ( source, "AirNew_BuscaID_Perm", "Não" ) end, 60000, 1 ) else exports.Scripts_Dxmessages:outputDx(source, "O Policial Esta Muito Longe!", "error") exports.Scripts_Dxmessages:outputDx(policial, "Você Esta Muito Longe do Jogador Abordado!", "error") end end setElementData(source,"cliente:policial",nil) if isTimer(canceltimer[source]) then killTimer(canceltimer[source]) end end addCommandHandler(cmd3,aceitar) -------------------------------------------------------------------- function cancelfix(source) local policial = getElementData(source,"cliente:policial") if isElement(policial) then exports.Scripts_Dxmessages:outputDx(policial, "O Jogador "..getPlayerName(source).." Demorou Para Mostrar ou Recusar a Identidade, +1 Nivel de Procurado!", "error") end exports.Scripts_Dxmessages:outputDx(source, "Você Demorou Demais Para Mostrar ou Recusou Mostrar Identidade e Agora esta Procurado!", "error") setElementData(source,"cliente:policial",nil) Procurado = getPlayerWantedLevel ( source ) setPlayerWantedLevel ( source, Procurado+1 ) end -------------------------------------------------------------------- function getPlayerFromPartialName(name) local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil if name then for _, player in ipairs(getElementsByType("player")) do local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower() if name_:find(name, 1, true) then return player end end end end --------------------------------------------------------------------
-
não , acredito eu é que estou errando heim algum evento pq ele tira apenas a hud padrão heim quanto isso eu gostaria de retirar tanto a hud quanto o radar personalizado
-
Opa tudo bom , sou eu dnv aki enchendo o saco , é que estou tendo problemas tentei pegar umas referencias para dar show na hud porem só consigui na hud padrão do gta e eu queria dar show na hud personalizada e no radar personalizado tbm Script ----- v bindKey( "F10", "down", function() if isShowCustomHud() == false then showCustomHud(true) showChat(true) else showCustomHud(false) showChat(false) end end) addEventHandler("onClientResourceStart", root, function() showCustomHud(true) end) function getPointFromDistanceRotation(x, y, dist, angle) local a = math.rad(90 - angle); local dx = math.cos(a) * dist; local dy = math.sin(a) * dist; return x+dx, y+dy; end function findRotation(x1,y1,x2,y2) local t = -math.deg(math.atan2(x2-x1,y2-y1)) if t < 0 then t = t + 360 end; return t; end
-
intão eu testei aki , porem n funcionou do geito que eu quero porem este script aki > function onWasted(totalAmmo, killer, killerWeapon, bodypart, stealth) if not( isGuestAccount (getPlayerAccount(source)) ) then fadeCamera (source, false) setTimer (spawnPlayer, 1000, 1, source, 1178.6553955078,-1323.6499023438,14.130801200867, 0, getPedSkin (source), 0, 0, getPlayerTeam(source))) setTimer (setCameraTarget, 1250, 1, source, source) setTimer (fadeCamera, 2000, 1, source, true) end end addEventHandler ("onPlayerWasted", getRootElement(), onWasted) --- ele funciona tipo quando o player morre com uma skin ele respawna com a mesma skin porem depois de uns 2 seg ele volta para o cj só que n sei pq o diabos isso ta acontecendo
-
Opa tudo bom eu gostaria de ter uma ideia basica de como criar um log de um chat pra eu pegar como referencia Ex: addEventHandler("onPlayerCommand",root, function(command) if command == "me" or command == "register" or command == "login" or command == "msg" then cancelEvent() end end) DESATIVAR_TWITTER = false DESATIVAR_DEEPWEB = false function MensagemAnon ( source, cmd, ...) if DESATIVAR_DEEPWEB == true then return outputChatBox ( "* Chat Desativado Temporariamente!", source, 255, 255, 255, true ) end local MessagemANS = table.concat ( { ... }, " " ); for _, player in ipairs ( getElementsByType ( "player" ) ) do MessagemANS = string.gsub(MessagemANS, "#%x%x%x%x%x%x", "") --Jogador = getPlayerName ( source ) --Jogador2 = string.gsub(Jogador, "#%x%x%x%x%x%x", "") --local Conta = getAccountName ( getPlayerAccount ( source ) ) --if Conta == "AndreJr" or Conta == "tridentgostoso" then return end if getElementData ( player, "Anti_Fome" ) ~= "Sim" then outputChatBox ( "* #A4A4A4 ᴅᴇᴇᴘ ᴡᴇʙ - "..MessagemANS, player, 255, 255, 255, true ) end end adminchat ( source, MessagemANS ) end addCommandHandler ( "u", MensagemAnon ) function MensagemTwitter ( source, cmd, ...) if DESATIVAR_TWITTER == true then return outputChatBox ( "* Chat Desativado Temporariamente!", source, 255, 255, 255, true ) end local MessagemANS = table.concat ( { ... }, " " ); for _, player in ipairs ( getElementsByType ( "player" ) ) do MessagemANS = string.gsub(MessagemANS, "#%x%x%x%x%x%x", "") Jogador = getPlayerName ( source ) Jogador2 = string.gsub(Jogador, "#%x%x%x%x%x%x", "") --local Conta = getAccountName ( getPlayerAccount ( source ) ) --if Conta == "AndreJr" or Conta == "tridentgostoso" then return end if isObjectInACLGroup ("user."..getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Console" ) ) then outputChatBox ( "* #00FA9Aᴛᴡɪᴛᴛᴇʀ - #00FF00Presidente #FF00FF- ".. Jogador2 .." #00FA9A- "..MessagemANS, player, 255, 255, 255, true ) elseif isObjectInACLGroup ("user."..getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Everyone" ) ) then outputChatBox ( "* #2E9AFEᴛᴡɪᴛᴛᴇʀ - #ffffff".. Jogador2 .." #2E9AFE- "..MessagemANS, player, 255, 255, 255, true ) end end end addCommandHandler ( "i", MensagemTwitter ) eu gostaria de criar um log que registre tudo que seja falado no ex : twitter com o login , nick e serial da pessoa
-
Opa estou com um script da net aki de spawn e respawn só que eu gostaria de quando o cara morrer e tiver com uma skin sei la id 4 não resetar para 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)
-
uma das regras é n pedir scripts prontos '-' , porem o amigo DNL291 ja respondeu só pesquisar no mta wiki , que la tem os exemplos . sei como é não saber muita coisa de script porem tbm tem que ter no minimo um pouco de procurar saber antes de querer pegar tudo pronto ou de graça . ex: addEventHandler("onClientResourceStart", getResourceRootElement(), function() guiSetInputMode("no_binds_when_editing") --Calls guiSetInputMode once and for all to not have to handle binds state dynamically end) https://wiki.multitheftauto.com/wiki/GuiSetInputMode
-
certo , porem pelo que eu entendi é que qualquer admin com painel p conseguiria ativar o vip pela acl e eu no caso queria deixar apenas para o grupo "console" para poder ativar isso seria possivel via script ou teria que mexer no painel "p" ?
-
alguem sabe como posso tar bloqueando comandos quando o play for preso na viatura ? exemplo o player n consiguir cancelar animação com o shift ou não abrir showCursor ?
- 4 replies
-
- bloquear comandos
- policial
-
(and 1 more)
Tagged with:
-
a questão do Vip_01 seria o nome do grupo do vip ?