08.02.2014, 11:27
Hi everybody,
Do you know how could I do a unban CMD that could unban an offline player from the database ?
My ban CMD is like that;
So when I ban someone it makes "Bannis" to 1 and "RaisonBan" to the reason.
I'm trying to do an unban cmd, but how could I check if the player exists, and if he's banned ?
Thank you !
PS:if you have any idea to improve my ban system or something like that, tell me please !
Do you know how could I do a unban CMD that could unban an offline player from the database ?
My ban CMD is like that;
Код:
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, Gris, "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), "[ADMIN]:%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), "[ADMIN]:%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); format(pInfo[id][RaisonBan], 128, "%s", raison); pInfo[id][Bannis] = 1; new query[512]; mysql_format(mysql, query, sizeof(query), "UPDATE `joueurs` SET `Bannis`=%d, `RaisonBan`='%s' WHERE `ID`=%d", pInfo[id][Bannis], 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 !"); }
I'm trying to do an unban cmd, but how could I check if the player exists, and if he's banned ?
Thank you !
PS:if you have any idea to improve my ban system or something like that, tell me please !