Plate Posted October 26, 2012 Share Posted October 26, 2012 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) Link to comment
Castillo Posted October 26, 2012 Share Posted October 26, 2012 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. Link to comment
Plate Posted October 27, 2012 Author Share Posted October 27, 2012 Solid los zombies que yo uso si tienen level no te guies solamente por los de slothman 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 Link to comment
Arsilex Posted October 27, 2012 Share Posted October 27, 2012 addEvent ( "onZombieWasted", true ) addEventHandler ( "onZombieWasted", root, por que pones eso? supuestamente cuando activas el zombies ya esta el evento y no hace falta activarlo... Link to comment
Arsilex Posted October 27, 2012 Share Posted October 27, 2012 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 Link to comment
Plate Posted October 27, 2012 Author Share Posted October 27, 2012 No me funciono supongo que es por el source por que se supone que tiene que obtener el level de los zombies Link to comment
Arsilex Posted October 27, 2012 Share Posted October 27, 2012 si y supuestamente soruce seria el zombie creo e.e Link to comment
Plate Posted October 27, 2012 Author Share Posted October 27, 2012 No entiendo por que no funciona ya prove de muchas maneras Link to comment
NodZen Posted October 28, 2012 Share Posted October 28, 2012 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. Link to comment
Plate Posted October 29, 2012 Author Share Posted October 29, 2012 Con todos los que probé me da un bad argument en el "addPlayerEXP" Link to comment
Castillo Posted October 29, 2012 Share Posted October 29, 2012 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 ) Link to comment
Plate Posted October 29, 2012 Author Share Posted October 29, 2012 gracias solid me funciona PD: pero tambien funciona entre los zombies que son entre level 20 y 0? Link to comment
Castillo Posted October 30, 2012 Share Posted October 30, 2012 No, eso funciona con los zombies de nivel 20 o superior. Link to comment
Plate Posted October 30, 2012 Author Share Posted October 30, 2012 Que hago para que den experiencia entre los de level 0 y 20 Link to comment
Castillo Posted October 30, 2012 Share Posted October 30, 2012 if ( zombiesLevels > 0 and zombieLevels < 21 ) then Link to comment
Recommended Posts