-
- if(UHasHelperPriv(target)) {
- cs_log(sender,"DELUSER FAILED username %s (%s)",target->username,cargc>1?cargv[1]:"");
- chanservwallmessage("%s (%s) just FAILED using DELUSER on %s (%s)", sender->nick, rup->username, target->username, cargc>1?cargv[1]:"");
+
+ if(target->ID == lastuserID) {
+ chanservsendmessage(sender, "Sorry, can't delete last user -- wait a while and try again.");
+ return CMD_ERROR;
+ }
+
+ if(UHasStaffPriv(target)) {
+ cs_log(sender,"DELUSER FAILED username %s (reason: %s)",target->username,reason);
+ chanservwallmessage("%s (%s) just FAILED using DELUSER on %s (reason: %s)", sender->nick, rup->username, target->username, reason);