예제 #1
0
int set_clan_rank(struct set_clan_rank_data *set,struct character *tmp)
{
        if (set->clan<CLUBOFFSET) {
		if (tmp->clan!=set->clan) {
			tell_chat(0,set->master_ID,1,"%s is not a member of your clan, you cannot set the rank.",tmp->name);
			return 0;
		}
                tmp->clan_rank=set->rank;
	
		add_clanlog(set->clan,clan_serial(set->clan),tmp->ID,30,"%s rank was set to %d by %s",tmp->name,set->rank,set->master_name);
	
		tell_chat(0,set->master_ID,1,"Set %s's rank to %d.",tmp->name,set->rank);
	} else {
		if (tmp->clan!=set->clan) {
			tell_chat(0,set->master_ID,1,"%s is not a member of your club, you cannot set the rank.",tmp->name);
			return 0;
		}
                if (tmp->clan_rank==2) {
			tell_chat(0,set->master_ID,1,"%s is the club's founder, can't change rank.",tmp->name);
			return 0;
		}
		tmp->clan_rank=set->rank;
	
		tell_chat(0,set->master_ID,1,"Set %s's rank to %d.",tmp->name,set->rank);
	}

        return 1;
}
예제 #2
0
int fire_from_clan(struct fire_from_clan_data *set,struct character *tmp)
{
        if (set->clan<CLUBOFFSET) {
		if (tmp->clan!=set->clan) {
			tell_chat(0,set->master_ID,1,"%s is not a member of your clan, you cannot fire him/her.",tmp->name);
			return 0;
		}
		tmp->clan=0;
		tmp->clan_rank=0;
		tmp->clan_leave_date=realtime;
	
		add_clanlog(set->clan,clan_serial(set->clan),set->target_ID,15,"%s was fired by %s",tmp->name,set->master_name);
	
		tell_chat(0,set->master_ID,1,"Fired %s.",tmp->name);	
	} else {
		if (tmp->clan!=set->clan) {
			tell_chat(0,set->master_ID,1,"%s is not a member of your club, you cannot fire him/her.",tmp->name);
			return 0;
		}
		if (tmp->clan_rank>1) {
			tell_chat(0,set->master_ID,1,"You cannot fire %s, he is the founder of the club.",tmp->name);
			return 0;
		}
		tmp->clan=0;
		tmp->clan_rank=0;
	
		tell_chat(0,set->master_ID,1,"Fired %s.",tmp->name);	
	}

        return 1;
}
예제 #3
0
int set_flags(struct set_flags *set,struct character *tmp)
{
        tmp->flags^=set->flags;

        tell_chat(0,set->master_ID,1,"Set flag on %s to %s.",tmp->name,(tmp->flags&set->flags) ? "on" : "off");

        return 1;
}
예제 #4
0
파일: swear.c 프로젝트: NightSoA/soa
void shutup_bg(int cnID,int coID,int minutes)
{
	struct swear_ppd *ppd;
	int co;

	for (co=getfirst_char(); co; co=getnext_char(co)) {
		if (ch[co].ID==coID) break;		
	}
	if (!co) return;

	if (!(ch[co].flags&CF_PLAYER)) return;

	ppd=set_data(co,DRD_SWEAR_PPD,sizeof(struct swear_ppd));
	if (!ppd) return;	// oops...

	ppd->banned_till=realtime+(minutes*60);

        if (minutes>0) log_char(co,LOG_SYSTEM,0,"°c3Your ability to talk has been disabled.");
	else log_char(co,LOG_SYSTEM,0,"°c3Your ability to talk has been enabled.");

	tell_chat(0,cnID,1,"%s cannot talk for %d minutes.",ch[co].name,minutes);
}