Jump to content

[Question]


Recommended Posts

Posted

hey,

i was wondering how to make the grid list save more than 1 car, i have make

a cars shop, and it's work just fine, but there is a little problem , the problem is in the 'save'

i make it if someone login, the cars that he bought before all show into the list it's work but

only shows one car but i bought 3 cars, but only one shows.

Server side:

addEventHandler ("onPlayerLogin", root, function (thePreviousAccount, theCurrentAccount, autoLogin) 
if not isGuestAccount (getPlayerAccount (source)) then 
car = getAccountData (theCurrentAccount, "MyCar") 
if car then 
carName = getVehicleNameFromModel (car) 
triggerClientEvent (source, "getItBack", source, carName) 
end 
end 
end) 

Client side:

addEvent ("getItBack", true) 
addEventHandler ("getItBack", root, function (veh) 
row = guiGridListAddRow (grid) 
guiGridListSetItemText (grid, row, 1, veh, false, false) 
end) 

So, Help.

Posted

It would require changing most of the script. Rather than just having one accountData with all of the vehicle data, it should be a table containing all of the players vehicles and their data.

Posted

It's not hard, it's just that you need to give it a try and understand how it works. Also tutorial is available across the forum and the internet for SQL syntax.

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