• 0
raksone

PvP Points Shared in Party + AntiAbuse

Question

Hello guys,

I'm trying to build a PvP Ranking script that allows you to get kill points in Party mode and that all members get the corresponding points. I am also trying to make an exception where the Killer and Party Members can not get points from the opponent if he has already been killed once in the same round.

Apparently I could achieve it, however, only applies to the person who kills the opponent. The members of the Party do not even receive points for the kill. It seems that the "last_kill" rule only applies to the Killer, not to the Party Members involved in the killing. Do you have any idea how to configure it to apply to all Party members?

 

OnPCKillEvent:
set [email protected],getvar(PvPAllowed,getcharid(0,rid2name(killedrid)));
if([email protected] == 1 && PvPAllowed == 1){
	set [email protected]_id,getcharid(1);
	if( [email protected]_id ){
			if ( getcharip(killedrid) == getcharip(getcharid(3)) ) { end; } // Can't obtain points if player has same IP
			if ( killedrid == last_kill ) { end; } // Can't get points if kill opponent twice in a row.
			set last_kill, killedrid;
			set PvPKills, PvPKills + 25;	
			dispbottom "[ "+PvPKills+" ] PvPKills.", 0xF1948A;
			end;
			} 
			
	}else{
		getpartymember [email protected]_id,1;
		getpartymember [email protected]_id,2;
		set [email protected]_id, getcharid(3);
		set [email protected]$,strcharinfo(3);
		for( set [email protected], 0; [email protected] < [email protected]; set [email protected], [email protected] +1 )
			if( isloggedin( [email protected][[email protected]],[email protected][[email protected]] ) )
				if( attachrid( [email protected][[email protected]] ) )
					if( HP && strcharinfo(3) == [email protected]$ )
						set [email protected]_count,[email protected]_count + 1;
		
		for( set [email protected], 0; [email protected] < [email protected]; set [email protected], [email protected] +1 )
			if( isloggedin( [email protected][[email protected]],[email protected][[email protected]] ) )
				if( attachrid( [email protected][[email protected]] ) )
					if( HP && strcharinfo(3) == [email protected]$ ){
			if ( getcharip(killedrid) == getcharip(getcharid(3)) ) { end; } // Can't obtain points if player has same IP
			if ( killedrid == last_kill ) { end; } // Can't get points if kill opponent twice in a row.
			set last_kill, killedrid;
			set PvPKills, PvPKills + 25;	
			dispbottom "[ "+PvPKills+" ] PvPKills.", 0xF1948A;
			end;
			}
			attachrid( [email protected]_id );
			dispbottom "All your members have won PvP Kill Points.";
			}	

Share this post


Link to post
Share on other sites

1 answer to this question

  • 0
OnPCKillEvent:
	if ( PvPAllowed == false || getvariableofpc( PvPAllowed, killedrid ) == false ) end;
	[email protected] = getcharid(CHAR_ID_PARTY);
	if ( [email protected] ) {
		if ( getcharip(getcharid(CHAR_ID_ACCOUNT)) == getcharip(killedrid)) end;
		if ( last_kill == killedrid ) end;
		last_kill = killedrid;
		PvPKills += 25;
		dispbottom "[ "+PvPKills+" ] PvPKills.", 0xF1948A;
		end;
	}
	else {
		[email protected] = killedrid;
		getpartymember [email protected], 1;
		getpartymember [email protected], 2;
		[email protected] = getcharid(CHAR_ID_ACCOUNT);
		[email protected]$ = strcharinfo(PC_MAP);
		for ( [email protected] = 0; [email protected] < [email protected]; [email protected] ) {
			if ( isloggedin( [email protected][[email protected]], [email protected][[email protected]] ) ) {
				attachrid [email protected][[email protected]];
				if ( getcharip(getcharid(CHAR_ID_ACCOUNT)) == getcharip([email protected])) continue;
				if ( last_kill == [email protected] ) continue;
				last_kill = [email protected];
				PvPKills += 25;
				dispbottom "[ "+PvPKills+" ] PvPKills.", 0xF1948A;
			}
		}
	}

@raksone

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now