eldelahoz Posted February 9, 2013 Share Posted February 9, 2013 Hola lo que pasa es que hice un script para que un objeto subiera como un acensor pero lo que pasa es que llegar a lo ultimo se baja y se sube es como se rebotara aqui esta el script objeto = createObject ( 3095, -1099.6999511719, -1052.3000488281, 877.90002441406, 0, 0, 0 ) x,y,z = getElementPosition (objeto) Zona = createColCuboid ( -1102.9949951172, -1055.9497070313, 877.95538330078, 5.75, 6.75, 50 ) function funcion (hitElement) if getElementType( hitElement ) == "player" then if getTeamName( getPlayerTeam( hitElement ) ) == "Clan" then moveObject ( objeto, 8000, -1099.69921875, -1052.3994140625, 931.79998779297 ) else outputChatBox ( "No Heres Del Clan Largate", hitElement, 0, 255, 0 ) end end end addEventHandler ( "onColShapeHit", Zona, funcion ) function funcion2 (hitElement) if getElementType( hitElement ) == "player" then if getTeamName( getPlayerTeam( hitElement ) ) == "Clan" then moveObject ( objeto, 8000, -1099.6999511719, -1052.3000488281, 877.90002441406, 0, 0, 0 ) end end end addEventHandler ( "onColShapeLeave", Zona, funcion2 ) Link to comment
MTA Team 0xCiBeR Posted February 10, 2013 MTA Team Share Posted February 10, 2013 Proba asi objeto = createObject ( 3095, -1099.6999511719, -1052.3000488281, 877.90002441406, 0, 0, 0 ) x,y,z = getElementPosition (objeto) Zona = createColCuboid ( -1102.9949951172, -1055.9497070313, 877.95538330078, 5.75, 6.75, 50 ) function funcion (hitElement) if getElementType( hitElement ) == "player" and getTeamName( getPlayerTeam( hitElement ) ) == "Clan" then moveObject ( objeto, 8000, -1099.69921875, -1052.3994140625, 931.79998779297 ) else outputChatBox ( "No Heres Del Clan Largate", hitElement, 0, 255, 0 ) end end end addEventHandler ( "onColShapeHit", Zona, funcion ) function funcion2 (hitElement) if getElementType( hitElement ) == "player" and getTeamName( getPlayerTeam( hitElement ) ) == "Clan" then moveObject ( objeto, 8000, -1099.6999511719, -1052.3000488281, 877.90002441406, 0, 0, 0 ) end end end addEventHandler ( "onColShapeLeave", Zona, funcion2 ) PD: Heres es ERES con E no H Link to comment
eldelahoz Posted February 10, 2013 Author Share Posted February 10, 2013 No meda ._. ahora no me aparece el objeto Link to comment
MTA Team 0xCiBeR Posted February 10, 2013 MTA Team Share Posted February 10, 2013 si es que me he equivocado, proba asi: objeto = createObject ( 3095, -1099.6999511719, -1052.3000488281, 877.90002441406, 0, 0, 0 ) x,y,z = getElementPosition (objeto) Zona = createColCuboid ( -1102.9949951172, -1055.9497070313, 877.95538330078, 5.75, 6.75, 50 ) function funcion (hitElement) if getElementType( hitElement ) == "player" and getTeamName( getPlayerTeam( hitElement ) ) == "Clan" then moveObject ( objeto, 8000, -1099.69921875, -1052.3994140625, 931.79998779297 ) else outputChatBox ( "No Heres Del Clan Largate", hitElement, 0, 255, 0 ) end end addEventHandler ( "onColShapeHit", Zona, funcion ) function funcion2 (hitElement) if getElementType( hitElement ) == "player" and getTeamName( getPlayerTeam( hitElement ) ) == "Clan" then moveObject ( objeto, 8000, -1099.6999511719, -1052.3000488281, 877.90002441406, 0, 0, 0 ) end end addEventHandler ( "onColShapeLeave", Zona, funcion2 ) Link to comment
Arsilex Posted February 10, 2013 Share Posted February 10, 2013 objeto = createObject ( 3095, -1099.6999511719, -1052.3000488281, 877.90002441406, 0, 0, 0 ) x,y,z = getElementPosition (objeto) Zona = createColRectangle ( -1102.9949951172, -1055.9497070313, 877.95538330078, 5,5 ) function funcion (hitElement) if getElementType( hitElement ) == "player" then if getTeamName( getPlayerTeam( hitElement ) ) == "Clan" then moveObject ( objeto, 8000, -1099.69921875, -1052.3994140625, 931.79998779297 ) else outputChatBox ( "No Heres Del Clan Largate", hitElement, 0, 255, 0 ) end end end addEventHandler ( "onColShapeHit", Zona, funcion ) function funcion2 (hitElement) if getElementType( hitElement ) == "player" then if getTeamName( getPlayerTeam( hitElement ) ) == "Clan" then moveObject ( objeto, 8000, -1099.6999511719, -1052.3000488281, 877.90002441406 ) end end end Link to comment
Alexs Posted February 10, 2013 Share Posted February 10, 2013 Al subirse, toca el Colshape, pero al moverse el objeto se sale de el y por eso se devuelve, intenta poner un segundo colShape. Link to comment
eldelahoz Posted February 10, 2013 Author Share Posted February 10, 2013 No mejor no ya pense otra cosa seria asi pero tengo un problema y es que no les aparece el mensaje ._. open = false theObject = createObject ( 3115, -946.79998779297, -941.09997558594, 928.59997558594, 0, 0, 0 ) addCommandHandler( "bajar_a", function ( ) if not open then moveObject( theObject, 5000, -946.79998779297, -941.09997558594, 725.59997558594) else outputChatBox ( "El Comando para bajar y subir es: bajar_a", hitElement, 0, 255, 0 ) open = true elseif open then moveObject( theObject, 2000, -946.79998779297, -941.09997558594, 928.59997558594 ) open = false end end ) Link to comment
Alexs Posted February 10, 2013 Share Posted February 10, 2013 open = false theObject = createObject ( 3115, -946.79998779297, -941.09997558594, 928.59997558594, 0, 0, 0 ) addCommandHandler( "bajar_a", function ( ) if not open then moveObject( theObject, 5000, -946.79998779297, -941.09997558594, 725.59997558594) outputChatBox ( "El Comando para bajar y subir es: bajar_a", hitElement, 0, 255, 0 ) open = true elseif open then moveObject( theObject, 2000, -946.79998779297, -941.09997558594, 928.59997558594 ) open = false end end ) Link to comment
eldelahoz Posted February 10, 2013 Author Share Posted February 10, 2013 Gracias pero quiero saber como puedo hacer para hacer otra alternativa de este script ya que es muy largo: open = false theObject = createObject ( 3115, -946.79998779297, -941.09997558594, 928.59997558594, 0, 0, 0 ) addCommandHandler( "avion_1", function ( ) if not open then moveObject( theObject, 8000, -946.79998779297, -941.09997558594, 725.59997558594) outputChatBox ( "El Comando para bajar y subir es: avion_1", hitElement, 0, 255, 0 ) open = true elseif open then moveObject( theObject, 5000, -946.79998779297, -941.09997558594, 928.59997558594 ) open = false end end ) open = false theObject2 = createObject ( 3115, -914.5, -941, 928.59997558594, 0, 0, 0 ) addCommandHandler( "avion_2", function ( ) if not open then moveObject( theObject2, 8000, -946.79998779297, -941.09997558594, 725.59997558594) outputChatBox ( "El Comando para bajar y subir es: avion_2", hitElement, 0, 255, 0 ) open = true elseif open then moveObject( theObject2, 5000, -914.5, -941, 928.59997558594 ) open = false end end ) open = false theObject3 = createObject ( 3115, -882, -940.8994140625, 928.59997558594, 0, 0, 0 ) addCommandHandler( "avion_3", function ( ) if not open then moveObject( theObject3, 8000, -882, -940.8994140625, 725.59997558594) outputChatBox ( "El Comando para bajar y subir es: avion_3", hitElement, 0, 255, 0 ) open = true elseif open then moveObject( theObject3, 5000, -882, -940.8994140625, 928.59997558594 ) open = false end end ) open = false theObject4 = createObject ( 3115, -947.29998779297, -965.90002441406, 927.90002441406, 0, 0, 0 ) addCommandHandler( "avion_4", function ( ) if not open then moveObject( theObject4, 8000, -947.29998779297, -965.90002441406, 725.59997558594) outputChatBox ( "El Comando para bajar y subir es: avion_4", hitElement, 0, 255, 0 ) open = true elseif open then moveObject( theObject4, 5000, -947.29998779297, -965.90002441406, 927.900024414064 ) open = false end end ) open = false theObject5 = createObject ( 3115, -914.20001220703, -965.59997558594, 927.90002441406, 0, 0, 0 ) addCommandHandler( "avion_5", function ( ) if not open then moveObject( theObject5, 8000, -914.20001220703, -965.59997558594, 725.59997558594) outputChatBox ( "El Comando para bajar y subir es: avion_5", hitElement, 0, 255, 0 ) open = true elseif open then moveObject( theObject5, 5000, -914.20001220703, -965.59997558594, 927.90002441406 ) open = false end end ) open = false theObject6 = createObject ( 3115, -881.40002441406, -965.90002441406, 927.90002441406, 0, 0, 0 ) addCommandHandler( "avion_6", function ( ) if not open then moveObject( theObject6, 8000, -881.40002441406, -965.90002441406, 725.59997558594) outputChatBox ( "El Comando para bajar y subir es: avion_6", hitElement, 0, 255, 0 ) open = true elseif open then moveObject( theObject6, 5000, -881.40002441406, -965.90002441406, 927.90002441406 ) open = false end end ) Link to comment
Recommended Posts