Re: [CODE]Do_group

From: Mike Breuer (mbreuer@new.rr.com)
Date: 07/30/01


From: "Luca" <wetwork@terra.com.br>
>     I'm trying to make the function in ACMD do_group to make the following
> thing : if the master of the group is 15 or more levels higher then the
> followers they can't group....

int perform_group(struct char_data *ch, struct char_data *vict)
{
  if (AFF_FLAGGED(vict, AFF_GROUP) || !CAN_SEE(ch, vict))
    return (0);

+ if (abs(GET_LEVEL(ch) - GET_LEVEL(vict)) >= 15) {
+   act("$N can not join your group.", FALSE, ch, 0, vict, TO_CHAR);
+   return (0);
+ }

That's if you want to enforce a level difference, rather than just checking
if the master is 15+ higher.  If you want to enforce the second option, then
don't enclose the left side of the comparison in the abs() function.

Mike

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/06/01 PST