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) 
  

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.

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

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...

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

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.

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 
) 

  • Recently Browsing   0 members

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