Jump to content

Search the Community

Showing results for tags 'samu'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

Found 7 results

  1. Estava configurando um script de samu que ao cair o player inicia uma animação e pode ser curado pelo samu, porem ele pode abrir paineis como f1, f2, f3 e etc, queria saber como posso cancelar isso, quando ele cair bloquear ele de usar esses paineis. Por favor me ajudem. hpMin = 20 Tempo = {} ColMedic = {} 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 function ChecarVida() for i, player in pairs (getElementsByType("player")) do if not getElementData(player, "PlayerCaido") then local conta = getAccountName(getPlayerAccount(player)) if getElementHealth(player) >= 1 then if getElementHealth(player) <= hpMin then removePedFromVehicle(player) setElementData(player, "PlayerCaido", true) setElementFrozen(player, true) setPedAnimation(player, "CRACK", "crckdeth3", -1, false, true, false) setTimer(function() if getElementData(player, "PlayerCaido") then killPlayer(player) end end, 240000, 1) end end else setPedAnimation(player, "CRACK", "crckdeth3", -1, false, true, false) end end end setTimer(ChecarVida, 200, 0) function ChecarVidaA() for i, player in pairs (getElementsByType("player")) do if getElementData(player, "PlayerCaido") then local conta = getAccountName(getPlayerAccount(player)) if getElementHealth(player) >= 31 then setElementData(player, "PlayerCaido", false) setPedAnimation(player, false) setElementFrozen(player, false ) end end end end setTimer(ChecarVidaA, 200, 0) function SetarCaidoComHS() player = source if not getElementData(player, "PlayerCaido") then removePedFromVehicle(player) setElementHealth(player, 20) setElementData(player, "PlayerCaido", true) setPedAnimation(player, "CRACK", "crckdeth3", -1, false, true, false) setTimer(function() if getElementData(player, "PlayerCaido") then killPlayer(player) end end, 240000, 1) end end addEvent("OnHS", true) addEventHandler("OnHS", getRootElement(), SetarCaidoComHS) function curar_jogador ( thePlayer, comando, nick ) if nick then if getPlayerFromPartialName ( nick ) then local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "CB") ) then local player_a_ser_curado = getPlayerFromPartialName ( nick ) local samux, samuy, samuz = getElementPosition ( thePlayer ) local curadox, curadoy, curadoz = getElementPosition ( player_a_ser_curado ) local dist = getDistanceBetweenPoints3D ( samux, samuy, samuz, curadox, curadoy, curadoz ) if player_a_ser_curado == thePlayer then outputChatBox("#bebebeVocê não pode se curar!",thePlayer,255,255,255,true) return end if ( dist > 3 ) then outputChatBox("#bebebeChegue mais perto do jogador!", thePlayer, 255, 255, 255, true) elseif ( dist < 3 )then setPedAnimation( thePlayer, "MEDIC", "CPR", 4500, true, false, false, false) setTimer ( function() setElementHealth ( player_a_ser_curado, 100 ) setPedAnimation(player_a_ser_curado, false) setElementFrozen( player_a_ser_curado, false ) setElementData(player_a_ser_curado,"PlayerCaido",false) end, 4500, 1 ) end end end end end addCommandHandler ( "curar", curar_jogador ) hpMin = 20 Tempo = {} ColMedic = {} 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 function ChecarVida() for i, player in pairs (getElementsByType("player")) do if not getElementData(player, "PlayerCaido") then local conta = getAccountName(getPlayerAccount(player)) if getElementHealth(player) >= 1 then if getElementHealth(player) <= hpMin then removePedFromVehicle(player) setElementData(player, "PlayerCaido", true) setElementFrozen(player, true) setPedAnimation(player, "CRACK", "crckdeth3", -1, false, true, false) setTimer(function() if getElementData(player, "PlayerCaido") then killPlayer(player) end end, 240000, 1) end end else setPedAnimation(player, "CRACK", "crckdeth3", -1, false, true, false) end end end setTimer(ChecarVida, 200, 0) function ChecarVidaA() for i, player in pairs (getElementsByType("player")) do if getElementData(player, "PlayerCaido") then local conta = getAccountName(getPlayerAccount(player)) if getElementHealth(player) >= 31 then setElementData(player, "PlayerCaido", false) setPedAnimation(player, false) setElementFrozen(player, false ) end end end end setTimer(ChecarVidaA, 200, 0) function SetarCaidoComHS() player = source if not getElementData(player, "PlayerCaido") then removePedFromVehicle(player) setElementHealth(player, 20) setElementData(player, "PlayerCaido", true) setPedAnimation(player, "CRACK", "crckdeth3", -1, false, true, false) setTimer(function() if getElementData(player, "PlayerCaido") then killPlayer(player) end end, 240000, 1) end end addEvent("OnHS", true) addEventHandler("OnHS", getRootElement(), SetarCaidoComHS) function curar_jogador ( thePlayer, comando, nick ) if nick then if getPlayerFromPartialName ( nick ) then local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "CB") ) then local player_a_ser_curado = getPlayerFromPartialName ( nick ) local samux, samuy, samuz = getElementPosition ( thePlayer ) local curadox, curadoy, curadoz = getElementPosition ( player_a_ser_curado ) local dist = getDistanceBetweenPoints3D ( samux, samuy, samuz, curadox, curadoy, curadoz ) if player_a_ser_curado == thePlayer then outputChatBox("#bebebeVocê não pode se curar!",thePlayer,255,255,255,true) return end if ( dist > 3 ) then outputChatBox("#bebebeChegue mais perto do jogador!", thePlayer, 255, 255, 255, true) elseif ( dist < 3 )then setPedAnimation( thePlayer, "MEDIC", "CPR", 4500, true, false, false, false) setTimer ( function() setElementHealth ( player_a_ser_curado, 100 ) setPedAnimation(player_a_ser_curado, false) setElementFrozen( player_a_ser_curado, false ) setElementData(player_a_ser_curado,"PlayerCaido",false) end, 4500, 1 ) end end end end end addCommandHandler ( "curar", curar_jogador ) hpMin = 20 Tempo = {} ColMedic = {} 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 function ChecarVida() for i, player in pairs (getElementsByType("player")) do if not getElementData(player, "PlayerCaido") then local conta = getAccountName(getPlayerAccount(player)) if getElementHealth(player) >= 1 then if getElementHealth(player) <= hpMin then removePedFromVehicle(player) setElementData(player, "PlayerCaido", true) setElementFrozen(player, true) setPedAnimation(player, "CRACK", "crckdeth3", -1, false, true, false) setTimer(function() if getElementData(player, "PlayerCaido") then killPlayer(player) end end, 240000, 1) end end else setPedAnimation(player, "CRACK", "crckdeth3", -1, false, true, false) end end end setTimer(ChecarVida, 200, 0) function ChecarVidaA() for i, player in pairs (getElementsByType("player")) do if getElementData(player, "PlayerCaido") then local conta = getAccountName(getPlayerAccount(player)) if getElementHealth(player) >= 31 then setElementData(player, "PlayerCaido", false) setPedAnimation(player, false) setElementFrozen(player, false ) end end end end setTimer(ChecarVidaA, 200, 0) function SetarCaidoComHS() player = source if not getElementData(player, "PlayerCaido") then removePedFromVehicle(player) setElementHealth(player, 20) setElementData(player, "PlayerCaido", true) setPedAnimation(player, "CRACK", "crckdeth3", -1, false, true, false) setTimer(function() if getElementData(player, "PlayerCaido") then killPlayer(player) end end, 240000, 1) end end addEvent("OnHS", true) addEventHandler("OnHS", getRootElement(), SetarCaidoComHS) function curar_jogador ( thePlayer, comando, nick ) if nick then if getPlayerFromPartialName ( nick ) then local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "CB") ) then local player_a_ser_curado = getPlayerFromPartialName ( nick ) local samux, samuy, samuz = getElementPosition ( thePlayer ) local curadox, curadoy, curadoz = getElementPosition ( player_a_ser_curado ) local dist = getDistanceBetweenPoints3D ( samux, samuy, samuz, curadox, curadoy, curadoz ) if player_a_ser_curado == thePlayer then outputChatBox("#bebebeVocê não pode se curar!",thePlayer,255,255,255,true) return end if ( dist > 3 ) then outputChatBox("#bebebeChegue mais perto do jogador!", thePlayer, 255, 255, 255, true) elseif ( dist < 3 )then setPedAnimation( thePlayer, "MEDIC", "CPR", 4500, true, false, false, false) setTimer ( function() setElementHealth ( player_a_ser_curado, 100 ) setPedAnimation(player_a_ser_curado, false) setElementFrozen( player_a_ser_curado, false ) setElementData(player_a_ser_curado,"PlayerCaido",false) end, 4500, 1 ) end end end end end addCommandHandler ( "curar", curar_jogador )
  2. Peguei um sistema de samu da internet, porém não manjo em mecher muito em script, daí queria coloca pra quando um jogador leva HeadShot ele cair ao invés dele morrer, também queria mudar o tempo de 3 minutos para 10, como Fasso isso alguém disposto a me ajudar?
  3. To com um sistema de samu, mas quando passa os 3 minutos o cara n morre alguem sabe me ajudar ?
  4. Peguei um sistema de samu da internet, porém não manjo em mecher muito em script, daí queria coloca pra quando um jogador leva HeadShot ele cair ao invés dele morrer, também queria mudar o tempo de 3 minutos para 10, como Fasso isso alguém disposto a me ajudar
  5. Olá, Recentemente tive a ideia de adicionar no meu servidor um script de SAMU, mas esse script que eu coloquei, na linha 2 ele possui uma variável que faz para você coloca o tempo, só que ela não funciona, desde então eu estava caçando codigo de tempo na internet e achei um feito pelo @DNL291 que é este: local time addEvent( "onServerCallAddSetTimer", true ) addEventHandler( "onServerCallAddSetTimer", root, function () time = setTimer(function() time = nil removeEventHandler( "onClientRender", root, renderTime ) end, 180000, 1) addEventHandler( "onClientRender", root, renderTime ) end ) function renderTime() local gDetails = getTimerDetails(time) if not gDetails then return end local remainingTime = secondsToTimeDesc( gDetails / 1000 ) dxDrawText( "Tempo de vida restante: "..tostring(remainingTime), left, top, right, bottom ) end function secondsToTimeDesc( seconds ) if seconds then local results = {} local sec = ( seconds %60 ) local min = math.floor ( ( seconds % 3600 ) /60 ) local hou = math.floor ( ( seconds % 86400 ) /3600 ) local day = math.floor ( seconds /86400 ) if day > 0 then table.insert( results, day .. ( day == 1 and " day" or " days" ) ) end if hou > 0 then table.insert( results, hou .. ( hou == 1 and " hour" or " hours" ) ) end if min > 0 then table.insert( results, min .. ( min == 1 and " minute" or " minutes" ) ) end if sec > 0 then table.insert( results, sec .. ( sec == 1 and " second" or " seconds" ) ) end return string.reverse ( table.concat ( results, ", " ):reverse():gsub(" ,", " dna ", 1 ) ) end return "" end Mas ai começou os problemas, eu não sei um jeito de colocar este tempo criado por ele conectado com o da samu que é este: hpMin = 15 Tempo = {} ColMedic = {} function getPlayerID(id) v = false for i, player in ipairs (getElementsByType("player")) do if getElementData(player, "ID") == id then v = player break end end return v end --==== function ChecarVida() for i, player in pairs (getElementsByType("player")) do if not getElementData(player, "PlayerCaido") then local conta = getAccountName(getPlayerAccount(player)) if getElementHealth(player) >= 1 then if getElementHealth(player) <= hpMin then removePedFromVehicle(player) setElementData(player, "PlayerCaido", true) setElementFrozen(player, true) setPedAnimation(player, "CRACK", "crckdeth3", 1, false, true, false) setTimer(function() if getElementData(player, "PlayerCaido") then killPed(player) end end, 240000, 1) end end else setPedAnimation(player, "CRACK", "crckdeth3", 1, false, true, false) end end end setTimer(ChecarVida, 200, 0) function ChecarVidaA() for i, player in pairs (getElementsByType("player")) do if getElementData(player, "PlayerCaido") then local conta = getAccountName(getPlayerAccount(player)) if getElementHealth(player) >= 31 then setElementData(player, "PlayerCaido", false) setPedAnimation(player, false) setElementFrozen(player, false ) end end end end setTimer(ChecarVidaA, 200, 0) function SetarCaidoComHS() player = source if not getElementData(player, "PlayerCaido") then removePedFromVehicle(player) setElementHealth(player, 20) setElementData(player, "PlayerCaido", true) setPedAnimation(player, "CRACK", "crckdeth3", 1, false, true, false) setTimer(function() if getElementData(player, "PlayerCaido") then killPed(player) end end, 240000, 1) end end addEvent("OnHS", true) addEventHandler("OnHS", getRootElement(), SetarCaidoComHS) function curar_jogador ( thePlayer, comando, id ) if id then id = tonumber ( id ) if id then local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Bombeiros") ) then local player_a_ser_curado = getPlayerID(id) if not player_a_ser_curado then return outputChatBox("#bebebeJogador não encontrado!",thePlayer,255,255,255,true) end local samux, samuy, samuz = getElementPosition ( thePlayer ) local curadox, curadoy, curadoz = getElementPosition ( player_a_ser_curado ) local dist = getDistanceBetweenPoints3D ( samux, samuy, samuz, curadox, curadoy, curadoz ) if player_a_ser_curado == thePlayer then outputChatBox("#bebebeVocê não pode se curar!",thePlayer,255,255,255,true) return end if ( dist > 3 ) then outputChatBox("#bebebeChegue mais perto do jogador!", thePlayer, 255, 255, 255, true) elseif ( dist < 3 )then setPedAnimation( thePlayer, "MEDIC", "CPR", 4500, true, false, false, false) setTimer ( function() if not isElement(player_a_ser_curado) then return end setElementHealth ( player_a_ser_curado, 100 ) setPedAnimation(player_a_ser_curado, false) setElementFrozen( player_a_ser_curado, false ) setElementData(player_a_ser_curado,"PlayerCaido",false) end, 4500, 1 ) end end else outputChatBox("#bebebe["..comando.."]: id inválido", thePlayer, 255, 255, 255, true) end else outputChatBox("#bebebeSintaxe: /"..comando.." [id]", thePlayer, 255, 255, 255, true) end end addCommandHandler ( "curar", curar_jogador ) Se alguém pode me ajudar fico agradecido, e obrigado se viu este POST
  6. Essse mod esta bugado os minutos de vida restante, quando um player atira em outra pessoa ela cai e fica os minutos de vida restante na tela enquanto o samu nao chega, e 3 minutos de espera mais quando chega ums 2 minutos porai o personagem morre, o bug esta nos minutos podem me ajudar? --[[ ################################################ # # # SAMU # # # # # # # ################################################ ]] local screenW, screenH = guiGetScreenSize() local resW, resH = 1360,768 local x, y = (screenW/resW), (screenH/resH) local screenWidth, screenHeight = guiGetScreenSize() local myScreenSource = dxCreateScreenSource(screenWidth, screenHeight) local flickerStrength = 0 local dxfont0_fonte = dxCreateFont("font/fonte.ttf", 13) addEventHandler("onClientKey", root, function (button, press) if getElementData(getLocalPlayer(),"playerFallen") then if button == "F1" or button == "F2" or button == "F3" or button == "F4" or button == "F5" or button == "F6" or button == "F7" or button == "b" or button == "F9" or button == "F10" or button == "F11" or button == "F12" then cancelEvent() end end end ) function blockDead() if getElementHealth(localPlayer) <= 20 then if not getElementData(localPlayer, "jobSAMU") then if not getElementData(localPlayer, "playerFallen") then cancelEvent() end end end end addEventHandler("onClientPlayerDamage", localPlayer, blockDead) function text() for _, player in ipairs(getElementsByType('player')) do if isElementOnScreen(player) and getElementData(player, "playerFallen") then local x, y, z = getElementPosition(player) local cx, cy, cz = getCameraMatrix() local vx, vy, vz = getPedBonePosition(player, local dist = getDistanceBetweenPoints3D(cx, cy, cz, vx, vy, vz) local drawDistance = 30.0 if (dist < drawDistance or player == target) then if(isLineOfSightClear(cx, cy, cz, vx, vy, vz, true, false, false)) then local x, y = getScreenFromWorldPosition (vx, vy, vz + 0.6) if(x and y) then local px, py = getScreenFromWorldPosition (vx, vy, vz + 0.3) local w = dxGetTextWidth("PRECISANDO DE CURA!", 1, "default-bold") local h = dxGetFontHeight(1, "default-bold") dxDrawImage(x -6 - w / 2,y - 15 - h - 12, w + 25, h + 115, 'images/hp.png', 0, 0, 0, tocolor(255, 0, 0, math.abs(math.sin(getTickCount()/170))*200)) --dxDrawRectangle(x -6 - w / 2,y - 15 - h - 12, w + 9, h, tocolor(0, 0, 0, 194), false) --dxDrawText("#FFFFFFPRECISANDO DE #FF0000CURA#FFFFFF!", x - 0 - w / 2,y - 15 - h - 12, w, h, tocolor(255,0,0, math.abs(math.sin(getTickCount()/170))*200), 1, "default-bold", "left", "top", false, false, false, true, false) end end end end end end addEventHandler("onClientRender", root, text) function convertTime(ms) local min = math.floor ( ms/60000 ) local sec = math.floor( (ms/1000)%60 ) return min, sec end function isEventHandlerAdded( sEventName, pElementAttachedTo, func ) if type( sEventName ) == 'string' and isElement( pElementAttachedTo ) and type( func ) == 'function' then local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo ) if type( aAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then for i, v in ipairs( aAttachedFunctions ) do if v == func then return true end end end end return false end function contador() local timer = interpolateBetween(deadTime, 0, 0, 0, 0, 0, (getTickCount()-tick)/deadTime, "Linear") local minutes, seconds = convertTime(timer) dxDrawText("Tempo de vida restante: "..minutes..":"..seconds, (screenW * 0.3801) + 1, (screenH * 0.9089) + 1, (screenW * 0.7059) + 1, (screenH * 1.0299) + 1, tocolor(0, 0, 0, 132), 1.00, dxfont0_fonte, "left", "top", false, false, false, false, false) dxDrawText("Tempo de vida restante: #FF0000"..minutes.."#FFFFFF:#FF0000"..seconds, screenW * 0.3801, screenH * 0.9089, screenW * 0.7059, screenH * 1.0299, tocolor(255, 255, 255, 255), 1.00, dxfont0_fonte, "left", "top", false, false, false, true, false) end function createShader() oldFilmShader, oldFilmTec = dxCreateShader("shaders/old_film.fx") end function updateShader() upDateScreenSource() if (oldFilmShader) then local flickering = math.random(100 - flickerStrength, 100)/100 dxSetShaderValue(oldFilmShader, "ScreenSource", myScreenSource); dxSetShaderValue(oldFilmShader, "Flickering", flickering); dxDrawImage(0, 0, screenWidth, screenHeight, oldFilmShader) end end function upDateScreenSource() dxUpdateScreenSource(myScreenSource) end function render() if not isEventHandlerAdded("onClientRender", root, contador) then tick = getTickCount() createShader() addEventHandler("onClientRender", root, contador) addEventHandler("onClientPreRender", root, updateShader) end end addEvent("startDeadTime", true) addEventHandler("startDeadTime", root, render) function remove() if isEventHandlerAdded("onClientRender", root, contador) then removeEventHandler("onClientRender", root, contador) removeEventHandler("onClientPreRender", root, updateShader) end end addEvent("stopDeadTime", true) addEventHandler("stopDeadTime", root, remove)
  7. --[[ ################################################ # # # SCRIPT PRODUZIDO POR # # Anderson # # # # # ################################################ ]] local screenW, screenH = guiGetScreenSize() local resW, resH = 1360,768 local x, y = (screenW/resW), (screenH/resH) local screenWidth, screenHeight = guiGetScreenSize() local myScreenSource = dxCreateScreenSource(screenWidth, screenHeight) local flickerStrength = 0 local dxfont0_fonte = dxCreateFont("font/fonte.ttf", 13) addEventHandler("onClientKey", root, function (button, press) if getElementData(getLocalPlayer(),"playerFallen") then if button == "F1" or button == "F2" or button == "F3" or button == "F4" or button == "F5" or button == "F6" or button == "F7" or button == "b" or button == "F9" or button == "F10" or button == "F11" or button == "F12" then cancelEvent() end end end ) function blockDead() if getElementHealth(localPlayer) <= 20 then if not getElementData(localPlayer, "jobSAMU") then if not getElementData(localPlayer, "playerFallen") then cancelEvent() end end end end addEventHandler("onClientPlayerDamage", localPlayer, blockDead) function text() for _, player in ipairs(getElementsByType('player')) do if isElementOnScreen(player) and getElementData(player, "playerFallen") then local x, y, z = getElementPosition(player) local cx, cy, cz = getCameraMatrix() local vx, vy, vz = getPedBonePosition(player, local dist = getDistanceBetweenPoints3D(cx, cy, cz, vx, vy, vz) local drawDistance = 30.0 if (dist < drawDistance or player == target) then if(isLineOfSightClear(cx, cy, cz, vx, vy, vz, true, false, false)) then local x, y = getScreenFromWorldPosition (vx, vy, vz + 0.6) if(x and y) then local px, py = getScreenFromWorldPosition (vx, vy, vz + 0.3) local w = dxGetTextWidth("PRECISANDO DE CURA!", 1, "default-bold") local h = dxGetFontHeight(1, "default-bold") dxDrawImage(x -6 - w / 2,y - 15 - h - 12, w + 25, h + 115, 'images/hp.png', 0, 0, 0, tocolor(255, 0, 0, math.abs(math.sin(getTickCount()/170))*200)) --dxDrawRectangle(x -6 - w / 2,y - 15 - h - 12, w + 9, h, tocolor(0, 0, 0, 194), false) --dxDrawText("#FFFFFFPRECISANDO DE #FF0000CURA#FFFFFF!", x - 0 - w / 2,y - 15 - h - 12, w, h, tocolor(255,0,0, math.abs(math.sin(getTickCount()/170))*200), 1, "default-bold", "left", "top", false, false, false, true, false) end end end end end end addEventHandler("onClientRender", root, text) function convertTime(ms) local min = math.floor ( ms/60000 ) local sec = math.floor( (ms/1000)%60 ) return min, sec end function isEventHandlerAdded( sEventName, pElementAttachedTo, func ) if type( sEventName ) == 'string' and isElement( pElementAttachedTo ) and type( func ) == 'function' then local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo ) if type( aAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then for i, v in ipairs( aAttachedFunctions ) do if v == func then return true end end end end return false end function contador() local timer = interpolateBetween(deadTime, 0, 0, 0, 0, 0, (getTickCount()-tick)/deadTime, "Linear") local minutes, seconds = convertTime(timer) dxDrawText("Tempo de vida restante: "..minutes..":"..seconds, (screenW * 0.3801) + 1, (screenH * 0.9089) + 1, (screenW * 0.7059) + 1, (screenH * 1.0299) + 1, tocolor(0, 0, 0, 132), 1.00, dxfont0_fonte, "left", "top", false, false, false, false, false) dxDrawText("Tempo de vida restante: #FF0000"..minutes.."#FFFFFF:#FF0000"..seconds, screenW * 0.3801, screenH * 0.9089, screenW * 0.7059, screenH * 1.0299, tocolor(255, 255, 255, 255), 1.00, dxfont0_fonte, "left", "top", false, false, false, true, false) end function createShader() oldFilmShader, oldFilmTec = dxCreateShader("shaders/old_film.fx") end function updateShader() upDateScreenSource() if (oldFilmShader) then local flickering = math.random(100 - flickerStrength, 100)/100 dxSetShaderValue(oldFilmShader, "ScreenSource", myScreenSource); dxSetShaderValue(oldFilmShader, "Flickering", flickering); dxDrawImage(0, 0, screenWidth, screenHeight, oldFilmShader) end end function upDateScreenSource() dxUpdateScreenSource(myScreenSource) end function render() if not isEventHandlerAdded("onClientRender", root, contador) then tick = getTickCount() createShader() addEventHandler("onClientRender", root, contador) addEventHandler("onClientPreRender", root, updateShader) end end addEvent("startDeadTime", true) addEventHandler("startDeadTime", root, render) function remove() if isEventHandlerAdded("onClientRender", root, contador) then removeEventHandler("onClientRender", root, contador) removeEventHandler("onClientPreRender", root, updateShader) end end addEvent("stopDeadTime", true) addEventHandler("stopDeadTime", root, remove)
×
×
  • Create New...