pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
if(AdminDuty[playerid] == 1)
{
Delete3DTextLabel(td[playerid]);
}
if(LStep[playerid] >= 1)
{
TakingTest = 0;
return 1;
}
new pname[MAX_PLAYER_NAME], string[128 + MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
new plrIP[128];
GetPlayerIp(playerid, plrIP, sizeof(plrIP));
switch(reason)
{
case 0: format(string, sizeof(string), "%s has left the server - %s. (Crashed)", pname, plrIP);
case 1: format(string, sizeof(string), "%s has left the server - %s. (Leaving)", pname, plrIP);
case 2: format(string, sizeof(string), "%s has left the server - %s. (Kicked)", pname, plrIP);
//case 3: format(string, sizeof(string), "%s has left the server - %s. (Restarting Server)", pname, plrIP);
}
// ambushit
InAmbu[playerid] = 0;
Watching[playerid] = 0;
Goto[playerid] = 0;
//-----------------
Adminmsg(string);
AdminDuty[playerid] = 0;
if(PLogged[playerid] == 1)
{
if(reason == 0)
{
PlayerInfo[playerid][pCrashed] = 1;
// PlayerInfo[playerid][pCrashed] = 2;
PlayerInfo[playerid][pHealth] = GetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
PlayerInfo[playerid][pArmour] = GetPlayerArmour(playerid, PlayerInfo[playerid][pArmour]);
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
PlayerInfo[playerid][pLeftX] = x;
PlayerInfo[playerid][pLeftY] = y;
PlayerInfo[playerid][pLeftZ] = z;
PlayerInfo[playerid][pLeftInt] = GetPlayerInterior(playerid);
PlayerInfo[playerid][pLeftW] = GetPlayerVirtualWorld(playerid);
SaveAccounts(playerid);
PlayerLocalMessage(playerid,15.0,"has crashed from the server.");
}
}
GetPlayerWeaponData(playerid, 1, PlayerInfo[playerid][pGun1], PlayerInfo[playerid][pAmmo1]);
GetPlayerWeaponData(playerid, 2, PlayerInfo[playerid][pGun2], PlayerInfo[playerid][pAmmo2]);
GetPlayerWeaponData(playerid, 3, PlayerInfo[playerid][pGun3], PlayerInfo[playerid][pAmmo3]);
GetPlayerWeaponData(playerid, 4, PlayerInfo[playerid][pGun4], PlayerInfo[playerid][pAmmo4]);
GetPlayerWeaponData(playerid, 5, PlayerInfo[playerid][pGun5], PlayerInfo[playerid][pAmmo5]);
GetPlayerWeaponData(playerid, 6, PlayerInfo[playerid][pGun6], PlayerInfo[playerid][pAmmo6]);
GetPlayerWeaponData(playerid, 7, PlayerInfo[playerid][pGun7], PlayerInfo[playerid][pAmmo7]);
GetPlayerWeaponData(playerid, 8, PlayerInfo[playerid][pGun8], PlayerInfo[playerid][pAmmo8]);
GetPlayerWeaponData(playerid, 9, PlayerInfo[playerid][pGun9], PlayerInfo[playerid][pAmmo9]);
GetPlayerWeaponData(playerid, 10, PlayerInfo[playerid][pGun10], PlayerInfo[playerid][pAmmo10]);
GetPlayerWeaponData(playerid, 11, PlayerInfo[playerid][pGun11], PlayerInfo[playerid][pAmmo11]);
GetPlayerWeaponData(playerid, 12, PlayerInfo[playerid][pGun12], PlayerInfo[playerid][pAmmo12]);
GetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
GetPlayerArmour(playerid, PlayerInfo[playerid][pArmour]);
DeadTimer[playerid] = 0;
PlayerInfo[playerid][pDead] = 0;
JustDied[playerid] = 0;
ResetPlayerWeapons(playerid);
SetPlayerWantedLevel(playerid, 0);
// SaveAccounts(playerid);
return 1;
}
//}