depato123 Posted July 6, 2013 Posted July 6, 2013 Hola, necesito ayuda. Tengo un recurso que si pasas por un pickup te teletransporta el problema es el siguiente pickup1 = createPickup(-2529.199,2249.30,5,3,1318,0) function teleport(player) if getElementType(player)=="player" then local vehicle=getPedOccupiedVehicle(player) if source == pickup1 then setElementPosition(vehicle, -2525.69, 2272.69, -3) setElementRotation(vehicle, 0, 0, 332) end end end addEventHandler("onPickupHit", getRootElement(), teleport) pickup2 = createPickup(-2523.10,2277,-3,3,1318,0) function teleport(player) if getElementType(player)=="player" then local vehicle=getPedOccupiedVehicle(player) if source == pickup2 then setElementPosition(vehicle, -2526.10, 2255.80, 5) setElementRotation(vehicle, 0, 0, 334) end end end addEventHandler("onPickupHit", getRootElement(), teleport) pickup3 = createPickup(-2561.399,2256.300,5.099,3,1318,0) function teleport(player) if getElementType(player)=="player" then local vehicle=getPedOccupiedVehicle(player) if source == pickup3 then setElementPosition(vehicle, -2552.10, 2269.10, 0) setElementRotation(vehicle, 0, 0, 0) end end end addEventHandler("onPickupHit", getRootElement(), teleport) pickup4 = createPickup(-2552.399,2274.5,0,3,1318,0) function teleport(player) if getElementType(player)=="player" then local vehicle=getPedOccupiedVehicle(player) if source == pickup4 then setElementPosition(vehicle, -2558.60, 2262.30, 5.09) setElementRotation(vehicle, 0, 0, 334) end end end addEventHandler("onPickupHit", getRootElement(), teleport) El pickup 3 y 4 funcionan bien pero el 1 y 2 no funcionan y si desactivo el 3 y 4 funcionan ¿hay alguna solución?
NodZen Posted July 6, 2013 Posted July 6, 2013 Cambiale el nombre a tus funciones. ------------------------------------------------------------------------------------------ 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
Castillo Posted July 6, 2013 Posted July 6, 2013 Cambiales el nombre a las funciones o pone todas en una usando 'elseif'. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
depato123 Posted July 6, 2013 Author Posted July 6, 2013 (edited) ¿Como es eso de elseiff? ¿un ejemplo de como usarlo? Edited July 6, 2013 by Guest
Castillo Posted July 6, 2013 Posted July 6, 2013 if ( source == pickup1 ) then -- Hace algo elseif ( source == pickup2 ) then -- Hace algo end San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
depato123 Posted July 6, 2013 Author Posted July 6, 2013 !Ayudaaa¡ intente hacer esto pero ahora no se generan los pickups pickup1 = createPickup(-2529.199,2249.30,5,3,1318,0) pickup2 = createPickup(-2523.10,2277,-3,3,1318,0) function teleport(player) if getElementType(player)=="player" then local vehicle=getPedOccupiedVehicle(player) if source == pickup1 then setElementPosition(vehicle, -2525.69, 2272.69, -3) setElementRotation(vehicle, 0, 0, 332) elseif ( source == pickup2 ) then setElementPosition(vehicle, -2526.10, 2255.80, 5) setElementRotation(vehicle, 0, 0, 334) end end end end addEventHandler("onPickupHit", getRootElement(), teleport)
Castillo Posted July 6, 2013 Posted July 6, 2013 Tenes un 'end' de mas. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
depato123 Posted July 6, 2013 Author Posted July 6, 2013 Tenes un 'end' de mas. No me di cuenta , gracias ya esta
Castillo Posted July 6, 2013 Posted July 6, 2013 De nada. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Recommended Posts