mars Posted August 26, 2009 Share Posted August 26, 2009 hey guys, i make alot of topic's i know but i think, i wont need alot of topic's anymore ^^ just. i got this: function repairVehicle() skin = getPedSkin(thePlayer) <--- that is line 36 if (skin == 50 ) then local vehicle = getPedOccupiedVehicle(g_Me) if vehicle then server.fixVehicle(vehicle) end end end addCommandHandler('repair', repairVehicle) addCommandHandler('rp', repairVehicle) but when i change my skin ingame to 50 and i type /repair i get this warring [18:47:15] WARNING: commands.lua: Bad argument @ 'getElementModel' - Line: 36 and it doesn't repair the car. can some1 maybe help me?^^'' Link to comment
iChris Posted August 26, 2009 Share Posted August 26, 2009 https://wiki.multitheftauto.com/index.php?title=Scripting_Introduction Read again about command handlers. Link to comment
Dark Dragon Posted August 26, 2009 Share Posted August 26, 2009 (edited) you need to add the parameters which you want to use in the first line function repairVehicle(thePlayer)--,commandName,argument1,argument2) in addition, I have no clue what this line is supposed to mean local vehicle = getPedOccupiedVehicle(g_Me) you should change this to local vehicle = getPedOccupiedVehicle(thePlayer) g_Me is not even a function, some lazy scripters are used to add a line to their CLIENT SIDE SCRIPT which says g_Me = getLocalPlayer() and makes g_Me return the player that belongs to the client. Edited August 26, 2009 by Guest Link to comment
50p Posted August 26, 2009 Share Posted August 26, 2009 ...g_Me is not even a function, some lazy scripters are used to add a line to their CLIENT SIDE SCRIPT which says g_Me = getLocalPlayer() and makes g_Me return the player that belongs to the client. It's not just about being lazy. It saves you typing, bytes and also speeds up your script execution because you call getLocalPlayer() only once. 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