29.12.2010, 20:36
(
Последний раз редактировалось blackwave; 30.12.2010 в 01:13.
)
When I do:
The script reloadfs normally. But when a player disconects, a message doesn't shows up. Also their status don't save. But normally before the reloadfs, shows the msg of disconection and save status. All works normally after this command, except the callback OnPlayerDisconnect. Is that a bug or is there any other way to avoid?
Код:
/rcon reloadfs adminx
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
new n[MAX_PLAYER_NAME];
GetPlayerName(playerid,n,MAX_PLAYER_NAME);
format(file,sizeof(file),SERVER_USER_FILE,n);
if(dini_Exists(file)) {
printf("spawn: %d | registrado: %d | logado: %d",dini_Int(file,"Spawnou"),dini_Int(file,"Registrado"),gPlayerLogged[playerid]);
SavePlayerStats(playerid);
SoundForAll(1084);
plantada[playerid]=0;
detonada[playerid]=1;
jail[playerid]=0;
block_pms[playerid]=0;
mostrou[playerid]=0;
fix[playerid]=0;
gPlayerLogged[playerid] = 0;
pausa[playerid]=0;
ToggleVClock(0);
banco[playerid]=0;
IsInSafe[playerid]=0;
new string[128];
format(string,sizeof(string),"Logged: %d | Spawnou: %d | Jail: %d",gPlayerLogged[playerid],PlayerInfo[playerid][Spawnou],PlayerInfo[playerid][Jail]);
printf(string);
}
new nome[30],string[128];
GetPlayerName(playerid, nome, 30);
switch(reason)
{
case 0: format(string,sizeof(string),"| {00FFA2}%s [ID: %d] {D60AFF}has disconnected {EBFF0A}[Timeout]", nome, playerid);
case 1: format(string,sizeof(string),"| {00FFA2}%s [ID: %d] {D60AFF}has disconnected {0AFFFF}[Logged out]", nome, playerid);
case 2: format(string,sizeof(string),"| {00FFA2}%s [ID: %d] {D60AFF}has disconnected {FF0A43}[Kick/Ban]", nome, playerid);
}
SendClientMessageToAll(color, string);
return 1;
}