Jump to content

Duda si funciona


Plate

Recommended Posts

Posted

Hola tengo una duda si esto funcionaria entre los zombies que son level 20 o 0 osea que tambien ande entre los de 1, 2, 3, 4, etc haci hasta el level 20

function addexp() 
local zombiesLevels = getElementData(ped,"level") 
if zombiesLevels <= 20 or 0 then 
exports.["exp_system"]:addPlayerEXP(source, 30) 
end 
end 
addEventHandler("onZombieWasted",getRootElement(),addexp) 
  

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted

1: Los zombis no tienen nivel.

2: 'ped' no esta definido en ninguna parte.

3: 'source' de onZombieWasted puede que sea el zombi, pero no el que lo mato.

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

Solid los zombies que yo uso si tienen level no te guies solamente por los de slothman :D

Muchas gracias por tu ayuda solid

addEvent ( "onZombieWasted", true ) 
addEventHandler ( "onZombieWasted", root, 
    function ( theKiller ) 
local zombiesLevels = getElementData("level") 
if zombiesLevels >= 20 or 0 then 
        exports.exp_system:addPlayerEXP ( theKiller, 300 ) 
    end 

No me funciona u.u

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted
addEvent ( "onZombieWasted", true ) 
addEventHandler ( "onZombieWasted", root, 

por que pones eso? supuestamente cuando activas el zombies ya esta el evento y no hace falta activarlo...

rsilex.png.0e6ad382b3fdc3cbe6390e3e847572c9.png
Posted
  
addEventHandler ( "onZombieWasted", root, 
function ( ammo, attacker, weapon, bodypart ) 
        if attacker then 
                local zombiesLevels = getElementData(source, "level") 
                if zombiesLevels >= 20 or 0 then 
                exports.exp_system:addPlayerEXP ( attacker, 300 ) 
        end 
end 

prueba asi aver no se si estara bien pero prueba xD

rsilex.png.0e6ad382b3fdc3cbe6390e3e847572c9.png
Posted

No me funciono supongo que es por el source por que se supone que tiene que obtener el level de los zombies

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted

No entiendo por que no funciona ya prove de muchas maneras

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted

Hay algo que no entiendo , talvez porque no sepa mucho pero

  
addEventHandler ( "onZombieWasted", root, 
function ( ammo, attacker, weapon, bodypart ) 
        if attacker then-- No especifica quien es el atacante o el que mata al zombie 
                local zombiesLevels = getElementData(source, "level") 
                if zombiesLevels >= 20 or 0 then-- solo si el zombie es level 20 o 0 funcionaria  no entre 0 y 20 
                exports.exp_system:addPlayerEXP ( killer, 300 )-- Talves seria source o (killer) 
        end 
end 

Talvez sea asi , no estoy muy seguro.

------------------------------------------------------------------------------------------

My scripts

http://community.multitheftauto.com/index.php?p=resources&s=details&id=6977

http://community.multitheftauto.com/index.php?p=resources&s=details&id=7740

Posted

Con todos los que probé me da un bad argument en el "addPlayerEXP"

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted
addEvent ( "onZombieWasted", true ) 
addEventHandler ( "onZombieWasted", root, 
    function ( killer ) 
        if ( killer and getElementType ( killer ) == "player" ) then 
            local zombiesLevels = getElementData ( source, "level" ) or 0 
            if ( zombiesLevels >= 20 ) then 
                exports.exp_system:addPlayerEXP ( killer, 300 ) 
            end 
        end 
    end 
) 

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

gracias solid me funciona

PD: pero tambien funciona entre los zombies que son entre level 20 y 0?

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted

No, eso funciona con los zombies de nivel 20 o superior.

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

Que hago para que den experiencia entre los de level 0 y 20

Visita Full GameZ DayZ Mod

Server IP: mtasa://158.69.125.144:29015

Posted
if ( zombiesLevels > 0 and zombieLevels < 21 ) then 

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.

  • Recently Browsing   0 members

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