Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Usage: partyinvite <party id>;
- // Modified [pan]
- // @return 1 -> Successfully added
- // @return -1 -> Error adding member
- // @return -2 -> Party not found
- BUILDIN(partyinvite)
- {
- int party_id, i = 0;
- struct map_session_data *sd = script_rid2sd(st);
- struct party_data *p;
- party_id = script_getnum(st,2);
- if ( sd )
- {
- // Search party struct
- if( !(p = party->search(party_id)) )
- script_pushint(st,-2); // Party not found
- else
- {
- // Sort members
- for( ; i < MAX_PARTY && !p->party.member[i].leader; i++);
- if ( i != MAX_PARTY )
- {
- // Add sd to party
- sd->party_joining = 1;
- sd->party_invite = party_id;
- sd->party_invite_account = p->party.member[i].account_id;
- ( party->member_added(party_id,sd->status.account_id,sd->status.char_id,0) )? script_pushint(st,1) : script_pushint(st,-1);
- }
- }
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement