3ehud Posted June 1, 2017 Posted June 1, 2017 I need help with a script, that will be allowed to use only by "Policja" ACL group, and it sets player's vehicle maxVelocity to 0.1, but i need the script to change it back to normal velocity when i want. The command needs to look like this: /commandName thePlayer maxVelocity. So i need some help because i don't even know Lua, aaand i used wiki and looked in some scripts too. Maybe you guys, the Lua masters out there will help me out? Huge thanks. Here's what I've done. function emp ( thePlayer, theVehicle ) local theVehicle = getPedOccupiedVehicle ( thePlayer ) then setVehicleHandling(v, "maxVelocity", 0.1) end addCommandHandler ( string turnoff, function emp, [bool restricted = false, bool caseSensitive = true] )
idarrr Posted June 1, 2017 Posted June 1, 2017 -- Server Side code function setVehicleOriginalVelocity(thePlayer) local veh = getPedOccupiedVehicle(thePlayer) if veh then -- Make sure the player is in the vehicle local vehModel = getElementModel(veh) local originalVelocity = getOriginalHandling(vehModel)["maxVelocity"] setVehicleHandling(veh, "maxVelocity", originalVelocity) else outputChatBox("You are not in Vehicle!", thePlayer) end end addCommandHandler("setoriginalvel", setVehicleOriginalVelocity)
3ehud Posted June 1, 2017 Author Posted June 1, 2017 Everything cool but it says im not in vehicle. And i need a script that could change the velocity.
idarrr Posted June 1, 2017 Posted June 1, 2017 Did you put that code on Server Side? Because it won't work on Client Side.
3ehud Posted June 1, 2017 Author Posted June 1, 2017 yup acuatlly it now doesnt show the message but still aint working
Hale Posted June 2, 2017 Posted June 2, 2017 9 hours ago, 3ehud said: yup acuatlly it now doesnt show the message but still aint working You sure? Can you show us how did you put it server side in XML?
3ehud Posted June 2, 2017 Author Posted June 2, 2017 <meta> <script src="script.lua" type="server" /> </meta>
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