Jump to content
  • 0
Sign in to follow this  
GmOcean

R> getareauserid command

Question

2 answers to this question

Recommended Posts

  • 0

EDIT: I don't need this any more due to the fact Annieruru made a command that does exactly what I want AND MORE. Truly a wonderful command that is. Thank you for helping out though Angelmelody.

Edited by GmOcean

Share this post


Link to post
Share on other sites
  • 0
static int buildin_getareausers_sub(struct block_list *bl,va_list ap){	int *users=va_arg(ap,int *);	struct map_session_data *sd = (TBL_PC *)bl;	struct script_state* st;	st=va_arg(ap,struct script_state*);	if( *users < 128 )		script->setd_sub(st, NULL, ".@account_ids", *users, (void *)__64BPRTSIZE(sd->status.account_id), NULL);	(*users)++;	return false;}BUILDIN(getareausers){	const char *str;	int16 m,x0,y0,x1,y1,users=0; //doubt we can have more then 32k users on	str=script_getstr(st,2);	x0=script_getnum(st,3);	y0=script_getnum(st,4);	x1=script_getnum(st,5);	y1=script_getnum(st,6);	if( (m=map->mapname2mapid(str))< 0){		script_pushint(st,-1);		return false;	}	map->foreachinarea(buildin_getareausers_sub,		m,x0,y0,x1,y1,BL_PC,&users,st);	script_pushint(st,users);	return true;}
Edited by Angelmelody

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.