[Ajuda] OnPlayerConnect & OnPlayerDisconnect
#2

pawn Код:
public OnPlayerConnect(playerid) {
    static
        Conta[40],
        pNome[MAX_PLAYER_NAME]
    ;
    PlayerInfo[playerid][Logado] = false;
    GetPlayerName(playerid, pNome, 32);
    format(Conta, 40, "Contas/Ban/%s.ini", pNome);
    if(DOF2_FileExists(Conta)) {
        format(String, sizeof(String), "Vocк estб banido deste servidor/n Admin Responssбvel: %s/n Motivo: %s/n Data: %i/%i/%i/n", DOF2_GetString(Conta, "Adm"), DOF2_GetString(Conta, "Motivo"), DOF2_GetInt(Conta, "Dia"), DOF2_GetInt(Conta, "Mes"), DOF2_GetInt(Conta, "Ano"));
        ShowPlayerDialog(playerid, Ban, DIALOG_STYLE_MSGBOX, "Banido", String, "Ok", ""); // 61
        Kick(playerid);
    }
    format(Conta, 40, Contas, pNome);
    if(!DOF2_FileExists(Conta)) {
        format(String, sizeof(String), "Olб %s. Sua conta nгo й registrada neste servidor/n Digite uma senha para se registrar", pNome);
        ShowPlayerDialog(playerid, DIALOG_REGISTRO, DIALOG_STYLE_INPUT, "Registro", String, "Confirmar", "Cancelar");
    }
    else {
        format(String, sizeof(String), "Bem Vindo de volta %s. Digite sua senha para logar-se", pNome);
        ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", String, "Logar", "Cancelar");
    }
    return true;
}

public OnPlayerDisconnect(playerid) {
    static
        Conta[40],
        pNome[MAX_PLAYER_NAME]
    ;
    PlayerInfo[playerid][Logado] = false;
    format(Conta, 40, Contas, pNome, 32);
    if(DOF2_FileExists(Conta)) {
        DOF2_SetInt(Conta, "Nivel", PlayerInfo[playerid][Nivel]);
    }
    return true;
}
Reply


Messages In This Thread
OnPlayerConnect & OnPlayerDisconnect - by Mr_Taxi - 02.07.2012, 21:10
Re: OnPlayerConnect & OnPlayerDisconnect - by RoacH` - 02.07.2012, 21:13
Re: OnPlayerConnect & OnPlayerDisconnect - by MarlonColhado - 02.07.2012, 21:13
Re: OnPlayerConnect & OnPlayerDisconnect - by Mr_Taxi - 02.07.2012, 21:17
Re: OnPlayerConnect & OnPlayerDisconnect - by CristoferBahr - 03.07.2012, 17:34
Re: OnPlayerConnect & OnPlayerDisconnect - by Y_Seven - 03.07.2012, 17:58

Forum Jump:


Users browsing this thread: 1 Guest(s)