14.08.2010, 12:34
This is my OnPlayerDisconect
Code:
public OnPlayerDisconnect(playerid, reason) { //-------------------------------------------------------------------------- new String[128]; new PName[MAX_PLAYER_NAME]; new name[MAX_PLAYER_NAME], file[256]; GetPlayerName(playerid, name, sizeof(name)); format(file, sizeof(file), SERVER_USER_FILE, name); if(gPlayerLogged[playerid] == 1) { dini_IntSet(file, "Score", PlayerInfo[playerid][pScore]); dini_IntSet(file, "Money", PlayerInfo[playerid][pCash]); dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel]); } gPlayerLogged[playerid] = 0; switch(reason) { case 0: format(String, sizeof(String), "%s a lost the connection with server(Crash).", PName); case 1: format(String, sizeof(String), "%s quit the server(Quit).", PName); case 2: format(String, sizeof(String), "%s quit the server. (Kicked)", PName); } return 1; }