Alexs Posted May 22, 2012 Posted May 22, 2012 (edited) Hola a Todos, Queria saber si esto funcionaria para que los Atropellos o Jugadores no te puedan matar, pero los SlothBots si: function casigod ( attacker, weapon, bodypart, loss ) if getElementType ( attacker ) == "Player" or getElementType ( attacker ) == "Vehicle" then cancelEvent() end end addEventHandler ( "onPlayerDamage", getRootElement (), casigod ) Edited May 22, 2012 by Guest Developer @ MYVAL
Edikosh998 Posted May 22, 2012 Posted May 22, 2012 Eso parece que esta copiado de algun lado...porque targetElem no esta ni definido function casigod ( attacker, weapon, bodypart, loss ) if getElementType ( attacker ) == "player" or getElementType ( attacker ) == "vehicle" then cancelEvent() end end addEventHandler ( "onPlayerDamage", getRootElement (), casigod ) WRS( World Racing Server) [server] = 8%
Alexs Posted May 22, 2012 Author Posted May 22, 2012 lo copie del ejemplo de la wiki y olvide poner el argumento attacker, pero asi deberia de funcionar? Developer @ MYVAL
Edikosh998 Posted May 22, 2012 Posted May 22, 2012 Segun lo que buscas, tiene que funcionar bien WRS( World Racing Server) [server] = 8%
Castillo Posted May 23, 2012 Posted May 23, 2012 No se puede cancelar ese evento, tenes que cancelar el onClientPlayerDamage. function casigod ( attacker, weapon, bodypart, loss ) if ( attacker ) and ( getElementType ( attacker ) == "player" ) or ( getElementType ( attacker ) == "vehicle" ) then cancelEvent ( ) end end addEventHandler ( "onClientPlayerDamage", localPlayer, casigod ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Edikosh998 Posted May 23, 2012 Posted May 23, 2012 No se puede cancelar ese evento, tenes que cancelar el onClientPlayerDamage. function casigod ( attacker, weapon, bodypart, loss ) if ( attacker ) and ( getElementType ( attacker ) == "player" ) or ( getElementType ( attacker ) == "vehicle" ) then cancelEvent ( ) end end addEventHandler ( "onClientPlayerDamage", localPlayer, casigod ) SABEEE, la verdad que me habia olvidado. Sory WRS( World Racing Server) [server] = 8%
Alexs Posted May 23, 2012 Author Posted May 23, 2012 Finalmente note que las caidas me matarian y es el principal motivo de poner el script, asi que queria saber si con esta linea funcionaria o como agregarla: ispedbot( element thePed) pensaba en agregarla asi: if exports.slotboth:ispedbot( attacker )then return o if exports.slotboth:ispedbot( attacker ) ) == true then return Pero estoy seguro de q no posee sentido Developer @ MYVAL
Edikosh998 Posted May 24, 2012 Posted May 24, 2012 No estoy muy seguro de lo de exportar, pero si la forma era "exports.slothboth:isPedBot" (Que deberia estar bien, es parecido a objetos, el slothbot seria la clase y el isPedBot una sub clase). if exports.slotboth:isPedBot( attacker ) == false then cancelEvent() -- Si no es el bot del slothbot cancelar end end Si no anda, es porque capaz esta mal escrito o la funcion no devuelve boolean, pero la idea esta bien. WRS( World Racing Server) [server] = 8%
Recommended Posts