Bank Kill System

Started by Amazing, Jan 01, 2016, 07:10 PM

Previous topic - Next topic

Amazing

Hi, guys i need your helps so i need the bank-kill system in which player can't kill player in bank .... So plzz help me

Have a nice day!

MacTavish

actually it was posted in old vcmp forum by @Power so since we have Player.CanAttack = toggle; we can stop player from attacking each other in any place we want


function onPlayerMove( player, lastX, lastY, lastZ, newX, newY, newZ )

{
local checkpoly;
checkpoly = InPoly( player.Pos.x, player.Pos.y, -898.2357,-326.6091,-898.2196,-355.5072,-936.2309,-355.5205,-939.2854,-352.5587,-952.3001,-342.9138,-957.1079,-341.7898,-966.5380,-337.4671,-966.5401,-328.1766 );
if ( checkpoly && player.CanAttack == true)
{
player.CanAttack = false;
Announce("Weapons Disabled", player);
}
if ( !checkpoly && player.CanAttack == false)
{
player.CanAttack = true;
Announce("Weapons Enabled", player);
}
}

TESTED

Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

EK.IceFlake

If onPlayerMove wasn't enough, you now use InPoly in it.

KAKAN

No, don't use onPlayerMove.
Use this:-
function KillBank( killer, player )
{
local checkpoly, checkpoly2;
checkpoly = InPoly( killer.Pos.x, killer.Pos.y, -898.2357,-326.6091,-898.2196,-355.5072,-936.2309,-355.5205,-939.2854,-352.5587,-952.3001,-342.9138,-957.1079,-341.7898,-966.5380,-337.4671,-966.5401,-328.1766 );
checkpoly2 = InPoly( player.Pos.x, player.Pos.y, -898.2357,-326.6091,-898.2196,-355.5072,-936.2309,-355.5205,-939.2854,-352.5587,-952.3001,-342.9138,-957.1079,-341.7898,-966.5380,-337.4671,-966.5401,-328.1766 );
if ( checkpoly || checkpoly2 ) killer.Health = 0, Message( killer.Name + " did a bank kill and get himself dead.");
}

And add this line to onPlayerKill.
KillBank(killer, player);This was actually posted by someone in the old forum, so thought to improve it :)
I would suggest you to set player pos to something else, can't say the reason now.
oh no

MacTavish

But Whats Wrong With Which I Posted @KAKAN @NE.CrystalBlue

Grand Hunting Project
Join #SLC, #KAKAN, #Doom, #GHP @LUnet

Retired VC:MP Player/Scripter :P

KAKAN

Quote from: Kusanagi on Jan 02, 2016, 02:40 PMBut Whats Wrong With Which I Posted @KAKAN @NE.CrystalBlue
It'll make your server lag.
Reason:- Think, there are 10 players in the server, One player moves, the function will be called 1x, 10 players moves, the function will be called 10x times each time someone's x/y/z increases/decreases.
oh no