09.02.2014, 20:31
Hi everybody,
I've an unban cmd and I want to know how could I return something if the Username doesn't exist in the database ?
Thank you !
My unban CMD:
OnEssaiUnban:
I've an unban cmd and I want to know how could I return something if the Username doesn't exist in the database ?
Thank you !
My unban CMD:
Код:
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; }