Help with an old source edit please!

Aeromesi

Custom Instance Maniac
Messages
821
Points
0
Age
33
Location
Custom Instances
Discord
Aeromesi#0293
Github
http://www.github.com/aeromesi
Emulator
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:

Code:
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:
 
Code:
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?
 
Try this (remember that Hercules uses interfaces and script.c is a bit different)

Code:
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;}
 
Back
Top