HunT Posted July 15, 2011 Posted July 15, 2011 Hi . . I always use the same method to move the objects with marker (always and work) And now in debugscript 3 - - - - Bad Argument @ "moveObject" - - - - -This is crazy local root = getRootElement() local this = getThisResource() local resourceRoot = getResourceRootElement(this) local localPlayer = getLocalPlayer() local Marker = {} addEventHandler("onClientResourceStart", resourceRoot, function() local st3reotxd1 = engineLoadTXD("st3reo3458.txd") engineImportTXD( st3reotxd1, 3458 ) local st3reotxd2 = engineLoadTXD("st3reo8838.txd") engineImportTXD( st3reotxd2, 8838 ) local st3reotxd3 = engineLoadTXD("st3reo5848.txd") engineImportTXD( st3reotxd3, 5848 ) Marker[1] = createMarker(5137.5, -57.07, 1.2, "corona", 5, 0, 0, 0) local object1 = createObject ( 3458, 5137.5068359375, -54.855049133301, -1.2999992370605, 0, 0, 90 ) setWeather(0) setSkyGradient() setCloudsEnabled ( false ) end ) addEventHandler("onClientResourceStop", root, function(res) if res == this then setWeather (0) setWaveHeight ( 0 ) setSkyGradient( 0, 0, 0, 0, 0, 0) setCloudsEnabled ( false ) end end ) addEventHandler("onClientMarkerHit", root, function(player, matchingDimension) if not matchingDimension then return end if player == localPlayer and isPedInVehicle(player) then local vehicle = getPedOccupiedVehicle(player) if source == Marker[1] then moveObject ( object1, 3000, 5137.5068359375, 146.6568145752, -1.2999992370605) end end end ) The Problem ? (idk ) Tnx @Huntone_
JR10 Posted July 15, 2011 Posted July 15, 2011 Not a bug. local variables exists only inside the block (function or w/e it's in) So here: local root = getRootElement() local this = getThisResource() local resourceRoot = getResourceRootElement(this) local localPlayer = getLocalPlayer() local Marker = {} addEventHandler("onClientResourceStart", resourceRoot, function() local st3reotxd1 = engineLoadTXD("st3reo3458.txd") engineImportTXD( st3reotxd1, 3458 ) local st3reotxd2 = engineLoadTXD("st3reo8838.txd") engineImportTXD( st3reotxd2, 8838 ) local st3reotxd3 = engineLoadTXD("st3reo5848.txd") engineImportTXD( st3reotxd3, 5848 ) Marker[1] = createMarker(5137.5, -57.07, 1.2, "corona", 5, 0, 0, 0) object1 = createObject ( 3458, 5137.5068359375, -54.855049133301, -1.2999992370605, 0, 0, 90 ) setWeather(0) setSkyGradient() setCloudsEnabled ( false ) end ) addEventHandler("onClientResourceStop", resourceRoot, function(res) setWeather (0) setWaveHeight ( 0 ) setSkyGradient( 0, 0, 0, 0, 0, 0) setCloudsEnabled ( false ) end end ) addEventHandler("onClientMarkerHit", root, function(player, matchingDimension) if not matchingDimension then return end if player == localPlayer and isPedInVehicle(player) then local vehicle = getPedOccupiedVehicle(player) if source == Marker[1] then moveObject ( object1, 3000, 5137.5068359375, 146.6568145752, -1.2999992370605) end end end ) Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
HunT Posted July 16, 2011 Author Posted July 16, 2011 The createObject work with or without local, the problem is moveObject. Anyway later test without local Tnx @Huntone_
JR10 Posted July 16, 2011 Posted July 16, 2011 local makes the variable exist only in it's block. So in this case object1 will exist only in: addEventHandler("onClientResourceStart", resourceRoot, function() local st3reotxd1 = engineLoadTXD("st3reo3458.txd") engineImportTXD( st3reotxd1, 3458 ) local st3reotxd2 = engineLoadTXD("st3reo8838.txd") engineImportTXD( st3reotxd2, 8838 ) local st3reotxd3 = engineLoadTXD("st3reo5848.txd") engineImportTXD( st3reotxd3, 5848 ) Marker[1] = createMarker(5137.5, -57.07, 1.2, "corona", 5, 0, 0, 0) local object1 = createObject ( 3458, 5137.5068359375, -54.855049133301, -1.2999992370605, 0, 0, 90 ) setWeather(0) setSkyGradient() setCloudsEnabled ( false ) end ) So you must make it global to use it anywhere outside the code above. Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
HunT Posted July 16, 2011 Author Posted July 16, 2011 local TheRock = JR10 Sorry . . . . Work without "local" Tnx For Support "TheRock" @Huntone_
HunT Posted July 16, 2011 Author Posted July 16, 2011 moveObject is OK Now. i Have other problem with "setVehicleGravityPoint" debugscript 3 : attempt to call global "setVehicleGravityPoint" (a nil value) (wtf) ----------------------------------------- Fix with setVehicleGravity -.-" @Huntone_
JR10 Posted July 16, 2011 Posted July 16, 2011 No problem. Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
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