Jokeℝ1472771893 Posted December 1, 2012 Posted December 1, 2012 root = getRootElement() function admt(source) if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) then local x, y, z = getElementPosition(thePlayer) local rx, ry, rz = getElementRotation(thePlayer) theVehicle[thePlayer] = createVehicle( 526, x, y, z, rx, ry, rz, "Staff Car" ) warpPedIntoVehicle(thePlayer, theVehicle[thePlayer]) local newVelocity = ( handlingTable["maxVelocity"] + ( handlingTable["maxVelocity"] / 100 * 40 ) ) setVehicleHandling ( theVehicle[thePlayer], "numberOfGears", 5 ) setVehicleHandling ( theVehicle[thePlayer], "driveType", 'awd' ) setVehicleHandling ( theVehicle[thePlayer], "maxVelocity", newVelocity ) setVehicleHandling ( theVehicle[thePlayer], "engineAcceleration", handlingTable["engineAcceleration"] +8 ) end end addCommandHandler("staffCar",admt) what is wrong here?
Castillo Posted December 1, 2012 Posted December 1, 2012 You are using 'thePlayer', but your argument is 'source'. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Jokeℝ1472771893 Posted December 1, 2012 Author Posted December 1, 2012 if i will change source to thePlayer it will work?
Castillo Posted December 1, 2012 Posted December 1, 2012 Change this: function admt(source) if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(source)), aclGetGroup("Admin")) then To: function admt(thePlayer) if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("Admin")) then And test it. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Jokeℝ1472771893 Posted December 1, 2012 Author Posted December 1, 2012 done , but now it's didn't warp me into the car and Speed and etc. are not working
Castillo Posted December 1, 2012 Posted December 1, 2012 Do you have the table: "theVehicle" defined? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Blaawee Posted December 1, 2012 Posted December 1, 2012 theVehicle = {} handlingTable = {} function admt( thePlayer ) if isObjectInACLGroup( "user."..getAccountName( getPlayerAccount( thePlayer ) ), aclGetGroup("Admin") ) then local x, y, z = getElementPosition( thePlayer ) local rx, ry, rz = getElementRotation( thePlayer ) theVehicle[thePlayer] = createVehicle( 526, x, y, z, rx, ry, rz, "Staff Car" ) warpPedIntoVehicle( thePlayer, theVehicle[thePlayer] ) local newVelocity = ( handlingTable["maxVelocity"] + ( handlingTable["maxVelocity"] / 100 * 40 ) ) setVehicleHandling ( theVehicle[thePlayer], "numberOfGears", 5 ) setVehicleHandling ( theVehicle[thePlayer], "driveType", 'awd' ) setVehicleHandling ( theVehicle[thePlayer], "maxVelocity", newVelocity ) setVehicleHandling ( theVehicle[thePlayer], "engineAcceleration", handlingTable["engineAcceleration"] +8 ) end end addCommandHandler( "staffCar",admt ) and the 'handlingTable' not defined to.
Castillo Posted December 1, 2012 Posted December 1, 2012 theVehicle = { } function admt ( thePlayer ) if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( thePlayer ) ), aclGetGroup ( "Admin" ) ) then local x, y, z = getElementPosition ( thePlayer ) local rx, ry, rz = getElementRotation ( thePlayer ) theVehicle [ thePlayer ] = createVehicle ( 526, x, y, z, rx, ry, rz, "Staff Car" ) local handlingTable = getVehicleHandling ( theVehicle [ thePlayer ] ) warpPedIntoVehicle ( thePlayer, theVehicle [ thePlayer ] ) local newVelocity = ( handlingTable [ "maxVelocity" ] + ( handlingTable [ "maxVelocity" ] / 100 * 40 ) ) setVehicleHandling ( theVehicle [ thePlayer ], "numberOfGears", 5 ) setVehicleHandling ( theVehicle [ thePlayer ], "driveType", 'awd' ) setVehicleHandling ( theVehicle [ thePlayer ], "maxVelocity", newVelocity ) setVehicleHandling ( theVehicle [ thePlayer ], "engineAcceleration", handlingTable [ "engineAcceleration" ] +8 ) end end addCommandHandler ( "staffCar", admt ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Jokeℝ1472771893 Posted December 2, 2012 Author Posted December 2, 2012 thnx guys it's working perfect
Castillo Posted December 2, 2012 Posted December 2, 2012 You're welcome. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
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