Jump to content

helpzor :(


mars

Recommended Posts

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

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 by Guest
Link to comment
...

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...