golanu21 Posted August 30, 2013 Share Posted August 30, 2013 addCommandHandler("setmyspeed", function (player, cmd, arg1) local veh = getPedOccupiedVehicle(player) if (veh) then setElementSpeed(veh, "kph", tonumber(arg1)) else outputChatBox("You have to sit in vehicle", player) end end ) the code is from www.wiki.multitheftauto.com server.lua:5: attempt to call global 'setElementSpeed' (a nil value) Link to comment
EstrategiaGTA Posted August 30, 2013 Share Posted August 30, 2013 Because it isn't a function. It's an useful function. And as I can see HERE, you also need the useful function 'getElementSpeed'. Link to comment
qaisjp Posted August 31, 2013 Share Posted August 31, 2013 As an extension to EstrategiaGTA's post, all content in Useful functions are snippets that you need to include into your resource before calling them. You found this example from a Useful function example, so naturally you need that function. 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