Did you know? elitepvpers has its own image host, epvpimg.com.
[Guide]Remove GM protction-send blackname to jail
This is a discussion on [Guide]Remove GM protction-send blackname to jail within the CO2 PServer Guides & Releases forum part of the CO2 PServer - Discussions / Questions category; # Update 1
Fix dieing into jail again - add message has killed by xx
#Update 2
1-Add NPC To ...
# Update 1 Fix dieing into jail again - add message has killed by xx
#Update 2 1-Add NPC To jail to let u out for 4kk or 54 Cps
2- Change points from 99 to 29(you must change code again)
hi
it is first help i make here
plz don't flam , i just send for some newbies that don't know(I'm also noob lol)
and I'm don't take from any one i just make it
and Hint for all beginners don't aim to publish source on line quickly ,but try to learn C# and practice for make any thing yourself
it works for me at shadow server
lets go
First : How to remove GM protection on guards :
Go to "entities.cs" go to line 334
u should find some thing like that :
Quote:
if (MType == 1)
if (Target != null)
if (Target.MyClient.Status == 15)
Target = null;
u may delete it or put protection on type u want
(i just know Status ==8 >> GM / 7 >>>PM )
sorry i'm just starter ,so if u have some thing best tell here for all
Second : How to Make Black Name Send to jail on (Now Working on die so u can't revive him with skill or command):
1-go to "character.cs" go to Line 827 or Search for
Quote:
public void Die()
{
try
{
DeathSent = true;
World.UpdateSpawn(this);
int EModel;
if (Model == 1003 || Model == 1004)
EModel = 15099;
else
EModel = 15199;
if (PKPoints >29)
{
World.SendMsgToAll("Player "+Name+" has Killed Too Much And has been but into Jail at Last ", " Kfa2a[GM]", 2011);
Teleport(6000 ,60 ,60);
}
2-go to "Character.cs" go to Line 795 (Press Ctrl+G):
or search for
[quote]if (Tele)
{
foreach (ushort[] revp in DataBase.RevPoints)
{[QUOTE]
after " { "
and before
Quote:
if (revp[0] == LocMap)
{
Teleport(revp[1], revp[2], revp[3]);
break;
}
add
Quote:
if(PKPoints>29)
{
Teleport(6000,60,60);
}
**Adding Jail NPC
go to ur [Only registered and activated users can see links. ]
then go to conquer database >> Table >> Npc
Click Insert and fill fields as follow :
Quote:
UID 1250
Type 1160
Name JailWarden (or name u want but must not have space just one word)
Flags 2
Direction 2
X 60
Y 60
Map 1002
Sobtype 0
then go to Your Source >>> Client.Cs
Go to NPC Section>>
and Search for
Quote:
if (CurrentNPC == 211)
{
SendPacket(General.MyPackets.NPCSay("Do you want to leave the market? I can teleport you for free."));
SendPacket(General.MyPackets.NPCLink("Yeah. Thanks.", 1));
SendPacket(General.MyPackets.NPCLink("No, I shall stay here.", 2));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
after it add this :
Quote:
if (CurrentNPC == 1250)
{
SendPacket(General.MyPackets.NPCSay("Hello,I'm Jail Telporter"));
SendPacket(General.MyPackets.NPCSay("i can telport u ,what u want"));
SendPacket(General.MyPackets.NPCLink("Iwant to go out.", 1));
SendPacket(General.MyPackets.NPCLink("Just passing by.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
if (CurrentNPC == 1250)
{
if(Control == 1)
{
SendPacket(General.MyPackets.NPCSay("if You Want to Go out,you must be not red name or Black name."));
SendPacket(General.MyPackets.NPCSay("if You Want to Gou out,you must have PK point Less than 30."));
SendPacket(General.MyPackets.NPCLink("Let me out.", 11));
SendPacket(General.MyPackets.NPCLink("What about me??.", 22));
SendPacket(General.MyPackets.NPCLink("just Passing by.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
if (Control == 11)
{
if (MyChar.PKPoints<30)
{
MyChar.Teleport(1002,350,320);
}
else
{
SendPacket(General.MyPackets.NPCSay("Sorry,Your Pk points is more 29 u can't out yet."));
SendPacket(General.MyPackets.NPCLink("How I can get out.", 22));
SendPacket(General.MyPackets.NPCLink("Damn.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
if (Control == 22)
{
if (MyChar.PKPoints < 30)
{
SendPacket(General.MyPackets.NPCSay("You are free now ,i will telport you."));
SendPacket(General.MyPackets.NPCLink("Thank you.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
MyChar.Teleport(1002, 429, 378);
}
else if (MyChar.PKPoints > 29 && MyChar.PKPoints < 99)
{
SendPacket(General.MyPackets.NPCSay("Sorry,You are Red name, you can't out until Your pk points Less than 29."));
SendPacket(General.MyPackets.NPCSay("or You Can Pay 4,000,000 Cash,it will award to your Killer."));
SendPacket(General.MyPackets.NPCLink("Ok, i will pay.", 40));
SendPacket(General.MyPackets.NPCLink("Damn.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
else if (MyChar.PKPoints > 100)
{
SendPacket(General.MyPackets.NPCSay("Sorry,You are Black name, you can't out until Your pk points Less than 29."));
SendPacket(General.MyPackets.NPCSay("or You Can Pay 54 Cps Cash,it will award to your Killer."));
SendPacket(General.MyPackets.NPCLink("Ok, i will pay.", 54));
SendPacket(General.MyPackets.NPCLink("Damn.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
if (MyChar.Silvers > 3999999)
{
MyChar.Silvers -= 4000000;
MyChar.Teleport(1002, 427, 378);
SendPacket(General.MyPackets.Vital(MyChar.UID, 4, MyChar.Silvers));
MyChar.Teleport(1002, 350, 320);
World.SendMsgToAll("The Killer " + MyChar.Name + "has pay for his crimes and donate 4,000,000", " Kfa2a[GM]", 2011);
SendPacket(General.MyPackets.NPCSay("i will take 4,000,000 and teleport you."));
SendPacket(General.MyPackets.NPCSay("the money will go to Your Killer."));
SendPacket(General.MyPackets.NPCLink("Thank you.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
else
{
SendPacket(General.MyPackets.NPCSay("Sorry You don't have Enought Silvers"));
SendPacket(General.MyPackets.NPCLink("damn.",255)) ;
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
if (Control == 54)
{
if (MyChar.CPs>53)
{
MyChar.Teleport(1002, 427, 378);
MyChar.CPs -= 54;
SendPacket(General.MyPackets.Vital(MyChar.UID, 30, MyChar.CPs));
World.SendMsgToAll("The Killer \"" + MyChar.Name + "has payfor his crimes and donate 54 Cps", " Kfa2a[GM]", 2011);
SendPacket(General.MyPackets.NPCSay("i will take 54 cps and teleport you."));
SendPacket(General.MyPackets.NPCSay("the money will go to Your Killer."));
SendPacket(General.MyPackets.NPCLink("Thank you.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
else
{
SendPacket(General.MyPackets.NPCSay("Sorry You don't have Enought Cps"));
SendPacket(General.MyPackets.NPCLink("damn.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
}
Wait for update to make money go to killer
Now To Prevent using city Scrolls to use in Jail (ty For @tao4229 for remind me) :
go to Character.cs and search for (Near Line 2808)
if(MyChar.LocMap == 6000&&MyChar.PKPoints > 29)
{
MyChar.MyClient.SendPacket(General.MyPackets.SendM sg(MyChar.MyClient.MessageId, "SYSTEM", MyChar.MyClient.MyChar.Name , "You can't use /scrolls Command here untill your Pk points less than 29 " , 2005));
}
}
}
sorry I'm just starter ,so if u have some thing best tell here for all
i hope it work for all ,and i will give more soon as i make new
press thanks if u see it is good
__________________
Last edited by elragal_30; 09-18-2008 at 20:15.
Reason: fix die in jail agian&& ADD NPC Jail
TBH, I got like the latest version of LOTF out there, so the jail thing was already in mine, but if you do it this way, you can scroll out of jail... so... You may want to look in the scroll Item usage and add some if statements =]
[quote=elragal_30;1416754]hi
it is first help i make here
plz don't flam , i just send for some newbies that don't know(I'm also noob lol)
and I'm don't take from any one i just make it
and Hint for all beginners don't aim to publish source on line quickly ,but try to learn C# and practice for make any thing yourself
it works for me at shadow server
lets go
First : How to remove GM protection on guards :
Go to "entities.cs" go to line 334
u should find some thing like that :
u may delete it or put protection on type u want
(i just know Status ==8 >> GM / 7 >>>PM )
sorry i'm just starter ,so if u have some thing best tell here for all
Second : How to Make Blue Name Send to jail on (revive not on die):
go to "Character.cs" go to Line 795 (Press Ctrl+G):
or search for
[QUOTE]if (Tele)
{
foreach (ushort[] revp in DataBase.RevPoints)
{
Quote:
after " { "
and before
add
sorry I'm just starter ,so if u have some thing best tell here for all
i hope it work for all ,and i will give more soon as i make new
press thanks if u see it is good
Just make the Jail System when you Die, Very easy to code, ...
@nTL3fTy
u mean u want black name don't revive
idk because i don't have revive work on my source yet
but i think that solve that u but this on Die Void not at Revive , i'll try when i get Revive Skill work ##EDIT##Fixed now when u die u sent to jail immediately and when revive also sent to jail
so u'll not be able to revive him @YukiXian
yes i will be already more useful ,but i can't code it yet ,if u know post it ##Edit##i aready Fix it Now and update Topic
Last edited by elragal_30; 09-07-2008 at 22:35.
Reason: #Update topic Fix it work on die now
sorry I'm just starter ,so if u have some thing best tell here for all
i hope it work for all ,and i will give more soon as i make new
press thanks if u see it is good
For checking if the character is in jail with more than 99 PK Points:
Code:
if (LocMap == 6000 && PKPoints > 99)
return;
That goes before anything happens of course:
Code:
else if (ItemParts[0] == "1060020")
{
if (LocMap == 6000 && PKPoints > 99)
return;
Teleport(1002, 429, 378);
RemoveItem(ItemUID);
}
the players leaves the NPC how i fix it?...
if (CurrentNPC == 104801)
{
if (Control == 1)
{
if (MyChar.LocMap == 6000 && MyChar.PKPoints > 99)
{
MyChar.Teleport(1002, 514, 355);
}
}
}
and, the players die in jail when they are taken again get jail ..
the players leaves the NPC how i fix it?...
if (CurrentNPC == 104801)
{
if (Control == 1)
{
if (MyChar.LocMap == 6000 && MyChar.PKPoints > 99)
{
MyChar.Teleport(1002, 514, 355);
}
}
}
and, the players die in jail when they are taken again get jail ..
sorry idk what u mean ??
u want make Jail Npc let pepople to leave jail when the lost them pk points ??
and what u mean by
Quote:
and, the players die in jail when they are taken again get jail