I'm trying to build aPvP Rankingscript that allows you to getkill pointsin 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.";
}
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