Quote:
Originally Posted by shadowman123
well i can do Dictionery of the Class or Struct that contains the variables but whats the use of Dictionery ? i never Used it b4 and i Fail at using it seriously which make me kinda disappointed
|
Example, we don't need a dictionary for now.
Code:
public static List<PkExploit> pkeDatabase = new List<PkExploit>();
Put that somewhere in your main file, probably Program.cs.
Code:
public class PkExploit
{
public int KillerUID = 0; // The killer's UniqueID / Identity
public int KilledUID = 0; // The victim's UniqueID / Identity
public ulong TimeStamp = 0; // Timestamp of when they were killed
public ushort KillCount = 0; // How many times Killer has PKed Killed
}
That's a sample class for a PkExploit.
Code:
PkExploit PKE = new PkExploit();
PKE.KilledUID = Target.Char.UniqueID;
PKE.KillerUID = Client.Char.UniqueID;
PKE.TimeStamp = Program.Microtime(); // I'll give you this function if you don't already have one of your own.
PKE.KillCount = 1; // Or, check if they're already in the table, and just increment it.
Program.pkeDatabase.Add(PKE);
There's a sample of creating one.
Microtime function:
Note, first you need the Unix Epoch date.
Code:
public static readonly DateTime Epoch = new DateTime(1970, 1, 1);
Code:
public static long Microtime()
{
return Convert.ToInt64((DateTime.UtcNow - Epoch).TotalMilliseconds);
}
If you need these for later:
Code:
public static long MilliSecondsSince(long UTS)
{
return (Microtime() - UTS);
}
public static long SecondsSince(long UTS)
{
return ((Microtime() - UTS) / 1000);
}
Anyway, surely you can understand the rest.