Narutimmy Posted February 12, 2013 Posted February 12, 2013 Hola, lo que pasa es que ya e usado y editado varios diferentes, desde que cada cierto tiempo spawne en cordenadas aleatorias de una tabla. Tambien que al entrar a una Area al matar Cierta cantidad de zombis Spawne, pero lo que yo quiero es que spawnee en ciertos lugares pero en lugar de cierto tiempo pero cuando aya cierta concentracion de personas. Pense en crear varias coldshare creo se llaman que abarquen todo el mapa como estilo... un tablero de ajedres y que de igual manera al matar muchos zombis spawnee... pero es mas laborioso creo yo. Que me aconsejan?
Plate Posted February 12, 2013 Posted February 12, 2013 Me quede en tabla despues no entendi nada mas
NodZen Posted February 12, 2013 Posted February 12, 2013 Quieres poner un minimo de players en un zona, asi se spawnea el bot?.
Narutimmy Posted February 12, 2013 Author Posted February 12, 2013 Al final quedo asi local colshape = createColRectangle ( -2960, -2960, 5920, 5920 ) -- estas son las coordenadas donde se va a crear el boss para cambiarlas solamente copien la posicion x e y de su admin panel zombiesMatados = 0 function zona (attacker, weapon, bodypart) if ( isElementWithinColShape ( source, colshape ) ) then zombiesMatados = ( zombiesMatados + 1 ) if ( zombiesMatados == 10 ) then --Numero de Zombis por Matar if ( not isElement ( slothbot1 ) ) then local x, y, z = getElementPosition(attacker) slothbot1 = exports [ "slothbot" ]:spawnBot ( x+10, y, z, 90, math.random(33, 35), 0, 0, ex, 38, "hunting", true ) myBlip = createBlipAttachedTo ( slothbot1, 23 ) local id = getElementModel ( slothbot1 ) if id == 33 then exports.extra_health:setElementExtraHealth(slothbot1, 10000) outputChatBox("[bOSS]:Boss medium spawned", getRootElement(), 155, 155, 155, false) elseif id == 34 then exports.extra_health:setElementExtraHealth(slothbot1, 50000) outputChatBox("[bOSS]:Boss high spawned", getRootElement(), 155, 155, 155, false) elseif id == 35 then exports.extra_health:setElementExtraHealth(slothbot1, 5000) outputChatBox("[bOSS]:Boss low spawned", getRootElement(), 155, 155, 155, false) end end end end end addEventHandler ( "onZombieWasted", getRootElement(), zona ) addEventHandler("onBotSpawn",getRootElement(),zona) el problema es que quiero que tengan distintas armas y paguen diferente exp y dinero
Plate Posted February 12, 2013 Posted February 12, 2013 addEventHandler ( "onBotWasted", root, function ( theKiller ) model = getElemntModel(slothbot1) -- slothbot 1 cambialo if model == 300 then exports.exp_system:addPlayerEXP ( theKiller, 5000 ) givePlayerMoney(theKiller, 5000) elseif model == 301 then exports.exp_system:addPlayerEXP(theKiller, 2500) givePlayerMoney(theKiller, 2500) elseif model == 302 then exports.exp_system:addPlayerEXP(theKiler, 1000) givePlayerMoney(theKiller, 1000) end end ) eso es para dar exp y plata despues para las armas usa giveWeapon
Narutimmy Posted February 12, 2013 Author Posted February 12, 2013 addEventHandler ( "onBotWasted", root, function ( theKiller ) model = getElemntModel(slothbot1) -- slothbot 1 cambialo if model == 300 then exports.exp_system:addPlayerEXP ( theKiller, 5000 ) givePlayerMoney(theKiller, 5000) elseif model == 301 then exports.exp_system:addPlayerEXP(theKiller, 2500) givePlayerMoney(theKiller, 2500) elseif model == 302 then exports.exp_system:addPlayerEXP(theKiler, 1000) givePlayerMoney(theKiller, 1000) end end ) eso es para dar exp y plata despues para las armas usa giveWeapon Asi? local colshape = createColRectangle ( -2960, -2960, 5920, 5920 ) -- estas son las coordenadas donde se va a crear el boss para cambiarlas solamente copien la posicion x e y de su admin panel zombiesMatados = 0 function zona (attacker, weapon, bodypart) if ( isElementWithinColShape ( source, colshape ) ) then zombiesMatados = ( zombiesMatados + 1 ) if ( zombiesMatados == 10 ) then --Numero de Zombis por Matar if ( not isElement ( slothbot1 ) ) then local x, y, z = getElementPosition(attacker) slothbot1 = exports [ "slothbot" ]:spawnBot ( x+10, y, z+3, 90, math.random(33, 35), 0, 0, ex, 0, "hunting", true ) myBlip = createBlipAttachedTo ( slothbot1, 23 ) local id = getElementModel ( slothbot1 ) if id == 33 then exports.extra_health:setElementExtraHealth(slothbot1, 10000) giveWeapon( slothbot1, 38, 9999, true ) outputChatBox("[bOSS]:Boss medium spawned", getRootElement(), 155, 155, 155, false) elseif id == 34 then exports.extra_health:setElementExtraHealth(slothbot1, 50000) outputChatBox("[bOSS]:Boss high spawned", getRootElement(), 155, 155, 155, false) elseif id == 35 then exports.extra_health:setElementExtraHealth(slothbot1, 5000) giveWeapon( slothbot1, 8, 1, true ) outputChatBox("[bOSS]:Boss low spawned", getRootElement(), 155, 155, 155, false) end end end end end addEventHandler ( "onZombieWasted", getRootElement(), zona ) addEventHandler("onBotSpawn",getRootElement(),zona)
Narutimmy Posted February 12, 2013 Author Posted February 12, 2013 Si No funciona, los matas y no dan nada de dinero o exp y ademas no traen las armas
Narutimmy Posted February 12, 2013 Author Posted February 12, 2013 Era un error en getElementModel esaba mal escrito jeje, pero me falta las armas
Plate Posted February 13, 2013 Posted February 13, 2013 Entonces usa giveWeapon setPedWeaponSlot setTimer eso
Narutimmy Posted February 13, 2013 Author Posted February 13, 2013 Entonces usa giveWeapon setPedWeaponSlot setTimer eso Ya lo ise deotra manera.Gracias, ahora creo tengo un bug... creo que estan spawneando con mas vida de la que els pongo.
Plate Posted February 13, 2013 Posted February 13, 2013 Comproba la vida del bot function vida() local vida = exports.extra_health:getElementExtraHealth(slothbot1) -- acordate de cambiar esto de slothbot1 outputChatBox("la vida del boss es ".. vida.."", 255, 0, 255) end addCommandHanlder("lavida", vida)
Alexs Posted February 13, 2013 Posted February 13, 2013 Comproba la vida del bot function vida() local vida = exports.extra_health:getElementExtraHealth(slothbot1) -- acordate de cambiar esto de slothbot1 outputChatBox("la vida del boss es ".. vida.."", 255, 0, 255) end addCommandHanlder("lavida", vida) addCommandHandler*
Narutimmy Posted February 13, 2013 Author Posted February 13, 2013 Fail por escribir rapido jeje , ahora intento tratar de ponerlo junto a la exp la vida del boss o algo asi
Arsilex Posted February 13, 2013 Posted February 13, 2013 Eso no creo que se pueda es mas que posible lo que el dice es poner la vida del boss en un dx..
Plate Posted February 14, 2013 Posted February 14, 2013 Yo entendi mal pense que queria mesclar el script para dar experiencia con el script para spawnear el boss
Arsilex Posted February 14, 2013 Posted February 14, 2013 la verdad es que no entendí ni yo lo que entendiste ._.
Narutimmy Posted February 14, 2013 Author Posted February 14, 2013 la verdad es que no entendí ni yo lo que entendiste ._.
Recommended Posts