elcanario Posted March 12, 2014 Share Posted March 12, 2014 (edited) Hola a todos, me gustaria pedir ayuda para un script ya que no termino de solucionar el error yo , lo agradecería porque me es necesario para jugar con mis amigos en mi server, Os explico: Descarge un script de la comunidad "este" https://community.multitheftauto.com/ind ... ils&id=347 Y quiero hacer que cada skin de zombie spawnee en un sitio diferente, por ejemplo el skin 13 en las venturas, el skin 22 en los santos y el skin 40 en el area 51 " es un suponer " , Esto lo tengo puesto con spawnpoints para que spawneen cuando te asercas a un punto de la ciudad, He separado los archivos y he puesto un skin en un archivo y otro skin en otro, y resulta que al spawnear los monstruos me sigue spawneando el skin de las venturas y el skin de los santos y area 51 juntos en el mismo punto de spawn, creo que al tener dos archivos iguales me esta creando un conflicto, No me gusta hacer trabajar a los demás pero no he tenido mas remedio que buscar vuestra ayuda ya que muchos de vosotros teneis mas conocimiento del tema que yo, Espero respuesta y se los agradesco de antemano. Edited March 13, 2014 by Guest Link to comment
BorderLine Posted March 12, 2014 Share Posted March 12, 2014 con createZombie creo que podria funcionar https://wiki.multitheftauto.com/wiki/Slothman/Zombies el resto va a tu imaginacion Link to comment
elcanario Posted March 12, 2014 Author Share Posted March 12, 2014 sustituyo esto element createZombie( 0000 x, 0000 y, 0000 z, [int rotation = 0, int skinID = 13, int interior = 0, int dimension = 0 ] ) por esto en el .map? Gracias por responder Link to comment
BorderLine Posted March 12, 2014 Share Posted March 12, 2014 no, deberas crearlo con un script serverside createZombie( float x, float y, float z, [int rotation = 0, int skinID = 0, int interior = 0, int dimension = 0 ] ) y pones las cordenadas de donde quieres que den spawn tus zombies. y le pones el evento onResourceStart Link to comment
elcanario Posted March 12, 2014 Author Share Posted March 12, 2014 Digamos pongo eso en el archivo lua Zombie_Server ? y quedaria asi supongo.. function createZombie( float x, float y, float z, [int rotation = 0, int skinID = 13, int interior = 0, int dimension = 0 ] ) addEventHandler("onResourceStart") Link to comment
BorderLine Posted March 12, 2014 Share Posted March 12, 2014 Hay en este caso pones x,y,z donde quieres que den spawn los zombies, pero solo creara 1 zombie, deberas hacer un timer o algo para que se creen mas. function zombieVenturas() vZomb = createZombie( float x, float y, float z, [int rotation = 0, int skinID = 0, int interior = 0, int dimension = 0 ] ) end addEventHandler("onResourceStart",getRootElement(),zombieVenturas) Link to comment
elcanario Posted March 12, 2014 Author Share Posted March 12, 2014 esta correcto? espero no equibocarme.. function zombieVenturas() vZomb = createZombie( float x, float y, float z, [int rotation = 0, int skinID = 13, int interior = 0, int dimension = 0 ] ) end addEventHandler("onResourceStart",getRootElement(),zombieVenturas) setTimer ( function (zomb, spawn) if ( isElement ( zomb, dies ) ) Link to comment
Alexs Posted March 12, 2014 Share Posted March 12, 2014 esta correcto? espero no equibocarme.. function zombieVenturas() vZomb = createZombie( float x, float y, float z, [int rotation = 0, int skinID = 13, int interior = 0, int dimension = 0 ] ) end addEventHandler("onResourceStart",getRootElement(),zombieVenturas) setTimer ( function (zomb, spawn) if ( isElement ( zomb, dies ) ) Tienes un código de poco sentido en 'setTimer' y tienes errores de sintaxis en la segunda linea. Link to comment
elcanario Posted March 12, 2014 Author Share Posted March 12, 2014 acabo de probarlo y funciona, el problema es que no me spawnean despues de morir, y se me han ido los skins.. todo muy extraño la verdad Link to comment
Alexs Posted March 12, 2014 Share Posted March 12, 2014 acabo de probarlo y funciona, el problema es que no me spawnean despues de morir, y se me han ido los skins.. todo muy extraño la verdad Veo difícil que funcione correctamente, ya que la función de la quinta linea (dentro de 'setTimer') ni siquiera esta terminada. Link to comment
elcanario Posted March 12, 2014 Author Share Posted March 12, 2014 function zombieVenturas() vZomb = createZombie( float x, float y, float z, [int rotation = 0, int skinID = 13, int interior = 0, int dimension = 0 ] ) end addEventHandler("onResourceStart",getRootElement(),zombieVenturas) setTimer ( function (zomb, spawn) ) Lo he puesto asi el problema es que no me spawnea , no se si estara mal lo que he puesto soy nuevo en esto del mta , no se parece nada a samp. Link to comment
BorderLine Posted March 12, 2014 Share Posted March 12, 2014 porfavor, https://wiki.multitheftauto.com/wiki/SetTimer lea los argumentos de un setTimer Link to comment
elcanario Posted March 12, 2014 Author Share Posted March 12, 2014 function zombieVenturas() vZomb = createZombie( float x, float y, float z, [int rotation = 0, int skinID = 13, int interior = 0, int dimension = 0 ] ) end addEventHandler("onResourceStart",getRootElement(),zombieVenturas) local timer = setTimer(zomb,3000,2) entendi esto.. Link to comment
BorderLine Posted March 12, 2014 Share Posted March 12, 2014 function zombieVenturas() vZomb = createZombie( float x, float y, float z, [int rotation = 0, int skinID = 13, int interior = 0, int dimension = 0 ] ) end addEventHandler("onResourceStart",getRootElement(),zombieVenturas) setTimer(zombieVenturas,3000,2)--esto ejecutara la funcion zombieVenturas cada 3 segundos, solo 2 veces. Link to comment
elcanario Posted March 12, 2014 Author Share Posted March 12, 2014 que debo hacer para que spawne siempre despues de matarlo ? Link to comment
elcanario Posted March 13, 2014 Author Share Posted March 13, 2014 He encontrado un apartado en el zombie_server el cual hace lo del create zombie, --EXPORTED FUNCTIONS!!!!!!!!!!!!!! function createZombie ( x, y, z, rot, skin, interior, dimension ) createZombie ( -2164.3, 2772.7, 167.1, 0, 301, 0, 0 ) if (table.getn( everyZombie ) < newZombieLimit ) then --this part handles the args if not x then return false end if not y then return false end if not z then return false end if not rot then rot = math.random (1,359) end if not skin then randomZskin = math.random ( 1, table.getn ( ZombiePedSkins ) ) skin = ZombiePedSkins[randomZskin] end if not interior then interior = 0 end if not dimension then dimension = 0 end --this part spawns the ped local zomb = createPed (tonumber(skin),tonumber(x),tonumber(y),tonumber(z))--spawns the ped --if successful, this part applies the zombie settings/args if (zomb ~= true) then setTimer ( setElementInterior, 100, 1, zomb, tonumber(interior)) --sets interior setTimer ( setElementDimension, 100, 1, zomb, tonumber(dimension)) --sets dimension setElementData ( zomb, "zombie", true ) setElementData ( zomb, "forcedtoexist", true ) setTimer ( function (zomb, rot) if ( isElement ( zomb ) ) then setPedRotation ( zomb, rot ) end end, 500, 1, zomb, rot ) setTimer ( function (zomb) if ( isElement ( zomb ) ) then setElementData ( zomb, "status", "idle" ) end end, 2000, 1, zomb ) setTimer ( function (zomb) if ( isElement ( zomb ) ) then setElementData ( zomb, "forcedtoexist", true ) end end, 1000, 1, zomb ) setTimer ( function (zomb) if ( isElement ( zomb ) ) then table.insert( everyZombie, zomb ) end end, 1000, 1, zomb ) triggerClientEvent ( "Zomb_STFU", getRootElement(), zomb ) return zomb --returns the zombie element else return false --returns false if there was a problem end Lo tengo puesto asi, pero creo que lo tengo mal, me podrian decir donde debo poner el skin exactamente y las coordenadas? porque no se donde colocarlo exactamente ni las coordenadas ni el skin, he hecho varias pruebas pero no me spawnean los zombies, aun asi me sale el numerito abajo a la derecha , Porfavor alguien que sepa que haga el favor y diga llevo 8 horas en esto intentando buscar solucion y me estoy empezando a jalar de los pelos , Le daria un beso en el culo al que me ayude a spawnear un zombie del tipo que quiero donde quiero exactamente , Link to comment
MTA Team 0xCiBeR Posted March 14, 2014 MTA Team Share Posted March 14, 2014 Eso no se modifica, eso se llama EXPORT. Se utiliza para llamar a funciones desde otro script.. Link to comment
Castillo Posted March 14, 2014 Share Posted March 14, 2014 Ya se lo explique bien por PM hace unos dias. Link to comment
elcanario Posted March 15, 2014 Author Share Posted March 15, 2014 Si porfavor cierren este tema, castillo el otro dia tubo una bella paciencia conmigo y me logro ayudar en lo que queria , doy gracias a todos los que me habeis aportado ayuda tambien. Un saludo Link to comment
Recommended Posts