sumariello Posted April 27, 2013 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)
xXMADEXx Posted April 27, 2013 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 )
Tete omar Posted April 27, 2013 Posted April 27, 2013 Can you tell have you put your code serverside or clientside? and why are you getting player's skin for?
Tete omar Posted April 27, 2013 Posted April 27, 2013 I still don't get why are you getting player's skin for, can you post meta.xml file here?
Mittell Buurman Posted April 27, 2013 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.
manawydan Posted April 27, 2013 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)
sumariello Posted April 27, 2013 Author Posted April 27, 2013 codes that I have to put up with? and with what means?
iPrestege Posted April 27, 2013 Posted April 27, 2013 You have to learn somethings about "Lua" https://forum.multitheftauto.com/viewtopic.php?f=148&t=40809 < >
iPrestege Posted April 28, 2013 Posted April 28, 2013 https://forum.multitheftauto.com/viewtopic.php?f=91&t=47897
manawydan Posted April 28, 2013 Posted April 28, 2013 can be useful. use /debugscript 3 setDevelopmentMode ( true ) showcol
Jaysds1 Posted April 28, 2013 Posted April 28, 2013 Sorry, but can you post the code using these: [xml][/xml] .
panos144 Posted April 29, 2013 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)
Jaysds1 Posted April 29, 2013 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)
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