Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PSaves <- [];
- function onPlayerJoin( player )
- {
- PSaves.push( { ID = player.ID, LastSave = time() } );
- }
- function onPlayerPart( player, reason )
- {
- PSaves.remove( PSaves.find( player.Name ) );
- }
- function SavePlayerData()
- {
- foreach( idx, val in PSaves )
- {
- if ( ( time() - val.LastSave ) == 180 )
- {
- local player = FindPlayer( val.ID );
- if ( player )
- {
- // save...
- val.LastSave = time();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment