daKillar2000 Posted July 21, 2010 Share Posted July 21, 2010 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
m4rsje Posted July 21, 2010 Share Posted July 21, 2010 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? Link to comment
50p Posted July 21, 2010 Share Posted July 21, 2010 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? 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
daKillar2000 Posted July 21, 2010 Author Share Posted July 21, 2010 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
LonelyRoad Posted July 21, 2010 Share Posted July 21, 2010 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
daKillar2000 Posted July 21, 2010 Author Share Posted July 21, 2010 i have this function include in me spawncar function Link to comment
Castillo Posted July 21, 2010 Share Posted July 21, 2010 i have this function include in me spawncar function I think you arent even understanding us... i m right? Link to comment
daKillar2000 Posted July 21, 2010 Author Share Posted July 21, 2010 srry men i know it now:p 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