Jump to content

GetAccount data not works:(


Recommended Posts

if (getAccountData (getPlayerAccount(source), "car")) then

local hawkcar1 = getAccountData (getPlayerAccount(source), "car")

local upgrades = {1001,,1002,1003,1004,1005,1089}

for i,v in ipairs (upgrades) do

addVehicleUpgrade (getPlayerOccupiedVehicle(source), car)

end

end

i have put this in me carspawner but this not works:(

Link to comment
if (getAccountData (getAccount(source), "car")) then
local hawkcar1 = getAccountData (getPlayerAccount(source), "car")
local upgrades = {1001,,1002,1003,1004,1005,1089}
for i,v in ipairs (upgrades) do
addVehicleUpgrade (getPlayerOccupiedVehicle(source), car)
end
end

idk but maybe it works?xD

Link to comment
if (getAccountData (getAccount(source), "car")) then
local hawkcar1 = getAccountData (getPlayerAccount(source), "car")
local upgrades = {1001,,1002,1003,1004,1005,1089}
for i,v in ipairs (upgrades) do
addVehicleUpgrade (getPlayerOccupiedVehicle(source), car)
end
end

idk but maybe it works?xD

What did you change? You changed absolutely nothing.

@daKillar2000

There are a few problems with your script.

- hawkcar1 will be string which you didn't use anywhere in the code

- you have 2 commas in your upgrades table after 1001

- you didn't define car variable anywhere..

NOTE: When you use the same returned value twice then instead of calling function twice with same arguments, just assign returned value to a variable and reuse it later (look at your line 1 and 2).

-- assign value to a variable:
local carStr = getAccountData (getAccount(source), "car")
if carStr then
...

Link to comment

no not works:(

i have putt this but not works

if (getAccountData (getAccount(source), "car")) then

local car = getAccountData (getPlayerAccount(source), "car")

local upgrades = {1001,,1002,1003,1004,1005,1089}

for i,v in ipairs (upgrades) do

addVehicleUpgrade (getPlayerOccupiedVehicle(source), car)

end

end

Link to comment
no not works:(

i have putt this but not works

if (getAccountData (getAccount(source), "car")) then

local car = getAccountData (getPlayerAccount(source), "car")

local upgrades = {1001,,1002,1003,1004,1005,1089}

for i,v in ipairs (upgrades) do

addVehicleUpgrade (getPlayerOccupiedVehicle(source), car)

end

end

Did you fail to read 50p's response?

He just explained what was wrong, and he told you a better way to write your function.

Also did you even enclose this in a function block? IE:

function YourFunctionName (YourFunctionArguments) -- In this case there is no arguments, source is a hidden paramater that always returns the name of the element that called the function.
-- YOUR CODE HERE
end

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