Chaz-CR Posted April 26, 2013 Posted April 26, 2013 Pues bueno me gustaria saber que tengo que usar (eventos) y como combinarlos para hacer un resource sobre spawnear en el hospital mas cercano, se que es con el onPlayerWasted pero no tengo idea de como combinar todos los spawns conforme la distancia! gracias ||Age Of Battles|WarLife|RPG|DM|FR|24/7|Custom Skins|Cars|Weapons|| http://facebook.com/AoBMTA - Fanpage
AlvareZ_ Posted April 26, 2013 Posted April 26, 2013 Aqui tienes uno creado por @pakito123, anteriormente en el Foro: local spawnV = { { 255.52216, 255.324234, 0 }, { 255.52216, 255.324234, 0 }, { 255.52216, 255.324234, 0 } } local spawnL = { { 1922.7138671875, -2300.3759765625, 13.546875 }, { 2708.5712890625, -1740, 42.133285522461 }, { 1140, -1474.28515625, 15.796875 } } local spawnF = { { 255.52216, 255.324234, 0 }, { 255.52216, 255.324234, 0 }, { 255.52216, 255.324234, 0 } } addEventHandler( "onPlayerWasted", getRootElement(), function() local x, y, z = getElementPosition ( source ) local city = getZoneName ( x, y, z, true ) if city == "Las Venturas" then setTimer( spawnPlayer, 2000, 1, source, unpack ( spawnV[ math.random ( #spawnV ) ] ) ) fadeCamera (source, true) setCameraTarget (source, source) elseif city == "San Fierro" then setTimer( spawnPlayer, 2000, 1, source, unpack ( spawnF[ math.random ( #spawnF ) ] ) ) fadeCamera (source, true) setCameraTarget (source, source) elseif city == "Los Santos" then setTimer( spawnPlayer, 2000, 1, source, unpack ( spawnL[ math.random ( #spawnL ) ] ) ) fadeCamera (source, true) setCameraTarget (source, source) else setTimer( spawnPlayer, 2000, 1, source, unpack ( spawnL[ math.random ( #spawnL ) ] ) ) fadeCamera (source, true) setCameraTarget (source, source) end end )
Chaz-CR Posted April 26, 2013 Author Posted April 26, 2013 y la distancia de cada hospital? en donde la encuentro? es para que el spawn no se ponga aleatoriamente entre los lugares! ||Age Of Battles|WarLife|RPG|DM|FR|24/7|Custom Skins|Cars|Weapons|| http://facebook.com/AoBMTA - Fanpage
NodZen Posted April 26, 2013 Posted April 26, 2013 Lo que te dió AlvareZ tendria que funcionar . Porqué? Mira. Si el player está en la ciudad 'Las Venturas' cuando muere, este se spawneará en la coordenadas especificadas en cada tabla. Solo si está en una zona determinada. Por eso usa getElementPosition y getZoneName. Suerte ------------------------------------------------------------------------------------------ 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
Chaz-CR Posted April 26, 2013 Author Posted April 26, 2013 me tira los spawn random ||Age Of Battles|WarLife|RPG|DM|FR|24/7|Custom Skins|Cars|Weapons|| http://facebook.com/AoBMTA - Fanpage
Recommended Posts