Deity Posted May 24, 2012 Group: Members Topic Count: 54 Topics Per Day: 0.01 Content Count: 93 Reputation: 0 Joined: 03/04/12 Last Seen: October 23, 2016 Share Posted May 24, 2012 Hi rAthena! How do I attach a Party without attaching any player that belongs to that party? Quote Link to comment Share on other sites More sharing options...
Nicko Posted May 24, 2012 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 15 Reputation: 1 Joined: 05/19/12 Last Seen: May 24, 2012 Share Posted May 24, 2012 What? Can you explain it a little bit different? Quote Link to comment Share on other sites More sharing options...
Bahmut Posted May 24, 2012 Group: Members Topic Count: 17 Topics Per Day: 0.00 Content Count: 382 Reputation: 39 Joined: 01/17/12 Last Seen: February 13, 2020 Share Posted May 24, 2012 I don't think there is a way to attach a hole party to a script. I think you have to attach every single player and do your commands and then detach the old one and attach a new one. From doc/script_commands.txt: *attachrid(<account ID>) *detachrid; These commands allow the manipulation of the script's currently attached player. While attachrid allows attaching of a different player by using it's account id for the parameter rid, detachrid makes the following commands run, as if the script was never invoked by a player. In case, that the player cannot be attached, such as, when the player went offline in the mean time, attachrid returns 0, otherwise 1. and: *getcharid(<type>{,"<character name>"}) This function will return a unique ID number of the invoking character, or, if a character name is specified, of that character. Type is the kind of associated ID number required: 0 - Character ID number. 1 - Party ID number. 2 - Guild ID number. 3 - Account ID number. 4 - Battle ground ID also this: *getpartymember <party id>{,<type>}; Thank you to HappyDenn for all this information. This command will find all members of a specified party and returns their names (or character id or account id depending on the value of "type") into an array of temporary global variables. There's actually quite a few commands like this which will fill a special variable with data upon execution and not do anything else. Upon executing this, $@partymembername$[] is a global temporary string array which contains all the names of these party members (only set when type is 0 or not specified) $@partymembercid[] is a global temporary number array which contains the character id of these party members. (only set when type is 1) $@partymemberaid[] is a global temporary number array which contains the account id of these party members. (only set when type is 2) $@partymembercount is the number of party members that were found. The party members will (apparently) be found regardless of whether they are online or offline. Note that the names come in no particular order. Be sure to use $@partymembercount to go through this array, and not 'getarraysize', because it is not cleared between runs of 'getpartymember'. If someone with 7 party members invokes this script, the array would have 7 elements. But if another person calls up the NPC, and he has a party of 5, the server will not clear the array for you, overwriting the values instead. So in addition to returning the 5 member names, the 6th and 7th elements from the last call remain, and you will get 5+2 members, of which the last 2 don't belong to the new guy's party. $@partymembercount will always contain the correct number, (5) unlike 'getarraysize()' which will return 7 in this case. Quote Link to comment Share on other sites More sharing options...
Question
Deity
Hi rAthena!
How do I attach a Party without attaching any player that belongs to that party?
Link to comment
Share on other sites
2 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.