Jump to content

Ayuda con script


elcanario

Recommended Posts

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. :|:oops:

Edited by Guest
Link to comment

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

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
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

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

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
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

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
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...