22.01.2014, 22:15
Hi,
I tried to make a cmd to ban someone. All work fine I think, didnt tried it yet, but I wanted to save the reason of the ban into my mysql database. But I'm blocked, I really don't know how could I do this, I tried something but I don't work at all.
Could someone help me to do this ?
When I ban someone, the reason will be saved in my sql database.
This is my cmd and what I tried:
I got a warning and I'm not sure that it will save the reasion
"pInfo[id][RaisonBan] == raison[id];"
warning 215: expression has no effect
I tried to make a cmd to ban someone. All work fine I think, didnt tried it yet, but I wanted to save the reason of the ban into my mysql database. But I'm blocked, I really don't know how could I do this, I tried something but I don't work at all.
Could someone help me to do this ?
When I ban someone, the reason will be saved in my sql database.
This is my cmd and what I tried:
Код:
CMD:aban(playerid, params[]) { if(pInfo[playerid][Admin] >= 60) { new string[128], raison[128], id; if(sscanf(params, "us[128]", id, raison)) return SendClientMessage(playerid, Rouge, "Utilisation: /aban [ID Joueur] [Raison]"); if(id==INVALID_PLAYER_ID) return SendClientMessage(playerid, Rouge,"Ce joueur n'est pas connectй !"); GetPlayerName(playerid, joueuremetteur, sizeof(joueuremetteur)); GetPlayerName(id, joueurdestinataire, sizeof(joueurdestinataire)); if(pInfo[playerid][Admin] < pInfo[id][Admin]) { new msg[128]; format(msg, sizeof(msg), "%s a essayй de ban l'admin %s", playerid, joueurdestinataire); ChannelAdmin(Rouge, msg); return SendClientMessage(playerid, Rouge, "Vous ne pouvez pas ban un admin de rang supйrieur au votre !"); } GetPlayerName(playerid, joueuremetteur, sizeof(joueuremetteur)); GetPlayerName(id, joueurdestinataire, sizeof(joueurdestinataire)); format(string, sizeof(string), "%s a йtй ban par %s. Raison: %s", joueurdestinataire, joueuremetteur, raison); ChannelAdmin(Rouge, string); format(string, sizeof(string), "Vous avez йtй ban du serveur par %s. Raison: %s", joueuremetteur, raison); SendClientMessage(id, Rouge, string); pInfo[id][RaisonBan] == raison[id]; new query[256]; mysql_format(mysql, query, sizeof(query), "UPDATE `joueurs` SET `Bannis`=%d, `RaisonBan`=%s WHERE `ID`=%d", 1, pInfo[id][RaisonBan], pInfo[id][ID]); mysql_tquery(mysql, query, "", ""); SetTimerEx("BanJoueur", 1000, 0, "d", id); return 1; } return SendClientMessage(playerid, Rouge,"La commande entrйe est inconnue !"); }
"pInfo[id][RaisonBan] == raison[id];"
warning 215: expression has no effect