Lord Ganja Posted April 27, 2013 Group: Members Topic Count: 141 Topics Per Day: 0.03 Content Count: 444 Reputation: 22 Joined: 06/18/12 Last Seen: August 11, 2018 Share Posted April 27, 2013 (edited) Could you help me to edit the src so that GM's are ignored/not counted in the script 'getmapusers'. I tried to edit my script.c using this one here http://rathena.org/board/topic/66820-gm-ignored-in-getmapusers/ but it got errors. Whenever I tried to click the Abort, Retry, or Ignore, it causes the mapserver to stop. Here's a screenshot of the error: Any help please? Thanks in advance! Edited April 27, 2013 by Lord Ganja Quote Link to comment Share on other sites More sharing options...
Cydh Posted April 27, 2013 Group: Developer Topic Count: 153 Topics Per Day: 0.03 Content Count: 2285 Reputation: 748 Joined: 06/16/12 Last Seen: February 21 Share Posted April 27, 2013 (edited) BUILDIN_FUNC(getmapusers) { int count = 0; const char *str; int16 m; struct map_session_data *pl_sd; struct s_mapiterator* iter; str=script_getstr(st,2); if( (m=map_mapname2mapid(str))< 0){ script_pushint(st,-1); return 0; } iter = mapit_getallusers(); for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) ) if (pl_sd->bl.m == m && pc_get_group_level(pl_sd) < 1) count++; mapit_free(iter); script_pushint(st,count); return 0; } Edited April 27, 2013 by Cydh Quote Link to comment Share on other sites More sharing options...
Lord Ganja Posted April 27, 2013 Group: Members Topic Count: 141 Topics Per Day: 0.03 Content Count: 444 Reputation: 22 Joined: 06/18/12 Last Seen: August 11, 2018 Author Share Posted April 27, 2013 BUILDIN_FUNC(getmapusers) { int count = 0; const char *str; int16 m; struct map_session_data *pl_sd; struct s_mapiterator* iter; str=script_getstr(st,2); if( (m=map_mapname2mapid(str))< 0){ script_pushint(st,-1); return 0; } iter = mapit_getallusers(); for( pl_sd = (TBL_PC*)mapit_first(iter); mapit_exists(iter); pl_sd = (TBL_PC*)mapit_next(iter) ) if (pl_sd->bl.m == m && pc_get_group_level(pl_sd) < 1) count++; mapit_free(iter); script_pushint(st,count); return 0; } Thanks! Solved! Quote Link to comment Share on other sites More sharing options...
Cydh Posted April 27, 2013 Group: Developer Topic Count: 153 Topics Per Day: 0.03 Content Count: 2285 Reputation: 748 Joined: 06/16/12 Last Seen: February 21 Share Posted April 27, 2013 Thanks! Solved!I like your signature~ Quote Link to comment Share on other sites More sharing options...
Question
Lord Ganja
Could you help me to edit the src so that GM's are ignored/not counted in the script 'getmapusers'.
I tried to edit my script.c using this one here http://rathena.org/board/topic/66820-gm-ignored-in-getmapusers/
but it got errors. Whenever I tried to click the Abort, Retry, or Ignore, it causes the mapserver to stop.
Here's a screenshot of the error:
Any help please? Thanks in advance!
Edited by Lord GanjaLink to comment
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.