jupeto 3 Posted April 30, 2017 Is there a way to determine base and job levels in a party? given the party id or the invoking character? using getpartymember(getcharid(CHAR_ID_PARTY)); Quote Share this post Link to post Share on other sites
0 bWolfie 139 Posted May 1, 2017 Not sure if there's a better way, but one way you could do it is using attachrid. I didn't test, kinda working on logic. The way it works is: 1. Fetch party ID. 2. Check if party member is online. If yes, continue. If no, loop again to next array and check. 3. attachrid of the online AID, collect their BaseLevel and put it in an array (.@blvl[]). 4. detachrid; display name + base level - script Party Member Base Level FAKE_NPC,{ getpartymember(getcharid(CHAR_ID_PARTY)); for (.@i = 0; .@i < $@partymembercount; ++.@i) { if (isloggedin($@partymemberaid[.@i])) { attachrid($@partymemberaid[.@i]); .@blvl[.@i] = BaseLevel; detachrid; dispbottom("" + $@partymembername$[.@i] + ": Level " + .@blvl[.@i] + ""); } } end; } Quote Share this post Link to post Share on other sites
0 jupeto 3 Posted May 1, 2017 [Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: dispbottom (1 parameter): [Debug]: Data: string value="Jupeto: Level 99" [Debug]: Source (NPC): Teaching Manager at prontera (144,282) Quote Share this post Link to post Share on other sites
0 bWolfie 139 Posted May 1, 2017 Sorry, I provided a bad script. Script needs to reattach to detach and attach from yourself before it can run again. Hopefully this works: https://pastebin.com/3EzxL3fB Quote Share this post Link to post Share on other sites
0 jupeto 3 Posted May 1, 2017 (edited) [Error]: script_rid2sd: fatal error ! player not attached! [Debug]: Function: __setr (2 parameters): [Debug]: Data: variable name='.@blvl' index=0 [Debug]: Data: param name='BaseLevel' type=11 [Debug]: Source (NPC): SamplePartyBaseLevel at prontera (144,282) [Warning]: script_get_val: cannot access player variable 'BaseLevel', defaulting to 0 I only use this code getpartymember(getcharid(CHAR_ID_PARTY)); for (.@i = 0; .@i < $@partymembercount; ++.@i) { dispbottom($@partymemberaid[.@i] + " : " + $@partymembercid[.@i] + " (" + $@partymembername$[.@i]) + ")"; } close; the result of each account id and character id is 0, maybe that's why your code doesn't work... but the member name is OK EDIT 2: I wonder why the code below works, I need to specify all 3 types to get the account id, character id, and character names getpartymember(getcharid(CHAR_ID_PARTY), 0); getpartymember(getcharid(CHAR_ID_PARTY), 1); getpartymember(getcharid(CHAR_ID_PARTY), 2); .@aid = getcharid(CHAR_ID_ACCOUNT); for (.@i = 0; .@i < $@partymembercount; ++.@i) { if (isloggedin($@partymemberaid[.@i], $@partymembercid[.@i])) { detachrid; attachrid($@partymemberaid[.@i]); .@blvl[.@i] = BaseLevel; detachrid; attachrid(.@aid); dispbottom("" + $@partymembername$[.@i] + ": Level " + .@blvl[.@i] + ""); } } close; Edited May 1, 2017 by jupeto Quote Share this post Link to post Share on other sites
0 bWolfie 139 Posted May 1, 2017 Is it good now? Actually I didn't read the script_commands.txt doc properly haha didn't notice you need to specify type. If you are still having issues I will try to test tomorrow. Quote Share this post Link to post Share on other sites
0 jupeto 3 Posted May 1, 2017 Thank you for your support, I did manage to get those 3 types already... Quote Share this post Link to post Share on other sites
Is there a way to determine base and job levels in a party? given the party id or the invoking character?
using getpartymember(getcharid(CHAR_ID_PARTY));
Share this post
Link to post
Share on other sites