Jump to content

Bad Arguement


Recommended Posts

Hey

i get bad arguements at this script line:

destroyElement( _G["PlayerCar"..getPlayerName(source)])

( _G["PlayerCar"..getPlayerName(source) is = createVehicle ( 475, -198.83, 1216.94, 20, 0, 0, 180 ) )

and

PlayerCarID[source] = getAccountData ( account[source], "CarID" )
PlayerCarx[source] = getAccountData ( account[source], "Carx" )
PlayerCary[source] = getAccountData ( account[source], "Cary" )
PlayerCarz[source] = getAccountData ( account[source], "Carz" )
PlayerCarrx[source] = getAccountData ( account[source], "Carrx" )
PlayerCarry[source] = getAccountData ( account[source], "Carry" )
PlayerCarrz[source] = getAccountData ( account[source], "Carrz" )
setPlayerMoney ( source, PlayerMoney[source])
if PlayerCarID[source] > 0 then
	createVehicle (	tonumber(PlayerCarID[source]), tonumber(PlayerCarx[source]), tonumber(PlayerCary[source]), tonumber(PlayerCarz[source]), tonumber(PlayerCarrx[source]), tonumber(PlayerCarry[source]), tonumber(PlayerCarrz[source]) )
end

and @createvehicle

Link to comment

Don't declare variable with name of players! It will cause problems if player name contains other characters than numbers or letters. Just make global table and use player element as its index. Besides, the code you showed us doesn't contain any _G which is your error.

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...