+Razer+ Posted June 23, 2013 Posted June 23, 2013 Hey guys i have a problem in mapping i am making a base for my gang but i don't know how to make a moving gate i try to make a gate but it was not working object = createobject (975, 2596.3100585938, -2015.4100341797, 4.539999961853) maker = createmarker (975, 2596.3100585938, -2015.4100341797, 4.539999961853, "Cylinder", 2, 100, 0, 0, 100) function gateo(player) local skin = getElementModel (hitPlayer) if skin ==248 then moveobject(object, 100, 2599, -2015.4100341797, 4.539999961853) else outputChatBox("sorry, you're not a SoA member, this gate will not open for you.",player,255,0,0) end end addEventHandler ("onMarkHit",gateo) function getec (player) moveObject(object, 975, 2596.3100585938, -2015.4100341797, 4.539999961853) end addEventHandler("onMarkerLeave",getec) I watch a video in youtube but it was hard to understand i want to make a gate which will open when a player will come near it and i also want that gate to open only for skin id 248 and sorry for my bad english
Vision Posted June 23, 2013 Posted June 23, 2013 object = createObject ( 975, 2596.3100585938, -2015.4100341797, 4.539999961853 ) maker = createMarker ( 2596.3100585938, -2015.4100341797, 4.539999961853, "cylinder", 2, 100, 0, 0, 100 ) function gateo ( player ) local skin = getElementModel ( player ) if ( skin == 248 ) then moveObject ( object, 100, 2599, -2015.4100341797, 4.539999961853 ) else outputChatBox ( "sorry, you're not a SoA member, this gate will not open for you.", player, 255, 0, 0 ) end end addEventHandler ( "onMarkerHit", maker, gateo ) function getec ( player ) moveObject ( object, 975, 2596.3100585938, -2015.4100341797, 4.539999961853 ) end addEventHandler ( "onMarkerLeave", maker, getec )
iMr.3a[Z]eF Posted June 23, 2013 Posted June 23, 2013 object = createObject ( 975, 2596.3100585938, -2015.4100341797, 4.539999961853 ) maker = createMarker ( 2596.3100585938, -2015.4100341797, 4.539999961853, "cylinder", 2, 100, 0, 0, 100 ) function gateo ( player ) local skin = getElementModel ( player ) if ( skin == 248 ) then moveObject ( object, 100, 2599, -2015.4100341797, 4.539999961853 ) else outputChatBox ( "sorry, you're not a SoA member, this gate will not open for you.", player, 255, 0, 0 ) end end addEventHandler ( "onMarkerHit", maker, gateo ) function getec ( player ) moveObject ( object, 975, 2596.3100585938, -2015.4100341797, 4.539999961853 ) end addEventHandler ( "onMarkerLeave", maker, getec ) the marker you just created is in the gate object = createObject ( 975, 2596.3100585938, -2015.4100341797, 4.539999961853 ) marker = createMarker ( x,y,z - 2, "cylinder", 2, 100, 0, 0, 100 ) local x,z,y = getElementPosition( object ) function gateo ( player ) local skin = getElementModel ( player ) if ( skin == 248 ) then moveObject ( object, 100, 2599, -2015.4100341797, 4.539999961853 ) else outputChatBox ( "sorry, you're not a SoA member, this gate will not open for you.", player, 255, 0, 0 ) end end addEventHandler ( "onMarkerHit", marker, gateo ) function getec ( player ) moveObject ( object, 975, 2596.3100585938, -2015.4100341797, 4.539999961853 ) end addEventHandler ( "onMarkerLeave", marker, getec )
iPrestege Posted June 23, 2013 Posted June 23, 2013 object = createObject ( 975, 2596.3100585938, -2015.4100341797, 4.539999961853 ) maker = createMarker ( 2596.3100585938, -2015.4100341797, 4.539999961853, "cylinder", 2, 100, 0, 0, 100 ) function gateo ( player ) local skin = getElementModel ( player ) if ( skin == 248 ) then moveObject ( object, 100, 2599, -2015.4100341797, 4.539999961853 ) else outputChatBox ( "sorry, you're not a SoA member, this gate will not open for you.", player, 255, 0, 0 ) end end addEventHandler ( "onMarkerHit", maker, gateo ) function getec ( player ) moveObject ( object, 975, 2596.3100585938, -2015.4100341797, 4.539999961853 ) end addEventHandler ( "onMarkerLeave", maker, getec ) the marker you just created is under the gate object = createObject ( 975, 2596.3100585938, -2015.4100341797, 4.539999961853 ) marker = createMarker ( x,y,z - 2, "cylinder", 2, 100, 0, 0, 100 ) local x,z,y = getElementPosition( object ) function gateo ( player ) local skin = getElementModel ( player ) if ( skin == 248 ) then moveObject ( object, 100, 2599, -2015.4100341797, 4.539999961853 ) else outputChatBox ( "sorry, you're not a SoA member, this gate will not open for you.", player, 255, 0, 0 ) end end addEventHandler ( "onMarkerHit", marker, gateo ) function getec ( player ) moveObject ( object, 975, 2596.3100585938, -2015.4100341797, 4.539999961853 ) end addEventHandler ( "onMarkerLeave", marker, getec ) lol? This isn't a problem he can change it castro code should work just fine.
iMr.3a[Z]eF Posted June 23, 2013 Posted June 23, 2013 lol? This isn't a problem he can change it castro code should work just fine. he is new in scripting @+Eclipse+
+Razer+ Posted June 23, 2013 Author Posted June 23, 2013 Thx for help now i know how to make a moving object but how to change the marker color ? i want transparent marker color not Red color
iMr.3a[Z]eF Posted June 24, 2013 Posted June 24, 2013 Thx for help now i know how to make a moving object but how to change the marker color ? i want transparent marker color not Red color press the function setMarkerColor -- or createMarker -- read the argument
+Razer+ Posted June 25, 2013 Author Posted June 25, 2013 ah i don't know why this gate is not moving up object = createObject ( 980, 2497.1799316406, 2773.2600097656, 12.630000114441, 0, 0, 90.186767578125 ) marker = createMarker ( 2495.7800292969,2772.9799804688,10.819999694824 , "cylinder", 2, 100, 0, 0, 255 ) function gateo ( player ) local skin = getElementModel ( player ) if ( skin == 287 ) then moveObject ( object, 100, 2497.1799316406, 2773.2600097656, 18, 0, 0, 90.186767578125 ) else outputChatBox ( "sorry, you're not a USAS member, You can't enter in this base.", player, 255, 0, 0 ) end end addEventHandler ( "onMarkerHit", maker, gateo ) function getec ( player ) moveObject ( object, 980, 2497.1799316406, 2773.2600097656, 12.630000114441, 0, 0, 90.186767578125 ) end addEventHandler ( "onMarkerLeave", maker, getec ) I can see the gate but when i go near that gate it is not opening
iMr.3a[Z]eF Posted June 25, 2013 Posted June 25, 2013 you didnt checked the player's element object = createObject ( 980, 2497.1799316406, 2773.2600097656, 12.630000114441, 0, 0, 90.186767578125 ) marker = createMarker ( 2495.7800292969,2772.9799804688,10.819999694824 , "cylinder", 2, 100, 0, 0, 255 ) function gateo ( player ) local skin = getElementModel ( player ) if getElementType( player ) == "player" then if ( skin == 287 ) then moveObject ( object, 100, 2497.1799316406, 2773.2600097656, 18, 0, 0, 90.186767578125 ) else outputChatBox ( "sorry, you're not a USAS member, You can't enter in this base.", player, 255, 0, 0 ) end end end addEventHandler ( "onMarkerHit", maker, gateo ) function getec ( player ) if getElementType( player ) == "player" then moveObject ( object, 980, 2497.1799316406, 2773.2600097656, 12.630000114441, 0, 0, 90.186767578125 ) end end addEventHandler ( "onMarkerLeave", maker, getec )
+Razer+ Posted June 26, 2013 Author Posted June 26, 2013 Ah still it is not working the gate is not moving up and that Outputchatbox is also not working object = createObject ( 980, 2497.1799316406, 2773.2600097656, 12.630000114441, 0, 0, 90.186767578125 ) marker = createMarker ( 2495.7800292969,2772.9799804688,8, "cylinder", 2, 0, 0, 0, 255 ) function gateo ( player ) if getElementType( player ) == "player" then if ( skin == 287 ) then moveObject ( object, 100, 2497.1799316406, 2773.2600097656, 18, 0, 0, 90.186767578125 ) else outputChatBox ( "sorry, you're not a USAS member, You can't enter in this base.", player, 255, 0, 0 ) end end end addEventHandler ( "onMarkerHit", maker, gateo ) function getec ( player ) if getElementType( player ) == "player" then moveObject ( object, 980, 2497.1799316406, 2773.2600097656, 12.630000114441, 0, 0, 90.186767578125 ) end end addEventHandler ( "onMarkerLeave", maker, getec )
JuniorMelo Posted June 26, 2013 Posted June 26, 2013 Test object = createObject ( 980, 2497.1799316406, 2773.2600097656, 12.630000114441, 0, 0, 90.186767578125 ) markerx = createMarker ( 2495.7800292969,2772.9799804688,10, "cylinder", 2, 0, 0, 0, 255 ) function gateo(thePlayer) if getElementModel( thePlayer ) == 248 then moveObject (object, 2000, 2497.1799316406, 2773.2600097656, 18, 0, 0, 90.186767578125 ) else outputChatBox ( "sorry, you're not a USAS member, You can't enter in this base.", thePlayer, 255, 0, 0 ) end end addEventHandler( "onMarkerHit", markerx, gateo ) function gatec(thePlayer) if getElementModel( thePlayer ) == 248 then moveObject (object, 1000, 2497.1799316406, 2773.2600097656, 12.630000114441, 0, 0, 90.186767578125 ) end end addEventHandler( "onMarkerLeave", markerx, gatec )
+Razer+ Posted June 27, 2013 Author Posted June 27, 2013 How i can make 2 moving gates in 1 map ? i try to make it but there are bugs
Castillo Posted June 27, 2013 Posted June 27, 2013 Use the same script for another one, that's one method.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now