public OnPlayerDisconnect(playerid, reason) { new playername[MAX_PLAYER_NAME]; GetPlayerName(playerid, playername, sizeof(playername)); SendDeathMessage(INVALID_PLAYER_ID, playerid, 201); //Save temp info for timeouts/crashes GetPlayerName(playerid, playername, sizeof(playername)); format(savedNames[savePos], MAX_PLAYER_NAME, "%s",playername); savedInfo[savePos][0] = bounty[playerid]; savedInfo[savePos][1] = 0; for(new i = 0; i < MAX_WEAPONS; i++) savedWeapons[savePos][i]=playerWeapons[playerid][i]; // savePos++; if(savePos >= MAX_SAVE) savePos = 0; bounty[playerid] = 0; MiniAntiSpamCount[playerid] = 0; for(new i = 0; i < MAX_WEAPONS;i++) { playerWeapons[playerid][i]=0; } SetPlayerColor( playerid, COLOR_INACTIVE ); } } |
new string[85],pname[24]; switch (reason) { case 0: { GetPlayerName(playerid,pname,24); format(string,sizeof(string), "* %s left the server. (Timeout) (ID:%d).",pname,playerid); SendClientMessageToAll(COLOR_DIS_RED,string); } case 1: { GetPlayerName(playerid,pname,24); format(string,sizeof(string), "* %s left the server. (Leaving) (ID:%d).",pname,playerid); SendClientMessageToAll(COLOR_DIS_RED,string); } case 2: { GetPlayerName(playerid,pname,24); format(string,sizeof(string), "* %s left the server. (Kicked) (ID:%d).",pname,playerid); SendClientMessageToAll(COLOR_DIS_RED,string); } } return 1; } |
public OnPlayerDisconnect(playerid, reason)
{
new playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
SendDeathMessage(INVALID_PLAYER_ID, playerid, 201);
//Save temp info for timeouts/crashes
GetPlayerName(playerid, playername, sizeof(playername));
format(savedNames[savePos], MAX_PLAYER_NAME, "%s",playername);
savedInfo[savePos][0] = bounty[playerid];
savedInfo[savePos][1] = 0;
for(new i = 0; i < MAX_WEAPONS; i++)
savedWeapons[savePos][i]=playerWeapons[playerid][i];
//
savePos++;
if(savePos >= MAX_SAVE)
savePos = 0;
bounty[playerid] = 0;
MiniAntiSpamCount[playerid] = 0;
for(new i = 0; i < MAX_WEAPONS;i++) {
playerWeapons[playerid][i]=0;
}
SetPlayerColor( playerid, COLOR_INACTIVE );
new string[85],pname[24];
switch (reason)
{
case 0:
{
GetPlayerName(playerid,pname,24);
format(string,sizeof(string), "* %s left the server. (Timeout) (ID:%d).",pname,playerid);
SendClientMessageToAll(COLOR_DIS_RED,string);
}
case 1:
{
GetPlayerName(playerid,pname,24);
format(string,sizeof(string), "* %s left the server. (Leaving) (ID:%d).",pname,playerid);
SendClientMessageToAll(COLOR_DIS_RED,string);
}
case 2:
{
GetPlayerName(playerid,pname,24);
format(string,sizeof(string), "* %s left the server. (Kicked) (ID:%d).",pname,playerid);
SendClientMessageToAll(COLOR_DIS_RED,string);
}
}
Originally Posted by Hamptonin
pawn Код:
|
public OnPlayerDisconnect(playerid, reason)
{
GetPlayerName(playerid, savedNames[savePos], MAX_PLAYER_NAME);
savedInfo[savePos][0] = bounty[playerid];
savedInfo[savePos][1] = 0;
for(new i; i < MAX_WEAPONS; i++)
playerWeapons[playerid][i] = 0,
savedWeapons[savePos][i] = playerWeapons[playerid][i];
new Reasons[][] = { "Timeout", "Leaving", "Kicked" };
format(string,sizeof(string), "* %s left the server. (%s) (ID:%d).", savedNames[savePos], Reasons[reason], playerid);
SendClientMessageToAll(COLOR_DIS_RED, string);
if(++savePos >= MAX_SAVE) savePos = 0;
MiniAntiSpamCount[playerid] = 0;
bounty[playerid] = 0;
return true;
}
Originally Posted by ♣ ⓐⓢⓢ
pawn Код:
|
public OnPlayerDisconnect(playerid, reason)
{
GetPlayerName(playerid, savedNames[savePos], MAX_PLAYER_NAME);
savedInfo[savePos][0] = bounty[playerid];
savedInfo[savePos][1] = 0;
for(new i; i < MAX_WEAPONS; i++)
playerWeapons[playerid][i] = 0,
savedWeapons[savePos][i] = playerWeapons[playerid][i];
new Reasons[][] = { "Timeout", "Leaving", "Kicked" }, string[64];
format(string,sizeof(string), "* %s left the server. (%s) (ID:%d).", savedNames[savePos], Reasons[reason], playerid);
SendClientMessageToAll(COLOR_DIS_RED, string);
if(++savePos >= MAX_SAVE) savePos = 0;
MiniAntiSpamCount[playerid] = 0;
bounty[playerid] = 0;
return true;
}