I have the whole concept down, but i’m a bit stumped on how to actually put it into my script.
What i want done is:
- The player joins the server
- Under the InitialSpawn function, it will look for the player’s SteamID in a table.
- If there is a value present (table[ply:SteamID()] != nil) it will restore other values that are specific to that player’s “account”
now this would look like this I would imagine…
function GM:InitialSpawn( ply )
if (table[ply.SteamID()] != nil) then //set the player's team accordingly, give them whatever else //add the player's id into the table end
I think I saw somewhere that you can create subtables within tables? So i was wondering if it was possible to do so, so that way each steamid would be a subtable and then i could set each value within each subtable. IE who they are, what was in their inventory, what weapons they had, ect.
The other half of this script would be:
- The player disconnects from the server.
- The player’s info gets saved in the corresponding subtable.
Any help would be appreciated.
Thanks in advance.