Jump to content
  • 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 .@killedvar,getvar(PvPAllowed,getcharid(0,rid2name(killedrid)));
if(.@killedvar == 1 && PvPAllowed == 1){
	set .@party_id,getcharid(1);
	if( !.@party_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 .@party_id,1;
		getpartymember .@party_id,2;
		set .@acc_id, getcharid(3);
		set .@map$,strcharinfo(3);
		for( set .@i, 0; .@i < $@partymembercount; set .@i, .@i +1 )
			if( isloggedin( $@partymemberaid[.@i],$@partymembercid[.@i] ) )
				if( attachrid( $@partymemberaid[.@i] ) )
					if( HP && strcharinfo(3) == .@map$ )
						set .@online_count,.@online_count + 1;
		
		for( set .@i, 0; .@i < $@partymembercount; set .@i, .@i +1 )
			if( isloggedin( $@partymemberaid[.@i],$@partymembercid[.@i] ) )
				if( attachrid( $@partymemberaid[.@i] ) )
					if( HP && strcharinfo(3) == .@map$ ){
			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( .@acc_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

Recommended Posts

  • 0
OnPCKillEvent:
	if ( PvPAllowed == false || getvariableofpc( PvPAllowed, killedrid ) == false ) end;
	.@pid = getcharid(CHAR_ID_PARTY);
	if ( !.@pid ) {
		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 {
		.@killedrid = killedrid;
		getpartymember .@pid, 1;
		getpartymember .@pid, 2;
		.@origin = getcharid(CHAR_ID_ACCOUNT);
		.@map$ = strcharinfo(PC_MAP);
		for ( .@i = 0; .@i < $@partymembercount; ++.@i ) {
			if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) {
				attachrid $@partymemberaid[.@i];
				if ( getcharip(getcharid(CHAR_ID_ACCOUNT)) == getcharip(.@killedrid)) continue;
				if ( last_kill == .@killedrid ) continue;
				last_kill = .@killedrid;
				PvPKills += 25;
				dispbottom "[ "+PvPKills+" ] PvPKills.", 0xF1948A;
			}
		}
	}

@raksone

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

×
×
  • Create New...

Important Information

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