CMD:aunban(playerid, params[]) { if(pInfo[playerid][Admin] < 70) return SendClientMessage(playerid, Rouge,"La commande entrйe est inconnue !"); new nom[24], query[128]; if(sscanf(params,"s[24]", nom)) return SendClientMessage(playerid, Gris, "/aunban [Nom_Prйnom du joueur]"); format(query, sizeof(query), "SELECT * FROM `joueurs` WHERE `Bannis` = '1' AND `Username` = '%s' LIMIT 1", nom); mysql_tquery(mysql, query, "OnEssaiUnban","is", playerid, nom); return 1; }
public OnEssaiUnban(playerid, nom[]) { new string[128], query[128]; if(!cache_get_row_count()) { 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; }
SELECT Username FROM 'your_table' WHERE Username='PLAYERNAME' |
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(!cache_get_row_count()) // This part doesn't work. It should return that the player isnt banned when I try to unban someone who isn't banned. { 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; }
CMD:aunban(playerid, params[]) { if(pInfo[playerid][Admin] >= 70) { new nom[24], query[128]; if(sscanf(params,"s[24]", nom)) return SendClientMessage(playerid, Gris, "/aunban [Nom_Prйnom du joueur]"); format(query, sizeof(query), "SELECT * FROM `joueurs` WHERE `Username` = '%s' LIMIT 1", nom); mysql_tquery(mysql, query, "OnEssaiUnban","is", playerid, nom); return 1; } return SendClientMessage(playerid, Rouge,"La commande entrйe est inconnue !"); }
if(!mysql_num_rows()) {//this basically means if(false mysql_num_rows bla bla bla... SendClientMessage(playerid, ADMIN_ACTION, "•• This is a non-existing ban Playerid."); }
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; }
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((cache_get_row_int(0, 17)) != 1) { 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; }
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((cache_get_row_int(0, 17)) != 1) {
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;
}
pawn Код:
|
u asked me in pm...
pawn Код:
|