Hi, I'm trying to limit the number of jobs repeated per guild, checking via script. But, I'm having a lot of difficulties ... My knowledge is beginner and from what I've learned, we still have few commands to do this, making it even harder ...
Because of this, I've been researching and realized that rathena has some interesting commands, which could help further this work, so I created an issue.
- script ckeckguildjob -1,{
OnPCLoadMapEvent:
query_sql "SELECT `guild_id`,`char_id`,`class`,`name` FROM `guild_member`",.@gi,.@ci,.@cl,.@na;
getguildmember(getcharid(0),2);
copyarray .@guildids[0],$@guildmembercid[0],$@guildmembercount;
set .@count, $@guildmembercount;
for (set .@a, 0; .@a < .@count;
set .@a, .@a + 1) {
attachrid .@partyids[.@a];
set .@jobs[.@a], Class;// Check Job from other current jobs
for (set .@b, 0; .@b < getarraysize(.@jobs);
set .@b, .@b + 1) {
if (Class == .@jobs[.@b]) {
set .@matches, .@matches + 1;
}
}// Check if this job as too many
if (.@matches > 2) { // Too Many of the Same Job
//**How to expel the player from the guild here?
}// Less than 2, so reset counter for next player
set .@matches, 0;
}
end;
OnInit:
setarray .castles$[0],
"prtg_cas01","prtg_cas02","prtg_cas03","prtg_cas04","prtg_cas05",
"payg_cas01","payg_cas02","payg_cas03","payg_cas04","payg_cas05",
"gefg_cas01","gefg_cas02","gefg_cas03","gefg_cas04","gefg_cas05",
"aldeg_cas01","aldeg_cas02","aldeg_cas03","aldeg_cas04","aldeg_cas05",
"arug_cas01","arug_cas02","arug_cas03","arug_cas04","arug_cas05",
"schg_cas01","schg_cas02","schg_cas03","schg_cas04","schg_cas05";
for ( .@i = 0; .@i < 30; .@i++ )
setmapflag .castles$[.@i], mf_loadevent;
end;
}
As for my work so far, it has been this way, but it still does not work, as I tried to use getguildmember and this command only appends a specific guild and a full check is required in all guilds on the server. I also thought about doing a check every time someone enters a guild, and if it already has a certain amount of a certain class, it expels the player, but I did not find any form. So I ended up having no idea. So I ask for everyone's help.
Share this post
Link to post
Share on other sites