xXALeXx Posted January 14, 2013 Posted January 14, 2013 ¿Qué funciones usaría para que cuando el jugador esté buceando, no te mueras?
Alexs Posted January 14, 2013 Posted January 14, 2013 cancelEvent getPedOxygenLevel "onClientPlayerDamage" Developer @ MYVAL
Xperia Posted January 14, 2013 Posted January 14, 2013 function oxg() oxigen = getPedOxygenLevel ( localPlayer ) if oxigen == 0 then cancelEvent() end end addEventHandler("onClientPlayerDamage",getRootElement(),oxg) PD: Me aburria y te lo he hecho.
Alexs Posted January 14, 2013 Posted January 14, 2013 addEventHandler( "onClientPlayerDamage", localPlayer, function ( attacker ) if getPedOxygenLevel( localPlayer ) < 1 then if not attacker then cancelEvent() end end end ) Así no serán inmortales por estar en el agua. Developer @ MYVAL
xXALeXx Posted January 14, 2013 Author Posted January 14, 2013 Lo he probado y no me funciona, osea al bucear sigo muriendo.
Alexs Posted January 14, 2013 Posted January 14, 2013 Cual no te funciono? Error en el debug? EDIT: No estoy seguro de que ese evento se ejecute cuando se te acaba el oxigeno. Developer @ MYVAL
xXALeXx Posted January 14, 2013 Author Posted January 14, 2013 No me sale ningún erro, lo que estoy intentando, es al bucear, que no te baje el oxígeno y poder bucear sin morir.
Alexs Posted January 14, 2013 Posted January 14, 2013 Quizá el problema sea que el evento no se gatillo al nadar. Developer @ MYVAL
NodZen Posted January 14, 2013 Posted January 14, 2013 entonces como lo podría hacer? Lo pusiste como client?. ------------------------------------------------------------------------------------------ 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
BorderLine Posted January 15, 2013 Posted January 15, 2013 una acotacion. La funcion getPedOxygenLevel sirve desde la version 1.3.1 r4732 en adelante Sino has actualizado no funcionara En ese caso podrias agregar al mismo clientside la funcion getVersion ( ) para detectar la version del cliente. y un mensaje sugeriendo que actualize su mta tambien podrias agregar isElementInWater ( ) Actual Nick: [XGN]BorderLine Actual Clan: XLatino Actual Status: Staff, Mod Level 1 (BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline
xXALeXx Posted January 15, 2013 Author Posted January 15, 2013 Lo tengo actualizado y sigue sin funcionarme.
BorderLine Posted January 15, 2013 Posted January 15, 2013 usa debugscript 3 y vee que errores tiene el script Actual Nick: [XGN]BorderLine Actual Clan: XLatino Actual Status: Staff, Mod Level 1 (BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline
FraN-724 Posted January 16, 2013 Posted January 16, 2013 Prueba Así function water( localPlayer) if isElementInWater ( localPlayer ) then cancelEvent() end end addEventHandler( "onClientPlayerDamage", localPlayer, water )
FraN-724 Posted January 16, 2013 Posted January 16, 2013 Prueba Así function water( localPlayer) if isElementInWater ( localPlayer ) then cancelEvent() end end addEventHandler( "onClientPlayerDamage", localPlayer, water ) Fran-724, pero eso haría inmortal al jugador en el agua. Pero el Quiere eso, No morir en el Agua
Recommended Posts