How would you go about making a reset command like
/resetallpkp <<< would reset all characters in the database pkps to 0
using lotf source
/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...Quote:
How would you go about making a reset command like
/resetallpkp <<< would reset all characters in the database pkps to 0
using lotf source
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()));
}
nice but i think he means that he want a command that reset all pkps from all characters in lotfQuote:
My LOTF had /clearpkp in it.. but if you need it here it is...
Yeah, i use @commands though >.>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())); }
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 onlineQuote:
My LOTF had /clearpkp in it.. but if you need it here it is...
Yeah, i use @commands though >.>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())); }
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=<
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 allQuote:
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); } }
its this:Quote:
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
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);
}
}
}
MySqlCommand MySqlCmd = new MySqlCommand("UPDATE `characters` SET `PKPoints` = 0", Connection);
MySqlCmd.ExecuteNonQuery();
Quote:
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
I am far from a genius with mysql so no doubt that will need correctingCode:MySqlCommand MySqlCmd = new MySqlCommand("UPDATE `characters` SET `PKPoints` = 0", Connection); MySqlCmd.ExecuteNonQuery();
Because nobody honestly gives a shit.Quote:
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