Jump to content

Problema con 2 Scripts


Alexs

Recommended Posts

Posted

Hola a Todos, estos son scripts quey o habia dado por terminados, pero hoy al probarlos en el servidor de @ElMota, no funciono ninguno:

El Primero es ZC-AntiJack:

Se supone que con eso, se deberia cancelar el evento si el vehiculo esta ocupado, pero el ladron roba y entra como si nada.

--Server Side 
function antirobo ( thePlayer, seat, jacked ) 
  local autocupado = getVehicleOccupant (jacked, 0) 
       if (autocupado) then 
            cancelEvent () 
    end 
addEventHandler ( "onVehicleStartEnter", getRootElement(), antirobo ) 

Nota: @ElMota me dijo que daba error en getVehicleOccupant

El Segundo es ZC-Healer [+ agregado de GodMode]

Se supone que debe debe dar vida mientras atacas con el graffiti, pero no pasa nada:

--Client Side         
function stopDamage ( theplayer , attacker, weapon, bodypart ) 
            cancelEvent() --cancela los daños, incluyendo el del graffiti 
    end 
addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopDamage ) 

--Server Side 
function curar (attacker, attackerweapon, bodypart, loss) 
  vida = getElementHealth (source) 
        if (attackerweapon == 41) and (loss > 1) and ( vida < 99 ) then 
          setElementHealth ( source, vida + 15 ) --Se supone deberia dar + 15 de vida, aunque no estoy seguro pues me lo pasaron en el tema. 
      end 
end 
addEventHandler ("onPlayerDamage", getRootElement(), curar ) 

Me podrian ayudar, no se que mas podria hacer....

Developer @ MYVAL

Posted

Primero:

--Server Side 
function antirobo ( thePlayer, seat, jacked ) 
    if ( jacked ) then 
        cancelEvent ( ) 
    end 
end -- Te falto terminar la funcion. 
addEventHandler ( "onVehicleStartEnter", getRootElement(), antirobo ) 

Segundo:

Esta todo mal.

--Client Side         
function stopDamage ( attacker, weapon, bodypart, loss ) 
    local vida = getElementHealth ( source ) 
    if ( attacker and getElementType ( attacker ) == "player" ) and ( weapon == 41 ) and ( loss > 1 ) and ( vida < 99 ) then 
        triggerServerEvent ( "healPlayer", localPlayer ) 
        cancelEvent ( ) -- cancela los daños del graffiti. 
    end 
end 
addEventHandler ( "onClientPlayerDamage", localPlayer, stopDamage ) 

--Server Side 
function curar ( ) 
    local vida = getElementHealth ( source ) 
    setElementHealth ( source, vida + 15 ) 
end 
addEvent ( "healPlayer", true ) 
addEventHandler ("healPlayer", getRootElement(), curar ) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Si cancelas todos los daños, entonces para que queres el script que cure? si nunca van a perder vida.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
Si cancelas todos los daños, entonces para que queres el script que cure? si nunca van a perder vida.

por que con:

function stopDamage ( theplayer , attacker, weapon, bodypart ) 
            cancelEvent() 
    end 
addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopDamage ) 

los zombies si dañan

Developer @ MYVAL

Posted
Eso es porque los zombies usan setElementHealth, y eso no ejecuta el evento.

Lo se, y no me da mayor problema, y ya esta todo bien con respecto al cancelEvent, ahora veo quien me ayuda a testearlo.. Gracias, Cierren el Tema

Developer @ MYVAL

Posted

De nada.

Tema cerrado.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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