• Replace a value in a table if nil?
    2 replies, posted
I want to draw a list of friends from the server on my screen. I'll be adding them to a table, but I'm unsure how I could move a player up a slot if a friend disconnects. I've done this before with tons of if statements. Is there a better way?
Tracking players is important; here's a way you can do that ( you can even keep the data when they disconnect which would be useful for administration ). Additionally, for players, instead of storing as a numbered auto-incrementing table.insert index, store them in a way that makes them easily findable. [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/tracking_players/player_connect_and_disconnect.lua[/url] [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/tracking_players/player_connect_and_disconnect_with_list_example.lua[/url]
These are good to read, thanks. I didn't know you could do things like this, [CODE] local _name = _data.name; [/CODE] I'll continue reading this later.
Sorry, you need to Log In to post a reply to this thread.