Jokeℝ1472771893 Posted December 1, 2012 Share 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? Link to comment
Castillo Posted December 1, 2012 Share Posted December 1, 2012 You are using 'thePlayer', but your argument is 'source'. Link to comment
Jokeℝ1472771893 Posted December 1, 2012 Author Share Posted December 1, 2012 if i will change source to thePlayer it will work? Link to comment
Castillo Posted December 1, 2012 Share 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. Link to comment
Jokeℝ1472771893 Posted December 1, 2012 Author Share Posted December 1, 2012 done , but now it's didn't warp me into the car and Speed and etc. are not working Link to comment
Castillo Posted December 1, 2012 Share Posted December 1, 2012 Do you have the table: "theVehicle" defined? Link to comment
Blaawee Posted December 1, 2012 Share 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. Link to comment
Castillo Posted December 1, 2012 Share 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 ) Link to comment
Jokeℝ1472771893 Posted December 2, 2012 Author Share Posted December 2, 2012 thnx guys it's working perfect 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