Plate Posted July 9, 2012 Posted July 9, 2012 Hola quisiera saber si con el extrahealth podria daarle vida extra a el que se pusiera el skin 300 se puede hacer eso?
Castillo Posted July 9, 2012 Posted July 9, 2012 Usa este evento para detectar cuando le cambia el skin a un jugador: https://wiki.multitheftauto.com/wiki/OnE ... odelChange
Plate Posted July 9, 2012 Author Posted July 9, 2012 Yo lo necesitaria para ponerle vida a los bot con minigun de mi server que spawnean en una posicion random de las que yo puse solid serviria ? ya que como me dijistes si lo pongo en una posicion random el bot no tendria la vida exportada podria ponersela al skin
Alexs Posted July 9, 2012 Posted July 9, 2012 Si no me equivoco ese script tiene algo malo al editar la vida de un Ped
BorderLine Posted July 9, 2012 Posted July 9, 2012 intenta con un getElementModel y el evento de zombies onZombieSpawn nose si funcionara, pero hay muichos post con respecto a zombies con extrahealth o bots
Castillo Posted July 9, 2012 Posted July 9, 2012 Para darle vida extra a un "ped" o un "player" podes usar el recurso "extra_health" que acabo de crear y subir en remplazo al de Benxamix, ya que no funcionaba. https://community.multitheftauto.com/ind ... ls&id=5195
Plate Posted July 9, 2012 Author Posted July 9, 2012 Muuchas gracias solid como siempre resuelves mis problemas te lo agradesco mucho mucho mucho Otra cosa como puedo crear funciones para exportar ejemplo con el systema de reset que me ayudo alex quisiera crear una funcion para exportar qe seria getPlayerReset y setPlayerReset se podria?
Alexs Posted July 9, 2012 Posted July 9, 2012 Si los Reset se guardan en los Account Data si, por que en los Element Data se pierde con cada reconnect
Plate Posted July 9, 2012 Author Posted July 9, 2012 si los tengo con account data pero nose como crear las funciones para exportar PD: solid el extra_health tuyo lo puedo utilizar con el bot que se spawnea en la posiciones random?
Castillo Posted July 9, 2012 Posted July 9, 2012 Si, lo probe con el de "zombies" y funciono, asi que con los "slothbots" tambien tiene que funcionar .
Alexs Posted July 9, 2012 Posted July 9, 2012 (edited) Quiza algo asi: function getPlayerReset ( jugador ) if ( jugador ) then getAccountData( jugador, "Reset") end end function setPlayerOneMoreReset ( jugador ) if ( jugador ) then local resets = getAccountData( jugador, "Reset") setAccountData( jugador, "Reset", resets + 1 ) end end function setPlayerReset ( jugador, resets ) if ( jugador ) then setAccountData( jugador, "Reset", resets ) end end No se hacer funciones exportadas, y eso es lo que mejor me imagino PD: Para exportar debes poner esto en el meta.xml Edited July 9, 2012 by Guest
Plate Posted July 9, 2012 Author Posted July 9, 2012 Por que lo hize con los bot random y murio de muy pocos tiros
Alexs Posted July 9, 2012 Posted July 9, 2012 Por que lo hize con los bot random y murio de muy pocos tiros Postea tu intento
Plate Posted July 9, 2012 Author Posted July 9, 2012 local randomSpawnTable = { { 1086.6645507813, 1076.1888427734, 10.838157653809,}, { -2086.9196777344, 173.74137878418, 35.0546875 }, { -2667.5134277344, 734.33197021484, 27.953125 }, { -2497.6953125, -697.30908203125, 139.3203125 }, { -2333.6032714844, -1621.1364746094, 483.71069335938 }, { 1862.423828125, 2624.6528320313, 13.8719085693 } } function Bot ( ) local random = math.random ( #randomSpawnTable ) local x, y, z = unpack ( randomSpawnTable [ random ] ) slothbot = exports [ "slothbot" ]:spawnBot ( x, y, z, 90, math.random ( 300, 303 ), 0, 0, Boss, 38, hunting, true ) exports.extra_health:setElementExtraHealth ( slothbot, 5000 ) end addEventHandler ( "onResourceStart", resourceRoot, Bot ) setTimer(Bot,300000,0)
Castillo Posted July 9, 2012 Posted July 9, 2012 Lo probe y no lo pude matar aun ( ya que tiene 5000 de vida ).
Plate Posted July 9, 2012 Author Posted July 9, 2012 para el bot que esta en una posicion estable iene esa vida pero los random no
Plate Posted July 10, 2012 Author Posted July 10, 2012 de la nada empeso a andar gracias solid Alex que no entiendo como exportarlas por ejemplo lo quise testiar y puse function test (player) exports [ "EX" ]:setPlayerReset (player, 5) end addCommandHandler("Res",test) y no sirvio
Castillo Posted July 10, 2012 Posted July 10, 2012 Quiza algo asi: function getPlayerReset ( jugador ) if ( jugador ) then getAccountData( jugador, "Reset") end end function setPlayerOneMoreReset ( jugador ) if ( jugador ) then local resets = getAccountData( jugador, "Reset") setAccountData( jugador, "Reset", resets + 1 ) end end function setPlayerReset ( jugador, resets ) if ( jugador ) then setAccountData( jugador, "Reset", resets ) end end No se hacer funciones exportadas, y eso es lo que mejor me imagino PD: Para exportar debes poner esto en el meta.xml Las funciones de get/setAccountData se usan con cuentas, no jugadores. function getPlayerReset ( jugador ) if ( jugador ) then local account = getPlayerAccount ( jugador ) if ( account and not isGuestAccount ( account ) ) then return tonumber ( getAccountData ( account, "Reset") ) or 0 else return false end else return false end end function setPlayerReset ( jugador, resets ) if ( jugador ) then local account = getPlayerAccount ( jugador ) if ( account and not isGuestAccount ( account ) ) then return setAccountData ( account, "Reset", resets ) else return false end else return false end end
Plate Posted July 10, 2012 Author Posted July 10, 2012 exelente pero el script sigue sin funcionar eso esta bien?
Plate Posted July 10, 2012 Author Posted July 10, 2012 (edited) pero por que el script no funciona todabia function getPlayerReset ( jugador ) if ( jugador ) then local account = getPlayerAccount ( jugador ) if ( account and not isGuestAccount ( account ) ) then return tonumber ( getAccountData ( account, "Reset") ) or 0 else return false end else return false end end function setPlayerReset ( jugador, Reset ) if ( jugador ) then local account = getPlayerAccount ( jugador ) if ( account and not isGuestAccount ( account ) ) then return setAccountData ( account, "Reset", Reset ) else return false end else return false end end el test function test (player,commandName) exports.EX:setPlayerReset(player, 5) end addCommandHandler("Res",test) Edited July 10, 2012 by Guest
Recommended Posts