Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerDisconnect(playerid, reason)
- {
- SendDeathMessage(INVALID_PLAYER_ID,playerid,201);
- new leaveMsg[128], name[MAX_PLAYER_NAME], reasonMsg[8];
- switch(reason)
- {
- case 0: reasonMsg = "Timeout";
- case 1: reasonMsg = "Leaving";
- case 2: reasonMsg = "Kicked";
- }
- GetPlayerName(playerid, name, sizeof(name));
- format(leaveMsg, sizeof(leaveMsg), "4[%d] 03*** %s has left the server. (%s)", playerid, name, reasonMsg);
- IRC_GroupSay(gGroupID, IRC_CHANNEL, leaveMsg);
- if(fexist(UserPath(playerid)))
- {
- new INI:File = INI_Open(UserPath(playerid));
- INI_SetTag(File,"data");
- INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
- INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
- INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
- INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
- INI_WriteInt(File,"WantedLevel",GetPlayerWantedLevel(playerid));
- INI_WriteInt(File,"Vip",PlayerInfo[playerid][pVip]);
- INI_WriteInt(File,"Score",GetPlayerScore(playerid));
- INI_WriteInt(File,"Condoms",PlayerInfo[playerid][pCondoms]);
- INI_WriteInt(File,"Banned",PlayerInfo[playerid][pBanned]);
- INI_WriteInt(File,"Jailed",PlayerInfo[playerid][pJailed]);
- INI_WriteInt(File,"Drugs",PlayerInfo[playerid][pDrug]);
- INI_WriteInt(File,"Nopm",PlayerInfo[playerid][pNopm]);
- INI_WriteInt(File,"Bank",PlayerInfo[playerid][pBank]);
- INI_WriteInt(File,"Sausages",PlayerInfo[playerid][pSausage]);
- INI_WriteInt(File,"PassChange",PlayerInfo[playerid][pPassChange]);
- INI_WriteInt(File,"Mute",PlayerInfo[playerid][pMuted]);
- INI_Close(File);
- }
- if(ireconnect[playerid] == 1)
- {
- new unbanningip[16], string[128];
- GetPVarString(playerid, "reconnect", unbanningip, 16);
- format(string,sizeof(string),"unbanip %s", unbanningip);
- SendRconCommand(string);
- printf(string);
- SendRconCommand("reloadbans");
- ireconnect[playerid] = 0;
- }
- TextDrawDestroy(LocationTD[playerid]);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment