Jump to content

[Ayuda] Problema con resouce "greenzones"


Recommended Posts

Hola muchachos otra vez tengo un problema xD

En esta ocacion con el resource "greenzones"; ya no se como arreglarlo iva a cambiarme por antiZ que es de zombies.

El tema es tengo un comando /dm creado por lLinux que cancela el daño del cliente, saca el HUD etc tambien hace que la vida no disminuya, cuando se lo pone pero cuando se entra a la greenzone, y luego se sale de la greenzone el daño vuelve al client, el hud, todo y con eso PERO... la vida no disminuye y mis clientes pueden atacar a la gente y no les hacen daño y abusan.

Script creado por lLinux [CLIENT]

  
modop = false 
function pasivo() 
    if (modop == false) then 
        modop = true 
        addEventHandler ("onClientPlayerDamage", getLocalPlayer(), stopDamage) 
        addEventHandler ("onClientPlayerStealthKill", getLocalPlayer(), stopDamage) 
        addEventHandler ("onClientPedDamage", getLocalPlayer(), stopDamage) 
        setElementAlpha (getLocalPlayer(), 255) 
        toggleControl ("fire", false) 
        toggleControl ("aim_weapon", false) 
        toggleControl ("vehicle_fire", false) 
        toggleControl ("vehicle_secondary_fire ", false) 
        showPlayerHudComponent ("weapon", false) 
        showPlayerHudComponent ("crosshair", false) 
        showPlayerHudComponent ("ammo", false) 
        triggerServerEvent("DmON", getLocalPlayer(), getLocalPlayer()) 
    else 
        modop = false 
        removeEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopDamage ) 
        removeEventHandler ( "onClientPlayerStealthKill", getLocalPlayer(), stopDamage ) 
        removeEventHandler ( "onClientPedDamage", getLocalPlayer(), stopDamage ) 
        setElementAlpha (getLocalPlayer(), 255) 
        toggleControl ("fire", true) 
        toggleControl ("aim_weapon", true) 
        toggleControl ("vehicle_fire", true) 
        toggleControl ("vehicle_secondary_fire ", true) 
        showPlayerHudComponent ("weapon", true) 
        showPlayerHudComponent ("crosshair", true) 
        showPlayerHudComponent ("ammo", true) 
        triggerServerEvent("DmOFF", getLocalPlayer(), getLocalPlayer()) 
    end 
end 
addCommandHandler("dm", pasivo) 
  
function NoKill() 
    if (modop == true) then 
        addEventHandler ("onClientPlayerDamage", getLocalPlayer(), stopDamage) 
        addEventHandler ("onClientPlayerStealthKill", getLocalPlayer(), stopDamage) 
        addEventHandler ("onClientPedDamage", getLocalPlayer(), stopDamage) 
        setElementAlpha (getLocalPlayer(), 255) 
        toggleControl ("fire", false) 
        toggleControl ("aim_weapon", false) 
        toggleControl ("vehicle_fire", false) 
        toggleControl ("vehicle_secondary_fire ", false) 
        showPlayerHudComponent ("weapon", false) 
        showPlayerHudComponent ("crosshair", false) 
        showPlayerHudComponent ("ammo", false) 
    end 
end 
addEventHandler("onClientPlayerWasted", getLocalPlayer(), NoKill) 
  
function stopDamage () 
        cancelEvent() 
end 
  

Script greenzones [sERVER]

addEventHandler ("onResourceStart",getResourceRootElement(getThisResource()), 
function() 
  local allGreenzones = getElementsByType ("radararea") 
  for i,v in ipairs (allGreenzones) do 
    local r,g,b,a = getRadarAreaColor (v) 
    if (r == 0) and (g == 255) and (b == 0) and (a == 127) then 
      local x,y = getElementPosition (v) 
      local sx,sy = getRadarAreaSize (v) 
      local col = createColCuboid (x,y, -50, sx,sy, 7500) 
      setElementID (col, "greenzoneColshape") 
    end 
  end 
end) 
  
addEventHandler ("onColShapeHit", getRootElement(),  
function(hitElement, matchingDimension) 
  if (isElement(hitElement)) and (getElementType (hitElement) == "player") and (getElementID (source) == "greenzoneColshape") then 
    toggleControl (hitElement, "fire", false) 
    toggleControl (hitElement, "next_weapon", false) 
    toggleControl (hitElement, "previous_weapon", false) 
    toggleControl (hitElement, "aim_weapon", false) 
    toggleControl (hitElement, "vehicle_fire", false) 
    showPlayerHudComponent (hitElement, "ammo", false) 
    showPlayerHudComponent (hitElement, "weapon", false) 
    triggerClientEvent (hitElement, "enableGodMode", hitElement) 
  end 
end) 
  
addEventHandler ("onColShapeLeave", getRootElement(),  
function(leaveElement, matchingDimension) 
  if (getElementType (leaveElement) == "player") and (getElementID (source) == "greenzoneColshape") then 
    toggleControl (leaveElement, "fire", true) 
    toggleControl (leaveElement, "next_weapon", true) 
    toggleControl (leaveElement, "previous_weapon", true) 
    toggleControl (leaveElement, "aim_weapon", true) 
    toggleControl (leaveElement, "vehicle_fire", true) 
    showPlayerHudComponent (leaveElement, "ammo", true) 
    showPlayerHudComponent (leaveElement, "weapon", true) 
    triggerClientEvent (leaveElement, "disableGodMode", leaveElement) 
  end 
end) 

Habra forma de solucionarlo?

Gracias.

Edited by Guest
Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...