Jump to content
  • 0

Attach Party


Deity

Question


  • Group:  Members
  • Topic Count:  54
  • Topics Per Day:  0.01
  • Content Count:  93
  • Reputation:   0
  • Joined:  03/04/12
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  15
  • Reputation:   1
  • Joined:  05/19/12
  • Last Seen:  

What?

Can you explain it a little bit different?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.00
  • Content Count:  382
  • Reputation:   38
  • Joined:  01/17/12
  • Last Seen:  

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...