Jump to content

Recommended Posts

Posted

File Name: Partyinvite Script Command

File Submitter: Xantara

File Submitted: 08 Aug 2012

File Category: Source Modifications

Content Author: Xantara

Information

This script command will will add the player attached to the party specified by the id.

Syntax

partyinvite(<party id>{,<type>});

Documentation

This function will add the player attached to the party specified by the id.

If type is 1 or omitted, player will be added to the party only if player

has no current party. Otherwise, player will leave their current

party and add them to the new party.

If party does not exist, player is already in the party, party is full,

or player has a party (for type 1), this function will return 0.

If successful, it will return 1.

[Made by Xantara]

Mirror

Credits

Created by @Xantara

Requested by @Tetsuken

88x31.png

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

Do not mirror without my consent.

Click here to download this file

  • Upvote 6
Posted

I believe this should still work but it was made a while ago. If someone has downloaded and tried it out, please let me know how it turned out. Especially if there are any bugs. This will help me know if I should submit a request to add to the SVN or not (not guaranteed). Thanks!

Posted (edited)

Yep remind me a bit of partyjoin but still good to add some cmd.

About bug I didn't try it to be sure but I'm quite sure it wont be good :

"If I already have a team and type 1 and 2 ain't specified you'll had me on a second team (best scenario) or make it crash (worse).."

So either we had a if(!(type&3)) return 0; //check if valid type.

Or we need to change type check..

Also but that quite minor you're returning 1 (success) assuming player was added correctly even trought it may fail on this reply (but since those return nothing ain't much you can do about it ithout affecting other functions...)

nb :

why not using ARR_FIND to remove thatuseless flag var ?

ARR_FIND( 0, MAX_PARTY, i, p->party.member[i].account_id == 0);
if (i >= MAX_PARTY) push0.....

Edited by Lighta
  • 3 weeks later...
Posted

@Lighta, thanks for the bug report~

@Topic, I updated the patch file to v1.1 to fix the bugs Lighta mentioned and optimized it with the ARR_FIND macro. As requested by a user, I have also uploaded a sample NPC script that will add a member to the party.

Posted

Oki glad to help, now it's just your explanation that is a bit trickie.

At first read I tought that I'll join the party if I could (mean party not full and I'm not already part in it) but then I realise type was default to 1.

So yep all good, if I want to force join a party I have to specify a type !=1

(I personally would default to 0 and specify both case, so easier to get it but it correct =)

Now only real issue is that it will return 1 (succes) even if char-server down (wich will really be a failure).

  • 1 month later...
Posted

File Name: Partyinvite Script Command

File Submitter: Xantara

File Submitted: 08 Aug 2012

File Category: Source Modifications

Content Author: Xantara

Information

This script command will will add the player attached to the party specified by the id.

Syntax

partyinvite(<party id>{,<type>});

Documentation

This function will add the player attached to the party specified by the id.

If type is 1 or omitted, player will be added to the party only if player

has no current party. Otherwise, player will leave their current

party and add them to the new party.

If party does not exist, player is already in the party, party is full,

or player has a party (for type 1), this function will return 0.

If successful, it will return 1.

[Made by Xantara]

Mirror

Credits

Created by @Xantara

Requested by @Tetsuken

88x31.png

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

Do not mirror without my consent.

Click here to download this file

is this correct?

partyinvite TeamA,1;

Join the conversation

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

Guest
Reply to this topic...

×   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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...