Mateito14 Posted July 19, 2013 Posted July 19, 2013 Hola me pueden ayudar a crear un comando de teleport, para un rampa que esta en el aire, me refiero a poner /rampa y que me teletransporte . yo conozco el teleport que te metes en un cilindro o una corona y te lleva, lo tengo pero me de problemas.
Arsilex Posted July 19, 2013 Posted July 19, 2013 addCommandHandler("lala", function(player) setElementPosition(player, 0, 0, 0) end esto te sirve cambias lala por tu comando y 0,0,0 por la posicion.
Mateito14 Posted July 19, 2013 Author Posted July 19, 2013 Ya tengo todo creado pero no funciona el comando addCommandHandler("rampa1", function(player) setElementPosition(player, -1739.3228759766, -972.6015625, 612.13439941406) end Y la meta ya la tengo y me funciona, pero pongo /rampa1 y no funciona .
Mateito14 Posted July 19, 2013 Author Posted July 19, 2013 No funciona quedo asi addCommandHandler("rampa1"), function(player) setElementPosition(player, -1739.3228759766, -972.6015625, 612.13439941406) end No se donde mas va el parentecis y probe ponerlo despues de la coma pero tampoco. .
BorderLine Posted July 19, 2013 Posted July 19, 2013 addCommandHandler("rampa1"), function(player) setElementPosition(player, -1739.3228759766, -972.6015625, 612.13439941406) end)
Bc# Posted July 21, 2013 Posted July 21, 2013 ¿Es idea mia o tienes un parentesis demas despues de "rampa1"?
Anyelberth Posted July 21, 2013 Posted July 21, 2013 Emm. . . Para Que Tengas Un Poco Mas De Seguridad, Si Tu Quieres Que Solo Te Teletransporte a Ti Por Tu Nick, Podrías Hacer Esto: function teleport() setElementPosition(getPlayerFromName("TuNickEnElServer"), -1739.3228759766, -972.6015625, 612.13439941406) end addCommandHandler ( "Alacazan", teleport) ------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------ y Si Quieres Que Funcione Para Ti o Otros, As Esto: function teleport(thePlayer) setElementPosition(thePlayer, -1739.3228759766, -972.6015625, 612.13439941406) end addCommandHandler ( "Alacazan", teleport) Si Te Da Algun Error Dimelo. EDIT: Quien Lo Diría. El Estudiante Supera a Los Maestros.
TheCrazy17 Posted July 21, 2013 Posted July 21, 2013 Yo tengo así en mi servidor, funciona dentro y fuera de coches, osea te puedes transportar con coches y sin coches Ejemplo: (es server-side) local posiciones = { { 1994, -2446, 14 }, { 1951.7915039063, -2403.7248535156, 14 }, { 1950.404296875, -2432.5302734375, 14 }, } function posicionJugador ( thePlayer, command ) local azar = math.random ( #posiciones ) local veh = getPedOccupiedVehicle(thePlayer) if (veh) then setElementPosition(veh, unpack ( posiciones [ azar ] ) ) else setElementPosition(thePlayer, unpack ( posiciones [ azar ] ) ) end outputChatBox ( "#FF0000*".. getPlayerName(thePlayer) .." #D5E0E5se transporto a #FF8000/ls", root, 0, 255, 0, true ) end addCommandHandler ( "ls", posicionJugador )
Anyelberth Posted July 21, 2013 Posted July 21, 2013 Yo tengo así en mi servidor, funciona dentro y fuera de coches, osea te puedes transportar con coches y sin coches Ejemplo: (es server-side) local posiciones = { { 1994, -2446, 14 }, { 1951.7915039063, -2403.7248535156, 14 }, { 1950.404296875, -2432.5302734375, 14 }, } function posicionJugador ( thePlayer, command ) local azar = math.random ( #posiciones ) local veh = getPedOccupiedVehicle(thePlayer) if (veh) then setElementPosition(veh, unpack ( posiciones [ azar ] ) ) else setElementPosition(thePlayer, unpack ( posiciones [ azar ] ) ) end outputChatBox ( "#FF0000*".. getPlayerName(thePlayer) .." #D5E0E5se transporto a #FF8000/ls", root, 0, 255, 0, true ) end addCommandHandler ( "ls", posicionJugador ) Pero Tu Lo Tienes Con 3 Teleports Al Azar. Así Que Seria: function teleport(thePlayer) local vehicle = getPedOccupiedVehicle(thePlayer) if (vehicle) then setElementPosition(vehicle, -1739.3228759766, -972.6015625, 612.13439941406) end end addCommandHandler ( "Alacazan", teleport)
TheCrazy17 Posted July 21, 2013 Posted July 21, 2013 Yo tengo así en mi servidor, funciona dentro y fuera de coches, osea te puedes transportar con coches y sin coches Ejemplo: (es server-side) local posiciones = { { 1994, -2446, 14 }, { 1951.7915039063, -2403.7248535156, 14 }, { 1950.404296875, -2432.5302734375, 14 }, } function posicionJugador ( thePlayer, command ) local azar = math.random ( #posiciones ) local veh = getPedOccupiedVehicle(thePlayer) if (veh) then setElementPosition(veh, unpack ( posiciones [ azar ] ) ) else setElementPosition(thePlayer, unpack ( posiciones [ azar ] ) ) end outputChatBox ( "#FF0000*".. getPlayerName(thePlayer) .." #D5E0E5se transporto a #FF8000/ls", root, 0, 255, 0, true ) end addCommandHandler ( "ls", posicionJugador ) Pero Tu Lo Tienes Con 3 Teleports Al Azar. Así Que Seria: function teleport(thePlayer) local vehicle = getPedOccupiedVehicle(thePlayer) if (vehicle) then setElementPosition(vehicle, -1739.3228759766, -972.6015625, 612.13439941406) end end addCommandHandler ( "Alacazan", teleport) Si, es un ejemplo, pero asi como lo pusiste tu no funcionaria solo con coches?
Anyelberth Posted July 21, 2013 Posted July 21, 2013 Entonces Seria De Esta Manera: function teleport(thePlayer) local vehicle = getPedOccupiedVehicle(thePlayer) local teleportElement = ( vehicle and vehicle or thePlayer ) setElementPosition(teleportElement, -1739.3228759766, -972.6015625, 612.13439941406) end addCommandHandler ( "Alacazan", teleport)
Recommended Posts