Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function GM:PlayerDisconnected ( Player )
- Player:Save();
- // Remove their save timer
- local ourID = Player:SteamID();
- timer.Remove(ourID);
- // Remove their properties
- for k, v in pairs(PROPERTY_DATABASE) do
- local propOwner = GetGlobalEntity("p_" .. k);
- if (propOwner && IsValid(propOwner) && propOwner == Player) then
- SetGlobalEntity("p_" .. k, Entity());
- end
- end
- // Delete all of their props
- for k, v in pairs(ents.GetAll()) do
- if (v.Owner && v.Owner == Player) then
- v:Remove();
- end
- if (v.pickupPlayer && v.pickupPlayer == Player) then
- v:Remove();
- end
- end
- // Remove their vehicle (and rotators)
- Player:RemoveCar();
- // Make sure they're not on the phone with anyone
- if (Player.Calling) then DropCall(Player); end
- timer.Simple(1, self.PushNumPlayers);
- end
- function GM:ShutDown ( )
- for k, v in pairs(player.GetAll()) do
- v:Save();
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement