[HELP]Reset Command

09/14/2008 01:36 DragonStar#1
How would you go about making a reset command like
/resetallpkp <<< would reset all characters in the database pkps to 0
using lotf source
09/14/2008 02:59 tao4229#2
Quote:
Originally Posted by DragonStar View Post
How would you go about making a reset command like
/resetallpkp <<< would reset all characters in the database pkps to 0
using lotf source
My LOTF had /clearpkp in it.. but if you need it here it is...

Code:
                                        if (Splitter[0] == "@clearpkp")
                                        {
                                            MyChar.PKPoints = 0;
                                            MyChar.BlueName = false;
                                            World.UpdateSpawn(MyChar);
                                            SendPacket(General.MyPackets.CharacterInfo(MyChar));
                                            MyChar.SendEquips(false);
                                            SendPacket(General.MyPackets.Vital(MyChar.UID, 26, MyChar.GetStat()));
                                        }
Yeah, i use @commands though >.>

Edit::OH, you mean all characters... that's my bad =P
Like, if you want all characters online, you can just run foreach loop, else it'd take some different coding D=<
09/14/2008 03:31 Mouse>Pro#3
Quote:
Originally Posted by tao4229 View Post
My LOTF had /clearpkp in it.. but if you need it here it is...

Code:
                                        if (Splitter[0] == "@clearpkp")
                                        {
                                            MyChar.PKPoints = 0;
                                            MyChar.BlueName = false;
                                            World.UpdateSpawn(MyChar);
                                            SendPacket(General.MyPackets.CharacterInfo(MyChar));
                                            MyChar.SendEquips(false);
                                            SendPacket(General.MyPackets.Vital(MyChar.UID, 26, MyChar.GetStat()));
                                        }
Yeah, i use @commands though >.>

Edit::OH, you mean all characters... that's my bad =P
Like, if you want all characters online, you can just run foreach loop, else it'd take some different coding D=<
nice but i think he means that he want a command that reset all pkps from all characters in lotf
09/14/2008 03:38 tao4229#4
Quote:
Originally Posted by Mouse>Pro View Post
nice but i think he means that he want a command that reset all pkps from all characters in lotf
Too bad you didn't read my Edit.
09/14/2008 03:41 Mouse>Pro#5
Quote:
Originally Posted by tao4229 View Post
Too bad you didn't read my Edit.
oh sorry, my fault.
09/14/2008 04:17 DragonStar#6
Quote:
Originally Posted by tao4229 View Post
My LOTF had /clearpkp in it.. but if you need it here it is...

Code:
                                        if (Splitter[0] == "@clearpkp")
                                        {
                                            MyChar.PKPoints = 0;
                                            MyChar.BlueName = false;
                                            World.UpdateSpawn(MyChar);
                                            SendPacket(General.MyPackets.CharacterInfo(MyChar));
                                            MyChar.SendEquips(false);
                                            SendPacket(General.MyPackets.Vital(MyChar.UID, 26, MyChar.GetStat()));
                                        }
Yeah, i use @commands though >.>

Edit::OH, you mean all characters... that's my bad =P
Like, if you want all characters online, you can just run foreach loop, else it'd take some different coding D=<
trying to get it too do it to all chars in the database regardless if ther online
or offline, still playing around w/the code
09/14/2008 08:28 kinshi88#7
Something like this maybe?
Haven't tested it.

Code:
                                            if (Splitter[0] == "/clearallpkp")
                                            {
                                                foreach (DictionaryEntry DE in World.AllChars)
                                                {
                                                    MyChar.PKPoints = 0;
                                                    MyChar.BlueName = false;
                                                    SendPacket(General.MyPackets.Vital(MyChar.UID, 6, MyChar.PKPoints));
                                                    World.UpdateSpawn(MyChar);
                                                    SendPacket(General.MyPackets.CharacterInfo(MyChar));
                                                    MyChar.SendEquips(false);
                                                    SendPacket(General.MyPackets.Vital(MyChar.UID, 26, MyChar.GetStat()));
                                                    World.SpawnMeToOthers(MyChar, true);
                                                }
                                            }
09/14/2008 08:39 DragonStar#8
Quote:
Originally Posted by kinshi88 View Post
Something like this maybe?
Haven't tested it.

Code:
                                            if (Splitter[0] == "/clearallpkp")
                                            {
                                                foreach (DictionaryEntry DE in World.AllChars)
                                                {
                                                    MyChar.PKPoints = 0;
                                                    MyChar.BlueName = false;
                                                    SendPacket(General.MyPackets.Vital(MyChar.UID, 6, MyChar.PKPoints));
                                                    World.UpdateSpawn(MyChar);
                                                    SendPacket(General.MyPackets.CharacterInfo(MyChar));
                                                    MyChar.SendEquips(false);
                                                    SendPacket(General.MyPackets.Vital(MyChar.UID, 26, MyChar.GetStat()));
                                                    World.SpawnMeToOthers(MyChar, true);
                                                }
                                            }
nah that still only does one char not all
09/14/2008 08:58 DragonStar#9
well this is just the first part im trying to figure out, wut im trying to do is first figure out
how to reset every1's pkp even if ther offline, then my next step after i figure that out
is to figure out how to make it automatically reset all pkp n the database at a certain time
of day, example 0:00 every day it would reset the pkp
09/14/2008 10:56 adz06676#10
Quote:
Originally Posted by DragonStar View Post
well this is just the first part im trying to figure out, wut im trying to do is first figure out
how to reset every1's pkp even if ther offline, then my next step after i figure that out
is to figure out how to make it automatically reset all pkp n the database at a certain time
of day, example 0:00 every day it would reset the pkp
its this:
Quote:
if (Splitter[0] == "/clearallpkp")
{
foreach (DictionaryEntry DE in World.AllChars)
{
Character Char = (Character)DE.Value;
{
Char.PKPoints = 0;
Char.BlueName = false;
SendPacket(General.MyPackets.Vital(Char.UID, 6, Char.PKPoints));
World.UpdateSpawn(Char);
SendPacket(General.MyPackets.CharacterInfo(Char));
Char.SendEquips(false);
SendPacket(General.MyPackets.Vital(Char.UID, 26, Char.GetStat()));
World.SpawnMeToOthers(Char, true);
}
}
}
09/14/2008 11:36 DragonStar#11
@adz06676 - tyvm, n i kinda feel dum now lol

next gta try to get it to clear pkp from even the ppl who are offline
09/14/2008 11:47 adz06676#12
Quote:
Originally Posted by DragonStar View Post
@adz06676 - tyvm, n i kinda feel dum now lol

next gta try to get it to clear pkp from even the ppl who are offline
lol no problem
09/20/2008 01:48 © Haydz#13
For all the characters in the database:

i assume your running lotf based database and source so it will be somewhat along the lines of
Code:
MySqlCommand MySqlCmd = new MySqlCommand("UPDATE `characters` SET `PKPoints` = 0", Connection);
MySqlCmd.ExecuteNonQuery();
I am far from a genius with mysql so no doubt that will need correcting
09/20/2008 02:28 Rechocto#14
Quote:
Originally Posted by © Haydz View Post
For all the characters in the database:

i assume your running lotf based database and source so it will be somewhat along the lines of
Code:
MySqlCommand MySqlCmd = new MySqlCommand("UPDATE `characters` SET `PKPoints` = 0", Connection);
MySqlCmd.ExecuteNonQuery();
I am far from a genius with mysql so no doubt that will need correcting


LMAO, why did it take that long for someone to post this? XD.. it's so dang obvious XDDD -- as soon as I read the first post I had that ready in my mind but had to read other posts so as to make sure not to repost... everyone that gave anything other than this -- it is now plainly obvious that you do nothing but copypaste and minor edits
09/20/2008 05:44 InfamousNoone#15
Quote:
Originally Posted by Rechocto View Post
LMAO, why did it take that long for someone to post this? XD.. it's so dang obvious XDDD -- as soon as I read the first post I had that ready in my mind but had to read other posts so as to make sure not to repost... everyone that gave anything other than this -- it is now plainly obvious that you do nothing but copypaste and minor edits
Because nobody honestly gives a shit.