Why this is crash my server? What is wrong?
function onScriptLoad()
{
LoadHashes();
}
function onScriptUnload()
{
SaveHashes();
CloseHashes();
}
function CreateHashes()
{
Kills<- HashTable( "Kills" );
Deaths<- HashTable( "Deaths" );
}
function SaveHashes()
{
Kills.Save( "Hashes/Kills.hsh" );
Deaths.Save( "Hashes/Deaths.hsh" );
}
function LoadHashes()
{
CreateHashes();
Kills.Load( "Hashes/Kills.hsh" );
Deaths.Load( "Hashes/Deaths.hsh" );
}
function CloseHashes()
{
Kills.Close();
Deaths.Close();
Kills<- null;
Deaths<- null;
}
function onPlayerConnect( pPlayer )
{
pPlayer.Score = Kills.Get( pPlayer );
}
function onPlayerKill( pKiller, pKilled, iWeapon, iBodyPart )
{
/* Get the weapon name and the body part name, putting in an offset for its Unknown */
local szWeapon = GetWeaponName( iWeapon ), szBodyPart = GetBodyPartName( iBodyPart );
if ( szBodyPart == "Unknown" ) szBodyPart = "Body";
Message( "[#0080ff]" + pKiller + " killed " + pKilled + " (" + szWeapon + ") (" + szBodyPart + ")", Colour( 255, 0, 0 ) );
pKiller.Score += 1;
Kills.Inc( pKiller, 1 );
Deaths.Inc( pKilled, 1 );
}