Jump to content
  • 0

Adding Penalty to my Pvp Points System


Question

Posted (edited)

Please Help. I want to put penalty when player killing the same person 10x -30 #pvppoints, 1 minute mute then warp save point.

 

-    script    pvppoint    -1,{
OnInit:

set .killaddpoint, 1; //points to add when kill
set .diedeductpoint, 1; //points to deduct when died
setarray .points,"#pvppoints","PVP Points";end;

OnPCKillEvent:
if(!getmapflag(strcharinfo(3),mf_pvp)) end;

if(getcharid(3)==killedrid) end;

set #pvppoints, #pvppoints+.killaddpoint;

dispbottom "You killed "+rid2name(killedrid)+" you gained "+.killaddpoint+" PVP Points.";
dispbottom "You got total "+#pvppoints+" Points.";

attachrid(killedrid);

set #pvppoints, #pvppoints-.diedeductpoint;

dispbottom "You are killed by "+rid2name(killerrid)+" you lost "+.diedeductpoint+" PVP Points.";
dispbottom "You got total "+#pvppoints+" Points.";

end;

}
 

Edited by itsmeyoe

1 answer to this question

Recommended Posts

  • 0
Posted

try

-    script    pvppoint    -1,{
	OnInit:
		.same_kill_count = 10;
		.same_kill_point_penalty = -30;
		
		.killaddpoint = 1; //points to add when kill
		.diedeductpoint = 1; //points to deduct when died
		end;
		
	OnPCKillEvent:
		if(getcharid(3) == killedrid || !getmapflag(strcharinfo(3),mf_pvp)) end;
		
		if (!LAST_KILLEDRID || LAST_KILLEDRID == killedrid) {
			LAST_KILLEDRID = killedrid;
			LAST_KILLEDRID_COUNT++;
			
			if (LAST_KILLEDRID_COUNT >= .same_kill_count) {
				addtimer (60 * 1000), strnpcinfo(3)+"::OnWarp";
				#pvppoints -= .same_kill_point_penalty;
				dispbottom "You killed "+rid2name(killedrid)+" "+.same_kill_count+" times, hence you gained "+.same_kill_point_penalty+" PVP Points.";
				dispbottom "You got total "+#pvppoints+" Points.";
				end;
			}
		}
		else LAST_KILLEDRID_COUNT = 1;
		
		#pvppoints += .killaddpoint;
		dispbottom "You killed "+rid2name(killedrid)+" you gained "+.killaddpoint+" PVP Points.";
		dispbottom "You got total "+#pvppoints+" Points.";

		attachrid(killedrid);
		#pvppoints -= .diedeductpoint;
		dispbottom "You are killed by "+rid2name(killerrid)+" you lost "+.diedeductpoint+" PVP Points.";
		dispbottom "You got total "+#pvppoints+" Points.";
		end;
		
	OnWarp:
		if (getmapflag(strcharinfo(3),mf_pvp)) {
			warp "SavePoint", 0, 0;
		}
		end;
		
}

 

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.   Paste as plain text instead

  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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...