How could I ? [mysql]
#6

Thank you,

so this should work ?:

Код:
public OnEssaiUnban(playerid, nom[])
{
    new string[128], query[128];
    if(!cache_get_row_count())
    {
        SendClientMessage(playerid, Rouge, "Ce joueur n'existe pas !");
        return 1;
    }

	mysql_format(mysql, query, sizeof(query), "SELECT * FROM `joueurs` WHERE `Bannis`='1' AND `Username`='%s' LIMIT 1", nom);
	mysql_tquery(mysql, query, "", "");
	if(!mysql_num_rows())
    {
        SendClientMessage(playerid, Rouge, "Ce joueur n'est pas bannis !");
        return 1;
    }
    mysql_format(mysql, query, sizeof(query),"UPDATE `joueurs` SET `Bannis` = '0', `RaisonBan`='' WHERE `Username` = '%e'", nom);
    mysql_tquery(mysql, query, "", "");
    GetPlayerName(playerid, joueuremetteur, sizeof(joueuremetteur));
    format(string, sizeof(string), "[Admin]:%s a unban %s.", joueuremetteur, nom);
    ChannelAdmin(Rouge, string);
    return 1;
}
Cause it doesn't work for me.
When I unban a player the Banned value is set to 0, if the player is banned to 1.
What I want to do is, if Banned is set to 0, return "This player isn't banned".

But it doesn't work, I don't know why.


Thank you.
Reply


Messages In This Thread
How could I ? [mysql] - by anou1 - 09.02.2014, 20:31
Re: How could I ? [mysql] - by anou1 - 10.02.2014, 07:34
Re: How could I ? [mysql] - by Yashas - 10.02.2014, 08:16
Re: How could I ? [mysql] - by anou1 - 10.02.2014, 08:48
Re: How could I ? [mysql] - by SwisherSweet - 10.02.2014, 08:52
Re: How could I ? [mysql] - by anou1 - 10.02.2014, 09:03
Re: How could I ? [mysql] - by SwisherSweet - 10.02.2014, 09:04
Re: How could I ? [mysql] - by anou1 - 10.02.2014, 09:08
Re: How could I ? [mysql] - by SwisherSweet - 10.02.2014, 09:10
Re: How could I ? [mysql] - by Konstantinos - 10.02.2014, 09:51

Forum Jump:


Users browsing this thread: 1 Guest(s)