• [Newbie Problem] 2D Tables and my fails
    6 replies, posted
Alright, so I'm trying to make a bank system [code] BankTable = {} [/code] The other part really isnt important. Anyway, what im trying to do is [code] BankTable[ply:SteamID()].interest = blabla BankTable[ply:SteamID()].money = balbla [/code] I read something about defining 2D tables, ok, but I don't know when to define its a 2d table, each time I change it?
BankTable[ply:SteamID()] = {}
Ok but, where should I play that? I have multiple parts where the data is changed.
Ok, the Table problems are solved, But I came to a problem I did fix before, seems to be a different reason now [code] AddCSLuaFile("autorun\client\cl_load.lua") [/code] [code] umsg.Start("banka",pl) umsg.End() [/code] That's the server. [code] local function Banka() -- Spam of VGUI end usermessage.Hook("banka",Banka) [/code] It's giving me the Warning that the usermessage banka wasn't got. It has no other errors or anything.
Is cl_load.lua actually included in cl_init.lua? (Assuming this is part of a gamemode) Use include('autorun\client\cl_load.lua') Or if it's a gamemode scrap cl_load.lua being in autorun/client and just put it in garrysmod/gamemodes/yourgamemode/gamemode/ then do: include('cl_load.lua') in your cl_init.lua.. (Sorry if that's a bit confusing, just ask for help if needed.)
It's a addon.
Fixed. I seemed to have used \ instead of /
Sorry, you need to Log In to post a reply to this thread.