[Ajuda] Funзхes com MySQL
#1

Fala galera, tudo tranquilo?
Entao, estou fazendo um gamemode que utiliza MySQL, e estou com duvida nisso

pawn Код:
public MySQL_DesbanirPlayer(playerid, nome[])
{
    if(MySQL_IsPlayerBan(nome))
    {
        new Str[150];
        GetPlayerName(playerid, NomePlayer, 22);
        format(Str, 150, "UPDATE banidos SET nick_admin_desban='%s', data_term_ban=current_date WHERE nick_player='%s' LIMIT 1 ", NomePlayer, nome);
        mysql_function_query(Conexao, Str, false, #, #);
        SendClientMessage(playerid, COLOR_GREEN, "[INFO] Player Desbanido !");
    }
    else
    {
        SendClientMessage(playerid, COLOR_RED, "[ERRO] O Player nгo estб banido !");
    }

    return 1;
}
Funзгo: MySQL_IsPlayerBan:
pawn Код:
stock MySQL_IsPlayerBan(nick[])
{
    new Str[124];
    format(Str, 124, "SELECT nick_player FROM banidos WHERE nick_player='%s' AND data_term_ban is NULL LIMIT 1 ", nick);
    return mysql_function_query(Conexao, Str, true, "r@MySQL_IsPlayerBan", #);
}

stock r@MySQL_IsPlayerBan()
{
    new rows,fields;
    cache_get_data(rows,fields,Conexao);
    if(rows)
    {
        return 1; //QUERO PEGAR ESSES VALORES
    }
    return 0; //QUERO PEGAR ESSES VALORES
}
Como que eu faзo pra pegar o valor que й retornado na r@MySQL_IsPlayerBan utilizando a MySQL_IsPlayerBan?
Reply


Messages In This Thread
Funзхes com MySQL - by Hunter_Xtreme - 17.04.2013, 01:44
Re: Funзхes com MySQL - by smiiir - 17.04.2013, 01:48
Re: Funзхes com MySQL - by Schocc - 17.04.2013, 02:06
Re: Funзхes com MySQL - by Hunter_Xtreme - 17.04.2013, 02:11
Re: Funзхes com MySQL - by Schocc - 17.04.2013, 02:24
Re: Funзхes com MySQL - by Hunter_Xtreme - 17.04.2013, 13:43
Re: Funзхes com MySQL - by Mutuka_XTreme - 17.04.2013, 21:46
Re: Funзхes com MySQL - by Hunter_Xtreme - 18.04.2013, 23:08
Re: Funзхes com MySQL - by paulor - 21.04.2013, 13:37

Forum Jump:


Users browsing this thread: 6 Guest(s)