sumariello Posted April 27, 2013 Share Posted April 27, 2013 Hello everyone, I created this script to a gate just do not work in the game as I do? SFAirport1Gate54 = createObject (3115, -267.79998779297, 3050.6999511719, 103.59999847412, 0, 0, 1.99951171875) function OpenGates(thePlayer) local id = getElementModel (thePlayer ) moveObject (SFAirport1Gate54, 5000, -267.79998779297, 3050.6999511719, 118.09999847412) end addCommandHandler("carrisu", OpenGates) function CloseGates(thePlayer) local id = getElementModel (thePlayer ) moveObject (SFAirport1Gate54, 5000, -267.79998779297, 3050.6999511719, 103.59999847412) end addCommandHandler("carrigiu", CloseGates) Link to comment
xXMADEXx Posted April 27, 2013 Share Posted April 27, 2013 TRy this, but if it dosnt work, use "/debugscript 3" in game. SFAirport1Gate54 = createObject (3115, -267.79998779297, 3050.6999511719, 103.59999847412, 0, 0, 2) addCommandHandler("carrisu", function (thePlayer) local id=getElementModel(thePlayer) moveObject(SFAirport1Gate54,5000,-267.79998779297,3050.6999511719,118.09999847412) end ) addCommandHandler("carrigiu", function (thePlayer) local id=getElementModel(thePlayer) moveObject(SFAirport1Gate54,5000,-267.79998779297,3050.6999511719,103.59999847412) end ) Link to comment
sumariello Posted April 27, 2013 Author Share Posted April 27, 2013 I did it but the gate does not appear Link to comment
Tete omar Posted April 27, 2013 Share Posted April 27, 2013 Can you tell have you put your code serverside or clientside? and why are you getting player's skin for? Link to comment
sumariello Posted April 27, 2013 Author Share Posted April 27, 2013 this is all there is in the folder Link to comment
Tete omar Posted April 27, 2013 Share Posted April 27, 2013 I still don't get why are you getting player's skin for, can you post meta.xml file here? Link to comment
Mittell Buurman Posted April 27, 2013 Share Posted April 27, 2013 Where is your colshape? and like tete said. What is your purpose of getting the player's skin function openGates(thePlayer) moveObject(lsAirportGate1, 1000, -2864.300488281, 455.10000610352, 5.5999999046326) end addEventHandler("onColshapeHit", LSAirportCol, openGates) function closeGates(thePlayer) moveObject(lsAitportGate1, 1000, -2863.300488281, 463.79998779297, 5.5999999046326, 5.5999999046326 end addEventHandler("onColshapeLeave", LSAirportCol, closeGates) Try that. Link to comment
manawydan Posted April 27, 2013 Share Posted April 27, 2013 I hope to help. see example gate = createObject(980, 212.19999694824, 1875.3000488281, 12.39999961853) col = createColCuboid(205, 1870.3000488281, 9.39999961853, 14, 10,8) function hit(player) if getElementType(player) == "player" then moveObject(gate, 5900, 223.19999694824, 1875.3000488281, 12.39999961853) end end addEventHandler("onColShapeHit", col, hit) function leave(player) if getElementType(player) == "player" then moveObject(gate, 5900, 212.19999694824, 1875.3000488281, 12.39999961853) end end addEventHandler("onColShapeLeave", col, leave) Link to comment
sumariello Posted April 27, 2013 Author Share Posted April 27, 2013 codes that I have to put up with? and with what means? Link to comment
iPrestege Posted April 27, 2013 Share Posted April 27, 2013 You have to learn somethings about "Lua" https://forum.multitheftauto.com/viewtopic.php?f=148&t=40809 < > Link to comment
sumariello Posted April 27, 2013 Author Share Posted April 27, 2013 does not open the gate T_T Link to comment
iPrestege Posted April 27, 2013 Share Posted April 27, 2013 Post the script you are using .. Link to comment
iPrestege Posted April 28, 2013 Share Posted April 28, 2013 Please post the code using Lua / Lua Tag . Link to comment
iPrestege Posted April 28, 2013 Share Posted April 28, 2013 https://forum.multitheftauto.com/viewtopic.php?f=91&t=47897 Link to comment
manawydan Posted April 28, 2013 Share Posted April 28, 2013 can be useful. use /debugscript 3 setDevelopmentMode ( true ) showcol Link to comment
sumariello Posted April 28, 2013 Author Share Posted April 28, 2013 still does not work Link to comment
Jaysds1 Posted April 28, 2013 Share Posted April 28, 2013 Sorry, but can you post the code using these: [xml][/xml] . Link to comment
panos144 Posted April 29, 2013 Share Posted April 29, 2013 function createTheGate () SFAirport1Gate54 = createObject ( 3115, -267.79998779297, 3050.6999511719, 103.59999847412, 0, 0, 1.99951171875 ) end addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource () ), createTheGate ) function OpenGates ( ) moveObject ( SFAirport1Gate54, 5000, -267.79998779297, 3050.6999511719, 118.09999847412 ) end addCommandHandler("carrisu",OpenGates) function CloseGates () moveObject ( SFAirport1Gate54, 5000, -267.79998779297, 3050.6999511719, 103.59999847412 ) end addCommandHandler("carrigiu",CloseGates) Link to comment
Jaysds1 Posted April 29, 2013 Share Posted April 29, 2013 try this: local SFAirport1Gate54 = createObject ( 3115, -267.79998779297, 3050.6999511719, 103.59999847412, 0, 0, 1.99951171875 ) addCommandHandler("open",function() moveObject ( SFAirport1Gate54, 5000, -267.79998779297, 3050.6999511719, 118.09999847412 ) end) addCommandHandler("close",function() moveObject ( SFAirport1Gate54, 5000, -267.79998779297, 3050.6999511719, 103.59999847412 ) end) Link to comment
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