Jump to content
  • 0
Sign in to follow this  
Aeromesi

Help with an old source edit please!

Question

I have this old source edit that I used for one of my features on my server, but it doesn't work anymore on Hercules so could someone help me out with this function?

Function name is partyinvite

Code from script.c:

BUILDIN_FUNC(partyinvite){int party_id,i = 0;struct map_session_data *sd = script_rid2sd(st ); struct party_data *p; party_id=script_getnum(st,2); p = party_search(party_id); if (p ) //Search leaderfor(i = 0; i < MAX_PARTY && !p->party.member.leader; i++); if (!p || i == MAX_PARTY) return 0; //leader not foundif(!sd) return 0; //no players in the scriptsd->party_joining = 1;sd->party_invite = party_id;sd->party_invite_account = p->party.member[i].account_id; if( party_member_added(party_id,sd->status.account_id,sd->status.char_id,0) )script_pushint(st,1);elsescript_pushint(st,-1);return 0;}

The error when compiling:
 

 

5>c:usersmichaeldesktopemusrcmapscript.c(19031): warning C4013: 'party_search' undefined; assuming extern returning int5>c:usersmichaeldesktopemusrcmapscript.c(19031): warning C4047: '=' : 'party_data *' differs in levels of indirection from 'int'5>c:usersmichaeldesktopemusrcmapscript.c(19034): error C2231: '.leader' : left operand points to 'struct', use '->'5>c:usersmichaeldesktopemusrcmapscript.c(19042): warning C4013: 'party_member_added' undefined; assuming extern returning int


Any help on this?

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Try this (remember that Hercules uses interfaces and script.c is a bit different)

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); 	p = party->search(party_id); 	if (p ) //Search leader		for(i = 0; i < MAX_PARTY && !p->party.member->leader; i++); 	if (!p || i == MAX_PARTY)		return 0; //leader not found	if(!sd)		return 0; //no players in the script	sd->party_joining = 1;	sd->party_invite = party_id;	sd->party_invite_account = p->party.member[i].account_id; 	if( party->member_added(party_id,sd->status.account_id,sd->status.char_id,0) )		script_pushint(st,1);	else		script_pushint(st,-1);	return true;}

Share this post


Link to post
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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.