[Help]Send To Jail On Death

09/05/2008 19:31 DragonStar#1
The code i have sends a black name player to jail but it only send the player
to jail if he/she gets direct hit

If you use a skill such as herc, fb, nado, etc. the char dies and does not get
sent to jail. wut am i missing to correct that?


/////////////////////////////////////////////////////////////////////////////////////
World.PVP(this, PTarget, AtkType, (uint)Damage);

if (PTarget.GetHitDie((uint)Damage))
{
Attacking = false;
if (!Other.CanPK(LocMap))
if (!PTarget.BlueName)
if (PTarget.PKPoints < 100)
{
GotBlueName = DateTime.Now;
BlueName = true;
PKPoints += 10;
MyClient.SendPacket(General.MyPackets.Vital(UID, 6, PKPoints));
if ((PKPoints > 29 && PKPoints - 10 < 30) || (PKPoints > 99 && PKPoints - 10 < 100))
{
MyClient.SendPacket(General.MyPackets.Vital(UID, 26, GetStat()));
World.UpdateSpawn(this);
}
}
if (LocMap != 6000)
{
if (PTarget.PKPoints > 100)
{
PTarget.Teleport(6000, 028, 071);
World.SendMsgToAll(PTarget.Name + " was captured by " + Name + " and sent automaticaly in jail.", "Police", 2008);
}
}
///




///
World.PVP(this, PTarget, 14, 0);
PTarget.PTarget = null;
PTarget.MobTarget = null;
PTarget = null;
}
}


else
PTarget = null;
}
else if (TGTarget != null)
//////////////////////////////////////////////////////////////////////////////////////
09/05/2008 20:25 YukiXian#2
Quote:
Originally Posted by DragonStar View Post
The code i have sends a black name player to jail but it only send the player
to jail if he/she gets direct hit

If you use a skill such as herc, fb, nado, etc. the char dies and does not get
sent to jail. wut am i missing to correct that?


/////////////////////////////////////////////////////////////////////////////////////
World.PVP(this, PTarget, AtkType, (uint)Damage);

if (PTarget.GetHitDie((uint)Damage))
{
Attacking = false;
if (!Other.CanPK(LocMap))
if (!PTarget.BlueName)
if (PTarget.PKPoints < 100)
{
GotBlueName = DateTime.Now;
BlueName = true;
PKPoints += 10;
MyClient.SendPacket(General.MyPackets.Vital(UID, 6, PKPoints));
if ((PKPoints > 29 && PKPoints - 10 < 30) || (PKPoints > 99 && PKPoints - 10 < 100))
{
MyClient.SendPacket(General.MyPackets.Vital(UID, 26, GetStat()));
World.UpdateSpawn(this);
}
}
if (LocMap != 6000)
{
if (PTarget.PKPoints > 100)
{
PTarget.Teleport(6000, 028, 071);
World.SendMsgToAll(PTarget.Name + " was captured by " + Name + " and sent automaticaly in jail.", "Police", 2008);
}
}
///




///
World.PVP(this, PTarget, 14, 0);
PTarget.PTarget = null;
PTarget.MobTarget = null;
PTarget = null;
}
}


else
PTarget = null;
}
else if (TGTarget != null)
//////////////////////////////////////////////////////////////////////////////////////

Well, Thats very hard to code I think, I just got the easy way, When you die, You will be sended to Jail...

And :

Quote:
if (LocMap != 6000)
{
if (PTarget.PKPoints > 100)
{
PTarget.Teleport(6000, 028, 071);
World.SendMsgToAll(PTarget.Name + " was captured by " + Name + " and sent automaticaly in jail.", "Police", 2008);
}
}
That means it will be used in the Map ID 6000. So, Only In jail... ( Useless to Capture someone in jail :p )
09/05/2008 21:05 DragonStar#3
Quote:
if (LocMap != 6000)
{
if (PTarget.PKPoints > 100)
{
PTarget.Teleport(6000, 028, 071);
World.SendMsgToAll(PTarget.Name + " was captured by " + Name + " and sent automaticaly in jail.", "Police", 2008);
}
}
It means if your killed in any map excluding map id 6000 aka jail then then
pk > 100 statement will take effect
09/05/2008 22:54 keving#4
Try
if (PTarget.PKPoints >= 30)
Is better coz with > you only go to jail if u have above 30 PKP
but with main you go with 30 and above :)
09/06/2008 00:34 tao4229#5
Quote:
Originally Posted by keving View Post
Try
if (PTarget.PKPoints >= 30)
Is better coz with > you only go to jail if u have above 30 PKP
but with main you go with 30 and above :)
WOW YOU'RE A GENIUS.


Don't do it on GetHitDie(), do it on the reviving.. That way they will go to jail no matter what...

Well... That could be abused if someone logs off... Maybe doing it on just Die()? I don't know if that get's called or not... Just look into Attack() and wherever the skills are.

Sorry to sound like no help, I is really tired.
09/07/2008 15:21 elragal_30#6
is it work if i put at Rev points like this :

Quote:
public static void LoadRevPoints()
{


if (Character.PKPoints>99)
{

RevPoints = new ushort[22][];
RevPoints[0] = new ushort[4] { 1002, 6000, 50, 50 };
RevPoints[1] = new ushort[4] { 1005, 6000, 50, 50 };
RevPoints[2] = new ushort[4] { 1006, 6000, 50, 50 };
RevPoints[3] = new ushort[4] { 1008, 6000, 50, 50 };
RevPoints[4] = new ushort[4] { 1009, 6000, 50, 50 };
RevPoints[5] = new ushort[4] { 1010, 6000, 50, 50 };
RevPoints[6] = new ushort[4] { 1007, 6000, 50, 50 };
RevPoints[7] = new ushort[4] { 1004, 6000, 50, 50 };
RevPoints[8] = new ushort[4] { 1028, 6000, 50, 50 };
RevPoints[9] = new ushort[4] { 1037, 6000, 50, 50 };
RevPoints[10] = new ushort[4] { 1038, 6000, 50, 50 };
RevPoints[11] = new ushort[4] { 1015, 6000, 50, 50 };
RevPoints[12] = new ushort[4] { 1001, 6000, 50, 50 };
RevPoints[13] = new ushort[4] { 1000, 6000, 50, 50 };
RevPoints[14] = new ushort[4] { 1013, 6000, 50, 50 };
RevPoints[15] = new ushort[4] { 1011, 6000, 50, 50 };
RevPoints[16] = new ushort[4] { 1076, 6000, 50, 50 };
RevPoints[17] = new ushort[4] { 1014, 6000, 50, 50 };
RevPoints[18] = new ushort[4] { 1020, 6000, 50, 50 };
RevPoints[19] = new ushort[4] { 1075, 6000, 50, 50 };
RevPoints[20] = new ushort[4] { 1012, 6000, 50, 50 };
RevPoints[21] = new ushort[4] { 6000, 6000, 50, 50 };


}
09/07/2008 15:22 tao4229#7
Quote:
Originally Posted by elragal_30 View Post
is it work if i put at Rev points like this :
Hello no...

Lol... That will totally screw up your rev points.
09/07/2008 22:11 elragal_30#8
Quote:
Originally Posted by tao4229 View Post
Hello no...

Lol... That will totally screw up your rev points.
yea u r right
and now i get already coded code to make Black name Go to jail and they can't use either (/Scroll Comand) - city scrolls (Twin City Scroll ,....etc)
see it at here
[Only registered and activated users can see links. Click Here To Register...]
i think it may not very stable now , but i'm working on it