joedajoester Posted November 13, 2011 Share Posted November 13, 2011 Okay, i tried making this script for staff only, and i get errors, unexpected symbol at ') when i delete that symbol, i get this error, 'end' expected (too close 'function' at line 2) can someone tell me where i am making a mistake? addEventHandler ( "onResourceStart", resourceRoot, function () local gate1 = createObject(971, 0, 0, 5) local gate2 = createObject(971, 0, 0, 5) local Car1 = createVehicle ( 567, -1736, -2895, 55, 0, 0, 236 ) local Car2 = createVehicle ( 567, -1744, -2913.3000488281, 55, 0, 354.488, 220 ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ( "user." .. playerName, aclGetGroup ( "Admin" ) ) then attachElements( gate1, Car1, 0.4, 6.2, -0.6, 90, 90, 90 ) attachElements( gate2, Car1, 0.4, 13.2, -0.6, 90, 90, 90 ) addVehicleUpgrade ( Car1, 1087 ) addVehicleUpgrade ( Car2, 1087 ) end) function attach(thePlayer) if not isPedInVehicle(thePlayer) then return end local vehicle = getPedOccupiedVehicle(thePlayer) local car1gate1 = createObject(971, 0, 0, 5) local car1gate2 = createObject(971, 0, 0, 5) attachElements( car1gate1, vehicle, 0.4, 6.2, -0.6, 90, 90, 90 ) attachElements( car1gate2, vehicle, 0.4, 13.2, -0.6, 90, 90, 90 ) addVehicleUpgrade ( vehicle, 1087 ) end addCommandHandler ( "spatula", attach) Link to comment
Castillo Posted November 13, 2011 Share Posted November 13, 2011 addEventHandler ( "onResourceStart", resourceRoot, function () local gate1 = createObject(971, 0, 0, 5) local gate2 = createObject(971, 0, 0, 5) local Car1 = createVehicle ( 567, -1736, -2895, 55, 0, 0, 236 ) local Car2 = createVehicle ( 567, -1744, -2913.3000488281, 55, 0, 354.488, 220 ) attachElements( gate1, Car1, 0.4, 6.2, -0.6, 90, 90, 90 ) attachElements( gate2, Car1, 0.4, 13.2, -0.6, 90, 90, 90 ) addVehicleUpgrade ( Car1, 1087 ) addVehicleUpgrade ( Car2, 1087 ) end) function attach(thePlayer) if not isPedInVehicle(thePlayer) then return end local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Admin" ) ) then local vehicle = getPedOccupiedVehicle(thePlayer) local car1gate1 = createObject(971, 0, 0, 5) local car1gate2 = createObject(971, 0, 0, 5) attachElements( car1gate1, vehicle, 0.4, 6.2, -0.6, 90, 90, 90 ) attachElements( car1gate2, vehicle, 0.4, 13.2, -0.6, 90, 90, 90 ) addVehicleUpgrade ( vehicle, 1087 ) end end addCommandHandler ( "spatula", attach) You can't check onResourceStart if is admin, that makes no sense. Link to comment
joedajoester Posted November 13, 2011 Author Share Posted November 13, 2011 Thank you, i put it in the top part were it spawns the cars, and the bottom attaches the objects, silly mistake, and i tried after you posted and i realized my mistake, i tried doing it again, i was close i just put if isobjectinacl that line above if notispedinvehicle and my ends were switched around, its good to learn from your mistakes. thanks you 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