Jump to content
  • 0
Photons

Abuse kill "Stop killing player"

Question

 

-    script    killing    -1,{
OnPCKillEvent:
    set .@counttopunish, 3; // 3 times kill in same minute = OUT
    if ( killedrid == getcharid(3) ) end;
    attachrid killedrid;
    .@charid = getcharid(0);
    attachrid killerrid;
    setd "@count"+ gettime(2) +"_"+ killedrid, getd( "@count"+ gettime(2) +"_"+ killedrid ) +1;
    if ( getd( "@count"+ gettime(2) +"_"+ killedrid ) < .@counttopunish )
        getitem2 7420, 1,1,0,0, 254, 0, .@charid % pow(2,16), .@charid / pow(2,16);
    else {
        announce strcharinfo(0) +", Stop killing "+ rid2name(killedrid) +" !!!", 0;
        warp "Save", 0,0;
    }
    end;
}
 

 


This is from annieruru~ script but instead of counting the skulls killed by a player. i want it to count the kills of a player in one minute can someone help me? thanks
Edited by Photons

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

I think is it you want:
 


 

-	script	killing	FAKE_NPC,{
	end;

	OnInit:
		.count_to_punish = 3;
		.time_interval = 60; // 60s = 1 minute
	end;

	OnPCKillEvent:
		if (attachrid(killedrid) == true)
		{
			if ((@dead_count == 0) || (killerrid != @last_killer) || (@dead_interval <= gettimetick(2)))
			{
				@dead_count = 1;
				@dead_interval = gettimetick(2) + .time_interval;
			}
			else
				@dead_count++;

			@last_killer = killerrid;

			if (.count_to_punish <= @dead_count)
			{
				if (attachrid(killerrid) == true)
				{
					announce strcharinfo(0) +", Stop killing "+ rid2name(killedrid) +" !!!", 0;
					warp getsavepoint(0), getsavepoint(1), getsavepoint(2);
				}
			}
		}
	end;
}

 



@EDIT

 

Fixed little mistake. :)

Edited by Cretino

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×
×
  • Create New...

Important Information

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