MTA Team 0xCiBeR Posted April 15, 2013 MTA Team Share Posted April 15, 2013 Hola como podria hacer para que cuando 1 zombie gordo(que tenga skin de gordo), ya se bombero o alguno otro, al morir, que explote..??? Esto es lo que hize...Aunque no crea la explosion??... addEventHandler("onZombieWasted",root, function (source) local posX,posY,posY = getElementPosition( source ) if ( getElementModel ( source ) == 22 ) then createExplosion ( posX, posY, posZ, 10 ) end end) Link to comment
Alexs Posted April 15, 2013 Share Posted April 15, 2013 Si estas en un recurso aparte, recuerda añadir el evento con: addEvent y quita 'source' de la función. Link to comment
MTA Team 0xCiBeR Posted April 15, 2013 Author MTA Team Share Posted April 15, 2013 Puse asi y sigue sin crearse la explosion?.. addEvent("onZombieWasted",true) addEventHandler("onZombieWasted",root, function () local posX,posY,posY = getElementPosition( source ) if ( getElementModel ( source ) == 22 ) then createExplosion ( posX, posY, posZ, 10 ) end end) Link to comment
NodZen Posted April 15, 2013 Share Posted April 15, 2013 Para que usas source en getElementPosition? Si tienes que obtener las coordenadas del zombie , no del player. Link to comment
MTA Team 0xCiBeR Posted April 15, 2013 Author MTA Team Share Posted April 15, 2013 xq el source del evento es un zombie verdad?.... ademas da igual se crearia la explosion en el player..Pero no se crea ni en el zombie ni en el player Link to comment
NodZen Posted April 15, 2013 Share Posted April 15, 2013 Probalo asi haber function ( zombie ) if getElementType ( zombie ) == "ped" and getElementModel ( zombie ) == 22 then local x,y,z = getElementPosition ( zombie ) createExplosion ( x, y, z, 10 ) end end addEvent("onZombieWasted",true) addEventHandler("onZombieWasted", getRootElement(), ) Link to comment
MTA Team 0xCiBeR Posted April 15, 2013 Author MTA Team Share Posted April 15, 2013 noop tampoco Link to comment
MTA Team 0xCiBeR Posted April 15, 2013 Author MTA Team Share Posted April 15, 2013 esta bien..ahi lei la wiki de los zombies...el source del evento es el zombie que muere...asi que no se Link to comment
NodZen Posted April 15, 2013 Share Posted April 15, 2013 ok, Saca esos eventos y prueva con este: onPedWasted Link to comment
MTA Team 0xCiBeR Posted April 15, 2013 Author MTA Team Share Posted April 15, 2013 no tampoco funciona... :7 Link to comment
EstrategiaGTA Posted April 16, 2013 Share Posted April 16, 2013 ok, Saca esos eventos y prueva con este: onPedWasted ¿Prueva? Link to comment
Plate Posted April 16, 2013 Share Posted April 16, 2013 ok, Saca esos eventos y prueva con este: onPedWasted ¿Prueva? Prueba* addEvent ( "onZombieWasted", true ) addEventHandler ( "onZombieWasted", root, function ( killer ) if ( killer and getElementType ( killer ) == "player" ) then local zombieSkin = getElementModel(source) if (zombieSkin == 22) then createExplosion(x, y, z, 10) end end end ) Link to comment
MTA Team 0xCiBeR Posted April 16, 2013 Author MTA Team Share Posted April 16, 2013 Mmm no funcaa... Link to comment
Sensacion Posted April 17, 2013 Share Posted April 17, 2013 addEventHandler("onZombieWasted",root, function () local posX,posY,posZ = getElementPosition( source ) if ( getElementModel ( source ) == 22 ) then createExplosion ( posX, posY, posZ, 10 ) end end ) Link to comment
MTA Team 0xCiBeR Posted April 18, 2013 Author MTA Team Share Posted April 18, 2013 Sensacion es el mismo script que el mio..... doble :facepalm: ._. Link to comment
Plate Posted April 18, 2013 Share Posted April 18, 2013 Pero cual es el error en el debugscript con mi script Link to comment
Sensacion Posted April 19, 2013 Share Posted April 19, 2013 Sensacion es el mismo script que el mio..... doble :facepalm: ._. que raro, a mi me funcionó la explosión, no lo usé con un zombie, sino con un player normal, y con el otro evento, y no es el mismo, el tuyo es "posY,posY" doble coordenada. "Y" Link to comment
Castillo Posted April 19, 2013 Share Posted April 19, 2013 addEvent ( "onZombieWasted", true ) addEventHandler ( "onZombieWasted", root, function ( ) local posX, posY, posZ = getElementPosition ( source ) if ( getElementModel ( source ) == 22 ) then createExplosion ( posX, posY, posZ, 10 ) end end ) Link to comment
MTA Team 0xCiBeR Posted April 19, 2013 Author MTA Team Share Posted April 19, 2013 tampoco funciona Solid Link to comment
MTA Team 0xCiBeR Posted April 19, 2013 Author MTA Team Share Posted April 19, 2013 Pero cual es el error en el debugscript con mi script Pues no da error ._. Link to comment
AlvareZ_ Posted April 19, 2013 Share Posted April 19, 2013 addEvent ( "onZombieWasted", true ) addEventHandler ( "onZombieWasted", root, function ( ) local pX, pY, pZ = getElementPosition ( source ) if ( getElementModel ( source ) == 22 ) then createExplosion ( pX, pY, pZ, 10, source ) end end ) Link to comment
MTA Team 0xCiBeR Posted April 19, 2013 Author MTA Team Share Posted April 19, 2013 Tampoco ._. Link to comment
Castillo Posted April 19, 2013 Share Posted April 19, 2013 Lo tenes puesto como server side el script, no? Link to comment
MTA Team 0xCiBeR Posted April 19, 2013 Author MTA Team Share Posted April 19, 2013 Lol....Lo tenia puesto server side... pero escrito asi serrver gracias solid y gracias a los demas e.e Link to comment
Recommended Posts