- in script.c :
-- at the begining (l127 on OA1036), after "int
buildin_getguildmasterid(struct script_state *st);" :
add this line :
int buildin_getpositioninguild(struct script_state *st);
-- in buildin_func, (l291 on OA1036), after "
{buildin_getguildmasterid,"getguildmasterid","i"}," :
add this line :
{buildin_getpositioninguild,"getpositioninguild","i"},
-- After the "buildin_getguildmasterid" function (l2625
on OA1036) :
add these lines :
int buildin_getpositioninguild(struct script_state *st)
{
struct map_session_data *sd=script_rid2sd(st);
struct guild *g=NULL;
int g_pos;
g=guild_search(sd->status.guild_id);
sd=map_nick2sd(sd->status.name);
g_pos=guild_getposition(sd,g);
if((g_pos >= 0) && (g_pos < 40)){
push_val(st->stack,C_INT,g_pos);
}else{
push_val(st->stack,C_INT,255);
}
return 0;
}
To use it in script, just write this command :
getpositioninguild(0)
exemple :
mes "Your position in guild is ^FF0000" +
getpositioninguild(0) + "^000000.";