29.04.2015, 10:40
PHP код:
public OnPlayerDisconnect(playerid, reason)
{
new sz_String[128];
switch(reason)
{
case 0: format(sz_String, sizeof(sz_String), "%s[ID:%d] {FF0000}загуби връзка. {ffffff}(Crash)",PlayerName(playerid),playerid);
case 1: format(sz_String, sizeof(sz_String), "%s[ID:%d] {FF0000}излезе от сървъра. {ffffff}(Leave)",PlayerName(playerid),playerid);
case 2: format(sz_String, sizeof(sz_String), "%s[ID:%d] {FF0000}беше кикнат от сървъра. {ffffff}(Kick)",PlayerName(playerid),playerid);
}
SendClientMessageToAll(-1, sz_String);
if(CreatedRamp[playerid] == true) DestroyObject(Ramp[playerid]), CreatedRamp[playerid] = false;
CreatedRamp[playerid] = false;
RampEnabled[playerid] = 0;
Pers[playerid] = 0;
new INI:playerFile = INI_Open(UserPath(playerid));
INI_SetTag(playerFile,"PData");
INI_WriteInt(playerFile, "Admin", PlayerInfo[playerid][pAdmin]);
INI_WriteInt(playerFile, "Deaths", PlayerInfo[playerid][pDeaths]);
INI_WriteInt(playerFile, "Cash", GetPlayerCash(playerid));
INI_WriteInt(playerFile, "Kills", PlayerInfo[playerid][pKills]);
INI_WriteInt(playerFile, "VIP", PlayerInfo[playerid][pVIP]);
INI_WriteInt(playerFile, "VIPExpire", PlayerInfo[playerid][pVIPExpire]);
INI_WriteInt(playerFile, "Muted", PlayerInfo[playerid][pMuted]);
INI_WriteInt(playerFile, "TruckerSkills", PlayerInfo[playerid][pTruckerSkills]);
INI_WriteInt(playerFile, "Level", GetPlayerScore(playerid));
INI_WriteInt(playerFile, "Exp", PlayerInfo[playerid][pExp]);
INI_WriteInt(playerFile, "Job", PlayerInfo[playerid][pJob]);
INI_WriteInt(playerFile, "Jailed", PlayerInfo[playerid][pJailed]);
INI_WriteInt(playerFile, "JailTime", PlayerInfo[playerid][pJailTime]);
INI_WriteInt(playerFile, "Warns", PlayerInfo[playerid][pWarns]);
INI_WriteInt(playerFile, "HouseKey", PlayerInfo[playerid][pHouseKey]);
INI_WriteInt(playerFile, "Leader", PlayerInfo[playerid][pLeader]);
INI_WriteInt(playerFile, "Member", PlayerInfo[playerid][pMember]);
INI_WriteInt(playerFile, "Rank", PlayerInfo[playerid][pRank]);
INI_WriteInt(playerFile, "SavedSkin", PlayerInfo[playerid][pSavedSkin]);
INI_WriteInt(playerFile, "UseSkin", PlayerInfo[playerid][pUseSkin]);
INI_Close(playerFile);
TextDrawHideForPlayer(playerid,ServerTextDrawOne);
TextDrawHideForPlayer(playerid,ServerTextDrawTwo);
TextDrawHideForPlayer(playerid,ServerTextDrawThree);
TextDrawHideForPlayer(playerid,ServerTextDrawFour[playerid]);
TextDrawHideForPlayer(playerid,ServerTextDrawFive[playerid]);
TextDrawHideForPlayer(playerid,ServerTextDrawSix[playerid]);
TextDrawSetString(ServerTextDrawFour[playerid]," ");
TextDrawSetString(ServerTextDrawFive[playerid]," ");
TextDrawSetString(ServerTextDrawSix[playerid]," ");
TextDrawHideForPlayer(playerid,LevelTXD[playerid]);
TextDrawHideForPlayer(playerid,ExpTXD[playerid]);
DriftMoney[playerid] = 0;
DriftScore[playerid] = 0;
DriftPoints[playerid] = 1;
PlayerPositionX[playerid] = 0.0;
PlayerPositionY[playerid] = 0.0;
PlayerPositionZ[playerid] = 0.0;
Laser[playerid] = 0;
InDM[playerid] = 0;
NoGoto[playerid] = 0;
NoPM[playerid] = 0;
LastPM[playerid] = -1;
GodMode[playerid] = 0;
NameTag[playerid] = 0;
RampEnabled[playerid] = 0;
Pers[playerid] = 0;
IsAFK[playerid] = 0;
CP[playerid] = 0;
RemovePlayerAttachedObject(playerid, 0);
KillTimer(PlayerTimerOne[playerid]);
if(PlayerInfo[playerid][pMuted] >= 1)
{
new string[128];
format(string, sizeof(string), "AdmWarn: %s напусна сървъра с оставащо време от това, че беше заглушен %d минути.", PlayerName(playerid), PlayerInfo[playerid][pMuted]);
foreach(new i : Player)
{
if (IsPlayerConnected(i))
{
AdminMessage(COLOR_ADMCMD, string);
}
}
}
HideSpawnTextdraws(playerid);
HideAFKTextdraws(playerid);
return 1;
}