|
You last visited: Today at 18:03
Advertisement
help with black name captured
Discussion on help with black name captured within the CO2 Private Server forum part of the Conquer Online 2 category.
08/29/2014, 07:20
|
#1
|
elite*gold: 0
Join Date: Aug 2009
Posts: 94
Received Thanks: 6
|
help with black name captured
hello every 1
can any1 tell me why when i kill some1 have black name he dosent go to jail ?
i check the codes and is think its right
the code is
PHP Code:
if (PKPoints > 99)
{
if (KillerName.EntityFlag == EntityFlag.Player)
{
Kernel.SendWorldMessage(new Network.GamePackets.Message(Name + " has been captured by " + KillerName.Name + " and sent in jail! The world is now safer!", System.Drawing.Color.Red, Message.Talk), Program.GamePool);
Teleport(6000, 50, 50);
}
else
{
Kernel.SendWorldMessage(new Network.GamePackets.Message(Name + " has been captured and sent in jail! The world is now safer!", System.Drawing.Color.Red, Message.Talk), Program.GamePool);
Teleport(6000, 50, 50);
|
|
|
08/29/2014, 07:34
|
#2
|
elite*gold: 12
Join Date: Jul 2011
Posts: 8,283
Received Thanks: 4,192
|
I can't see anything immediately wrong with the above code (assuming this is being called from the now-dead character's class). Breakpoint it. It doesn't take much effort to debug the source. Have you tried anything?
|
|
|
08/29/2014, 07:39
|
#3
|
elite*gold: 0
Join Date: Aug 2009
Posts: 94
Received Thanks: 6
|
Quote:
Originally Posted by Spirited
I can't see anything immediately wrong with the above code (assuming this is being called from the now-dead character's class). Breakpoint it. It doesn't take much effort to debug the source. Have you tried anything?
|
i tried to do everything and all is failed
and i checked
public void Die(Entity killer)
and i find everything is good too
it same like that
PHP Code:
if (killer.EntityFlag == EntityFlag.Player)
DropRandomStuff(Killer);
else
DropRandomStuff(Killer);
and it drop gear from players if they r have more than 29 pkpoints mean everything is good
but still dosent work
|
|
|
08/29/2014, 07:43
|
#4
|
elite*gold: 12
Join Date: Jul 2011
Posts: 8,283
Received Thanks: 4,192
|
Quote:
Originally Posted by girgismena
i tried to do everything and all is failed
and i checked
public void Die(Entity killer)
and i find everything is good too
it same like that
PHP Code:
if (killer.EntityFlag == EntityFlag.Player) DropRandomStuff(Killer); else DropRandomStuff(Killer);
and it drop gear from players if they r have more than 29 pkpoints mean everything is good
but still dosent work
|
Again, debug the source. Use breakpoints, put output statements, do something. Just checking code won't fix your problems. You need to test it and step through the execution.
Edit: Why do you have an else statement that does the same thing is the if statement? That doesn't look right to me.
|
|
|
08/29/2014, 08:35
|
#5
|
elite*gold: 0
Join Date: Aug 2009
Posts: 94
Received Thanks: 6
|
1st of all thanks for that post
[Guide] How to Debug Your Server
its my 1st time i see that
i still dont understand everything about breakpoints but i will try to learn how it work from your post
thanks again
|
|
|
08/29/2014, 08:51
|
#6
|
elite*gold: 12
Join Date: Jul 2011
Posts: 8,283
Received Thanks: 4,192
|
Quote:
Originally Posted by girgismena
1st of all thanks for that post
[Guide] How to Debug Your Server
its my 1st time i see that
i still dont understand everything about breakpoints but i will try to learn how it work from your post
thanks again
|
Well, you seem to know how to read code, so you already have a good foot in the door. Learning how to debug your code is a huge step up though (not in difficultly, but in how effective you are as a programmer). Let me know how well that guide works out for you after you've taught yourself a bit more. If there's anything I can clarify with it, let me know.
|
|
|
08/29/2014, 09:18
|
#7
|
elite*gold: 0
Join Date: Aug 2009
Posts: 94
Received Thanks: 6
|
Quote:
Originally Posted by Spirited
Well, you seem to know how to read code, so you already have a good foot in the door. Learning how to debug your code is a huge step up though (not in difficultly, but in how effective you are as a programmer). Let me know how well that guide works out for you after you've taught yourself a bit more. If there's anything I can clarify with it, let me know.
|
thanks again brother
but i have one point i dont understand it yet
when i made breakpoints in that code
PHP Code:
if (PKPoints > 99) { if (KillerName.EntityFlag == EntityFlag.Player) { Kernel.SendWorldMessage(new Network.GamePackets.Message(Name + " has been captured by " + KillerName.Name + " and sent in jail! The world is now safer!", System.Drawing.Color.Red, Message.Talk), Program.GamePool); Teleport(6000, 50, 50); } else { Kernel.SendWorldMessage(new Network.GamePackets.Message(Name + " has been captured and sent in jail! The world is now safer!", System.Drawing.Color.Red, Message.Talk), Program.GamePool); Teleport(6000, 50, 50);
and start the project from F11 (Step into)
when i can stop use F11 or F10 and when i have to use F10 or F11 ?
i know its a stupid question but like what i said its my 1st time i use the breakpoints
now i got it
i made my 1st breakpoint 
but i dont know mean of all what i got
can u explan more ?
if u want me to take pic for what i got i will
---------------
lol thanks alot brother
i understand the problem now after i read ur post more and more and understand what mean of breakpoint and how it work
now i can explan my problem
the problem
"the black name didnt captured cuz the killer didnt got pkpoints when he killing him
so i tried that to be sure is that problem or not
if (PKPoints > 50)
and when i make the account just red name with 51 pk point and killing him
he got captured and sent to jail
now any idea to make the killer got pkpoints on black name
|
|
|
08/29/2014, 17:36
|
#8
|
elite*gold: 12
Join Date: Jul 2011
Posts: 8,283
Received Thanks: 4,192
|
The person dying doesn't have PK Points? Well, now that's a more defined problem that we might be able to help with. Try putting a breakpoint on the actual PK Points property in the character class (the set method that sets PK Points). See how it's being set when you try killing someone). Good luck!
|
|
|
08/29/2014, 17:49
|
#9
|
elite*gold: 0
Join Date: Aug 2009
Posts: 94
Received Thanks: 6
|
Quote:
Originally Posted by Spirited
The person dying doesn't have PK Points? Well, now that's a more defined problem that we might be able to help with. Try putting a breakpoint on the actual PK Points property in the character class (the set method that sets PK Points). See how it's being set when you try killing someone). Good luck!
|
no The person dying have PK Points , but if he had more than 100 pk points
the killer didnt got pk points on him
|
|
|
08/29/2014, 17:53
|
#10
|
elite*gold: 12
Join Date: Jul 2011
Posts: 8,283
Received Thanks: 4,192
|
Quote:
Originally Posted by girgismena
no The person dying have PK Points , but if he had more than 100 pk points
the killer didnt got pk points on him
|
Hm, so you're saying that if the PKer kills another player, the PK points do stack up... but as soon as it stacks up to 100 points, and the PKer gets a black name, the PK points go to zero? Also, just to make sure, the code you posted is being called by the dying character, right?
|
|
|
08/29/2014, 18:10
|
#11
|
elite*gold: 0
Join Date: Aug 2009
Posts: 94
Received Thanks: 6
|
Quote:
Originally Posted by Spirited
Hm, so you're saying that if the PKer kills another player, the PK points do stack up... but as soon as it stacks up to 100 points, and the PKer gets a black name, the PK points go to zero? Also, just to make sure, the code you posted is being called by the dying character, right?
|
not go to zero
i know my english is sucks
but i will try to explan more
1-if u have 0 pk point and i killed u i got 10 pk point or 5 or 3 as what i'm ( enamy or guild enamy or normal player)
2- if you have more than 30 pk point and i killed you i got pk point too and drop ur gear
3- if you have more than 100 pk points and i killed you i will not get any pk points
like if you in free map
-------------------
by the way
when i made breakpoint on
if (PKPoints > 99)
and kill some1 have black name
no result in the project
but when i kill some1 else have white name or red name
i got many results
check the pic
http://im50.gulfup.com/yLNwfF.jpg
and that when i killing normal player
i hope that will help you to understand me
|
|
|
08/30/2014, 04:50
|
#12
|
elite*gold: 12
Join Date: Jul 2011
Posts: 8,283
Received Thanks: 4,192
|
It seems like the code isn't being hit. Try backtracking - put the breakpoint further up in the code and follow it using the step into / step over buttons (as you've seen in my guide).
|
|
|
08/30/2014, 05:24
|
#13
|
elite*gold: 0
Join Date: Aug 2009
Posts: 94
Received Thanks: 6
|
Quote:
Originally Posted by Spirited
It seems like the code isn't being hit. Try backtracking - put the breakpoint further up in the code and follow it using the step into / step over buttons (as you've seen in my guide).
|
when i use step into / step over it just go to program class and check codes there
i made many breakpoints
from the 1st code of
PHP Code:
public void DropRandomStuff(Entity KillerName
to
PHP Code:
if (PKPoints > 99)
{
if (KillerName.EntityFlag == EntityFlag.Player)
{
Kernel.SendWorldMessage(new Network.GamePackets.Message(Name + " has been captured by " + KillerName.Name + " and sent in jail! The world is now safer!", System.Drawing.Color.Red, Message.Talk), Program.GamePool);
Teleport(6000, 30, 76);
}
else
{
Kernel.SendWorldMessage(new Network.GamePackets.Message(Name + " has been captured and sent in jail! The world is now safer!", System.Drawing.Color.Red, Message.Talk), Program.GamePool);
Teleport(6000, 30, 76);
all have result exept pkpoints > 99
no result it seem like project doesn't read that
i'm really sorry cuz i bother u with my problem .
|
|
|
08/30/2014, 05:46
|
#14
|
elite*gold: 12
Join Date: Jul 2011
Posts: 8,283
Received Thanks: 4,192
|
Remove other breakpoints then. Only target one problem at a time. Are you calling the PK points check from "DropRandomStuff"? That may be your problem. Keep following it up, or right click on the method name and select "Find All References". See where it's being called from and when it's called by the server.
|
|
|
08/30/2014, 06:02
|
#15
|
elite*gold: 0
Join Date: Aug 2009
Posts: 94
Received Thanks: 6
|
Quote:
Originally Posted by Spirited
Remove other breakpoints then. Only target one problem at a time. Are you calling the PK points check from "DropRandomStuff"? That may be your problem. Keep following it up, or right click on the method name and select "Find All References". See where it's being called from and when it's called by the server.
|
if it doesn't check from "DropRandomStuff"
so how u can drop gear from ppl have more than 30 pk points ?
and when i make Find All References on the method it just find 3 results
1st result is the method name
2nd
PHP Code:
DropRandomStuff(Killer);
on die (entity killed) method
3rd 1 in same method
it same like that
PHP Code:
DropRandomStuff(Killer);
else
DropRandomStuff(Killer);
i think the problem is project read who have more than 99 pk points is white name
oh my god
i find the problem and resolve it by your help
thanks alot , thanks very very much
u r really profisional
u helped me not only to resolve that problem
you helped me to learn how to debug my codes and know how i can find and test the problems .
|
|
|
 |
|
Similar Threads
|
[WTS] VERY RARE PET - Tiny Emerald Whelpling, Captured Firefly BURNING LEGION - HORDE
09/06/2012 - World of Warcraft Trading - 2 Replies
Hello
WTS
Tiny Emerald Whelpling
http://www.warcraftpets.com/images/pets/green_whe lp.v6052.jpg
Captured Firefly
http://www.warcraftpets.com/images/pets/firefly.v 6052.jpg
|
WTS 50 Mage w/ Full HK Relic Set w/ Captured Tsunami (Akylios) + 50 Cleric w/ HK gear
04/11/2012 - Rift Trading - 1 Replies
I want to sell am amazing Mage (US Shards). She is fully HK Relic geared (Nyx's Runevoid Set) including Akylios Staff (Captured Tsunami). Over 21000 pts spent in Planar Attunement and still have 400+ pst unspent. She is also Master Artificer (make Powerstone, Witchstone, etc...), Master Miner, and Master Gathering. Making plat is real easy and she has over 1400 plat atm. Also has Water Sig, Battlemaster Sig, and others (for upcoming ID). Focus is over 400, over 600 Great Marks, and almost 200...
|
[Frage] Captured Firesheep ..
01/31/2011 - General Coding - 3 Replies
Captured Firesheep auch die eigenen Cookies?
Warum ich frage?
Wenn ich mich bei Facebook und Co anmelde zeig der nichts an...
Lg Algaten™
|
All times are GMT +1. The time now is 18:05.
|
|