Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ------------------------------------------------------------------------------------------------
- local t_Weapons = {}
- t_Weapons[WEP_FIST] <- {Id = "FIST", Name = "Unarmed", Reward = 100, Points = 10};
- t_Weapons[WEP_BRASSKNUCKLES] <- {Id = "BRASSKNUCKLES", Name = "Brass Knuckles", Reward = 100, Points = 10};
- t_Weapons[WEP_SCREWDRIVER] <- {Id = "SCREWDRIVER", Name = "Screwdriver", Reward = 100, Points = 10};
- t_Weapons[WEP_GOLFCLUB] <- {Id = "GOLFCLUB", Name = "Golf Club", Reward = 100, Points = 10};
- t_Weapons[WEP_NIGHTSTICK] <- {Id = "NIGHTSTICK", Name = "Night Stick", Reward = 100, Points = 10};
- t_Weapons[WEP_KNIFE] <- {Id = "KNIFE", Name = "Knife", Reward = 100, Points = 10};
- t_Weapons[WEP_BASEBALLBAT] <- {Id = "BASEBALLBAT", Name = "Baseball Bat", Reward = 100, Points = 10};
- t_Weapons[WEP_HAMMER] <- {Id = "HAMMER", Name = "Hammer", Reward = 100, Points = 10};
- t_Weapons[WEP_MEATCLEAVER] <- {Id = "MEATCLEAVER", Name = "Meat Cleaver", Reward = 100, Points = 10};
- t_Weapons[WEP_MACHETE] <- {Id = "MACHETE", Name = "Machete", Reward = 100, Points = 10};
- t_Weapons[WEP_KATANA] <- {Id = "KATANA", Name = "Katana", Reward = 100, Points = 10};
- t_Weapons[WEP_CHAINSAW] <- {Id = "CHAINSAW", Name = "Chainsaw", Reward = 100, Points = 10};
- t_Weapons[WEP_GRENADE] <- {Id = "GRENADE", Name = "Grenade", Reward = 100, Points = 10};
- t_Weapons[WEP_REMOTE] <- {Id = "REMOTE", Name = "Remote Detonation Grenades", Reward = 100, Points = 10};
- t_Weapons[WEP_TEARGAS] <- {Id = "TEARGAS", Name = "Tear Gas", Reward = 100, Points = 10};
- t_Weapons[WEP_MOLOTOV] <- {Id = "MOLOTOV", Name = "Molotov Cocktails", Reward = 100, Points = 10};
- t_Weapons[WEP_ROCKET] <- {Id = "ROCKET", Name = "Rocket Launcher", Reward = 100, Points = 10};
- t_Weapons[WEP_COLT45] <- {Id = "COLT45", Name = "Colt45", Reward = 100, Points = 10};
- t_Weapons[WEP_PYTHON] <- {Id = "PYTHON", Name = "Python", Reward = 100, Points = 10};
- t_Weapons[WEP_SHOTGUN] <- {Id = "SHOTGUN", Name = "Shotgun", Reward = 100, Points = 10};
- t_Weapons[WEP_SPAS12] <- {Id = "SPAS12", Name = "Spas12 Shotgun", Reward = 100, Points = 10};
- t_Weapons[WEP_STUBBY] <- {Id = "STUBBY", Name = "Stubby Shotgun", Reward = 100, Points = 10};
- t_Weapons[WEP_TEC9] <- {Id = "TEC9", Name = "Tec9", Reward = 100, Points = 10};
- t_Weapons[WEP_UZI] <- {Id = "UZI", Name = "Uzi", Reward = 100, Points = 10};
- t_Weapons[WEP_INGRAM] <- {Id = "INGRAM", Name = "Silenced Ingram", Reward = 100, Points = 10};
- t_Weapons[WEP_MP5] <- {Id = "MP5", Name = "Mp5", Reward = 100, Points = 10};
- t_Weapons[WEP_M4] <- {Id = "M4", Name = "m4", Reward = 100, Points = 10};
- t_Weapons[WEP_RUGER] <- {Id = "RUGER", Name = "Ruger", Reward = 100, Points = 10};
- t_Weapons[WEP_SNIPER] <- {Id = "SNIPER", Name = "Sniper Rifle", Reward = 100, Points = 10};
- t_Weapons[WEP_LASERSCOPE] <- {Id = "LASERSCOPE", Name = "PSG-1/.308 Sniper", Reward = 100, Points = 10};
- t_Weapons[WEP_ROCKETLAUNCHER] <- {Id = "ROCKETLAUNCHER", Name = "Rocket Launcher", Reward = 100, Points = 10};
- t_Weapons[WEP_FLAMETHROWER] <- {Id = "FLAMETHROWER", Name = "Flame Thrower", Reward = 100, Points = 10};
- t_Weapons[WEP_M60] <- {Id = "M60", Name = "M-60", Reward = 100, Points = 10};
- t_Weapons[WEP_MINIGUN] <- {Id = "MINIGUN", Name = "Minigun", Reward = 100, Points = 10};
- t_Weapons[WEP_BOMB] <- {Id = "BOMB", Name = "Detonator", Reward = 100, Points = 10};
- t_Weapons[WEP_HELICANNON] <- {Id = "HELICANNON", Name = "HeliCannon", Reward = 100, Points = 10};
- t_Weapons[WEP_CAMERA] <- {Id = "CAMERA", Name = "Camera", Reward = 100, Points = 10};
- t_Weapons[WEP_VEHICLE] <- {Id = "VEHICLE", Name = "Vehicle", Reward = 100, Points = 10};
- t_Weapons[WEP_DRIVEBY] <- {Id = "DRIVEBY", Name = "DryveBy", Reward = 100, Points = 10};
- t_Weapons[WEP_DROWNED] <- {Id = "DROWNED", Name = "Drown", Reward = 100, Points = 10};
- t_Weapons[WEP_FALL] <- {Id = "FALL", Name = "Fall", Reward = 100, Points = 10};
- t_Weapons[WEP_EXPLOSION] <- {Id = "EXPLOSION", Name = "Explosion", Reward = 100, Points = 10};
- t_Weapons[WEP_SUICIDE] <- {Id = "SUICIDE", Name = "Suicide", Reward = 100, Points = 10};
- // ------------------------------------------------------------------------------------------------
- local t_BodyPart = {};
- t_BodyPart[BODYPART_BODY] <- {Reward = 2.6, Id = "BODY", Name = "Body", LcName = "body"};
- t_BodyPart[BODYPART_TORSO] <- {Reward = 2.2, Id = "TORSO", Name = "Torso", LcName = "torso"};
- t_BodyPart[BODYPART_LEFTARM] <- {Reward = 2.4, Id = "LEFTARM", Name = "Left Arm", LcName = "left arm"};
- t_BodyPart[BODYPART_RIGHTARM] <- {Reward = 2.4, Id = "RIGHTARM", Name = "Right Arm", LcName = "right arm"};
- t_BodyPart[BODYPART_LEFTLEG] <- {Reward = 2.4, Id = "LEFTLEG", Name = "Left Leg", LcName = "left leg"};
- t_BodyPart[BODYPART_RIGHTLEG] <- {Reward = 2.4, Id = "RIGHTLEG", Name = "Right Leg", LcName = "right leg"};
- t_BodyPart[BODYPART_HEAD] <- {Reward = 1.4, Id = "HEAD", Name = "Head", LcName = "head"};
- // ------------------------------------------------------------------------------------------------
- const DB_LW_QUEUE = 0;
- const DB_MD_QUEUE = 1;
- const DB_HI_QUEUE = 2;
- // ------------------------------------------------------------------------------------------------
- class _Result
- {
- // --------------------------------------------------------------------------------------------
- _Res = null;
- // --------------------------------------------------------------------------------------------
- function constructor(res) {
- // Be sure that the passed argument is a valid query result
- if (typeof _Res != "userdata") return print("Cannot construct query result from an invalid result.");
- // Save the passed query result
- else _Res = res;
- }
- // --------------------------------------------------------------------------------------------
- function destructor() {
- // Free the query result if it's a vlid one
- if (typeof _Res == "userdata") ::FreeSQLQuery(_Res)
- }
- // @TODO Implement...
- }
- // ------------------------------------------------------------------------------------------------
- _DB <- {
- // --------------------------------------------------------------------------------------------
- _File = "stats.db"
- // --------------------------------------------------------------------------------------------
- _Handle = null
- // --------------------------------------------------------------------------------------------
- _Queue = {}
- // --------------------------------------------------------------------------------------------
- function Queue(level, ...) {
- // Make sure that the specified level exists and is valid
- if (!_Queue.rawin(level) || typeof _Queue[level] != "array") return print("Cannot find a valid queue for the specified level.");
- // Make sure that the correct arguments were passed to the function
- else if (vargv.len() < 1 || typeof vargv[0] != "string") return print("Invalid arguments passed to the queue function.");
- // Push the (this) environment into the query arguments
- else vargv.insert(0, this);
- // Format the query
- local query = ::format.acall(vargv);
- // Be sure that the query was formatted successfully
- if (typeof query != "string" || query.len() < 1) return print("Cannot queue invalid or empty query string.");
- // Add the query to the specified queue
- else _Queue[level].pushback(query);
- }
- // --------------------------------------------------------------------------------------------
- function Exec(...) {
- // Make sure that the correct arguments were passed to the function
- if (vargv.len() < 1 || typeof vargv[0] != "string") return print("Invalid arguments passed to the exec function.");
- // Push the (this) environment into the query arguments
- else vargv.insert(0, this);
- // Create an empty result and format the query
- local result = null, query = ::format.acall(vargv);
- // Be sure that the query was formatted successfully
- if (typeof query != "string" || query.len() < 1) return print("Cannot exec invalid or empty query string.");
- // Try to execute the specified query
- // Generates invalid query
- //else result = ::QuerySQL(_Handle, ::escapeSQLString(query)); // Generates invalid query by adding unnecessary symbols
- /*
- local fp = file("query.txt", "a");
- local str = ::escapeSQLString(query);
- foreach (c in str) fp.writen(c, 'b');
- fp.writen('\n', 'b');
- */
- // Generates valid query
- else result = ::QuerySQL(_Handle, query); // Executes the original query
- /*
- local fp = file("query.txt", "a");
- foreach (c in query) fp.writen(c, 'b');
- fp.writen('\n', 'b');
- */
- // Did the query returned a valid result?
- if (typeof result == "userdata") return _Result(result);
- }
- // --------------------------------------------------------------------------------------------
- function Flush(level) {
- // @TODO Implement...
- }
- // --------------------------------------------------------------------------------------------
- function Open()
- {
- // Make sure the previous handle was closed or that there wasn't one to begin with
- if (typeof _Handle == "userdata") return print("Another database handle was found. Operation will be aborted.");
- // Make sure that a database file was specified and that it's a valid path
- else if (typeof _File != "string") return print("Unknown or missing database location. Operation will be aborted.");
- // Try to open the file as an SQLite3 database now
- _Handle = ::ConnectSQL(_File);
- // Check if the previous operation succeeded and notify someone in case of failure
- if (_Handle == null) return print("Unable to open the SQLite database from: " + _File);
- // The database was opened successfully and the operation is complete
- else return print("Successfully aquired a database handle to: " + _File);
- }
- // --------------------------------------------------------------------------------------------
- function Close()
- {
- // Make sure that we have a valid database handle to begin with
- if (typeof _Handle != "userdata") return print("No handle to close for database: " + _File);
- // Close the database handle and notify someone in case of failure
- else if (!::DisconnectSQL(_File)) return print("Unable to close handle for database: " + _File);
- // The database was closed successfully and the operation is complete
- else return print("Successfully closed handle for database: " + _File);
- }
- // ------------------------------------------------------------------------------------------------
- function Initialize()
- {
- // Make sure that the database has the Account table
- Exec(@"CREATE TABLE IF NOT EXISTS [Account] (
- [Username] VARCHAR(32) UNIQUE NOT NULL,
- [Password] VARCHAR(32) NOT NULL,
- [Email] VARCHAR(64) NOT NULL,
- [Nickname] VARCHAR(128) NOT NULL,
- [Faction] NUMERIC DEFAULT '0' NULL,
- [Wealth] NUMERIC DEFAULT '0' NULL,
- [Points] NUMERIC DEFAULT '0' NULL,
- [Karma] FLOAT DEFAULT '0.0' NULL,
- [Level] NUMERIC DEFAULT '0' NULL
- )");
- // Make sure that the database has the Bans table @TODO Embed in user profile...
- Exec(@"CREATE TABLE IF NOT EXISTS [Bans] (
- [User] NUMERIC DEFAULT '0' NOT NULL,
- [Timestamp] TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
- [Duration] TIMESTAMP NOT NULL,
- [Reason] VARCHAR(64) NULL,
- [Admin] NUMERIC DEFAULT '0' NOT NULL,
- [Expired] BOOLEAN DEFAULT 'FALSE' NOT NULL
- )");
- // Make sure that the database has the Profile table
- Exec(@"CREATE TABLE IF NOT EXISTS [Profile] (
- [Firstname] VARCHAR(64) NULL,
- [Lastname] VARCHAR(64) NULL,
- [City] VARCHAR(64) NULL,
- [State] VARCHAR(64) NULL,
- [Country] VARCHAR(64) NULL,
- [CanKick] BOOLEAN DEFAULT 'TRUE' NOT NULL,
- [CanBan] BOOLEAN DEFAULT 'TRUE' NOT NULL,
- [CanJoin] BOOLEAN DEFAULT 'TRUE' NOT NULL,
- [CanSpeak] BOOLEAN DEFAULT 'TRUE' NOT NULL,
- [CanDrive] BOOLEAN DEFAULT 'TRUE' NOT NULL,
- [CanGetOnBoard] BOOLEAN DEFAULT 'TRUE' NOT NULL,
- [CanTakeDamage] BOOLEAN DEFAULT 'TRUE' NOT NULL,
- [CanChangeName] BOOLEAN DEFAULT 'TRUE' NOT NULL,
- [CanSpawn] BOOLEAN DEFAULT 'TRUE' NOT NULL,
- [CanSpectate] BOOLEAN DEFAULT 'TRUE' NOT NULL,
- [CanReceivePM] BOOLEAN DEFAULT 'TRUE' NOT NULL,
- [CanSendPM] BOOLEAN DEFAULT 'TRUE' NOT NULL,
- [CanTeamKill] BOOLEAN DEFAULT 'TRUE' NOT NULL,
- [Visited] TIMESTAMP DEFAULT '0' NULL,
- [LastIP] VARCHAR(16) NULL,
- [Activity] NUMERIC DEFAULT '0' NULL,
- [LastSpree] NUMERIC DEFAULT '0' NULL,
- [BestSpree] NUMERIC DEFAULT '0' NULL,
- [Spawns] NUMERIC DEFAULT '0' NULL,
- [Joins] NUMERIC DEFAULT '0' NULL,
- [Wrecks] NUMERIC DEFAULT '0' NULL,
- [Chats] NUMERIC DEFAULT '0' NULL,
- [Actions] NUMERIC DEFAULT '0' NULL,
- [TeamKills] NUMERIC DEFAULT '0' NULL
- )");
- // Make sure that the database has the Body table
- Exec(@"CREATE TABLE IF NOT EXISTS [Body] (
- [K%s] NUMERIC DEFAULT '0' NOT NULL, [K%s] NUMERIC DEFAULT '0' NOT NULL, [K%s] NUMERIC DEFAULT '0' NOT NULL,
- [K%s] NUMERIC DEFAULT '0' NOT NULL, [K%s] NUMERIC DEFAULT '0' NOT NULL, [K%s] NUMERIC DEFAULT '0' NOT NULL,
- [K%s] NUMERIC DEFAULT '0' NOT NULL,
- [D%s] NUMERIC DEFAULT '0' NOT NULL, [D%s] NUMERIC DEFAULT '0' NOT NULL, [D%s] NUMERIC DEFAULT '0' NOT NULL,
- [D%s] NUMERIC DEFAULT '0' NOT NULL, [D%s] NUMERIC DEFAULT '0' NOT NULL, [D%s] NUMERIC DEFAULT '0' NOT NULL,
- [D%s] NUMERIC DEFAULT '0' NOT NULL
- )"
- , t_BodyPart[BODYPART_BODY].Id, t_BodyPart[BODYPART_TORSO].Id, t_BodyPart[BODYPART_LEFTARM].Id
- , t_BodyPart[BODYPART_RIGHTARM].Id, t_BodyPart[BODYPART_LEFTLEG].Id, t_BodyPart[BODYPART_RIGHTLEG].Id
- , t_BodyPart[BODYPART_HEAD].Id
- , t_BodyPart[BODYPART_BODY].Id, t_BodyPart[BODYPART_TORSO].Id, t_BodyPart[BODYPART_LEFTARM].Id
- , t_BodyPart[BODYPART_RIGHTARM].Id, t_BodyPart[BODYPART_LEFTLEG].Id, t_BodyPart[BODYPART_RIGHTLEG].Id
- , t_BodyPart[BODYPART_HEAD].Id
- );
- // Make sure that the database has the Deaths table
- Exec(@"CREATE TABLE IF NOT EXISTS [Deaths] (
- [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL,
- [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL,
- [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL,
- [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL,
- [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL,
- [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL,
- [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL,
- [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL,
- [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL,
- [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL,
- [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL,
- [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL,
- [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL,
- [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL,
- [%s] NUMERIC DEFAULT '0' NOT NULL
- )"
- , t_Weapons[WEP_FIST].Id, t_Weapons[WEP_BRASSKNUCKLES].Id, t_Weapons[WEP_SCREWDRIVER].Id
- , t_Weapons[WEP_GOLFCLUB].Id, t_Weapons[WEP_NIGHTSTICK].Id, t_Weapons[WEP_KNIFE].Id
- , t_Weapons[WEP_BASEBALLBAT].Id, t_Weapons[WEP_HAMMER].Id, t_Weapons[WEP_MEATCLEAVER].Id
- , t_Weapons[WEP_MACHETE].Id, t_Weapons[WEP_KATANA].Id, t_Weapons[WEP_CHAINSAW].Id
- , t_Weapons[WEP_GRENADE].Id, t_Weapons[WEP_REMOTE].Id, t_Weapons[WEP_TEARGAS].Id
- , t_Weapons[WEP_MOLOTOV].Id, t_Weapons[WEP_ROCKET].Id, t_Weapons[WEP_COLT45].Id
- , t_Weapons[WEP_PYTHON].Id, t_Weapons[WEP_SHOTGUN].Id, t_Weapons[WEP_SPAS12].Id
- , t_Weapons[WEP_STUBBY].Id, t_Weapons[WEP_TEC9].Id, t_Weapons[WEP_UZI].Id
- , t_Weapons[WEP_INGRAM].Id, t_Weapons[WEP_MP5].Id, t_Weapons[WEP_M4].Id
- , t_Weapons[WEP_RUGER].Id, t_Weapons[WEP_SNIPER].Id, t_Weapons[WEP_LASERSCOPE].Id
- , t_Weapons[WEP_ROCKETLAUNCHER].Id, t_Weapons[WEP_FLAMETHROWER].Id, t_Weapons[WEP_M60].Id
- , t_Weapons[WEP_MINIGUN].Id, t_Weapons[WEP_BOMB].Id, t_Weapons[WEP_HELICANNON].Id
- , t_Weapons[WEP_CAMERA].Id, t_Weapons[WEP_VEHICLE].Id, t_Weapons[WEP_DRIVEBY].Id
- , t_Weapons[WEP_DROWNED].Id, t_Weapons[WEP_FALL].Id, t_Weapons[WEP_EXPLOSION].Id
- , t_Weapons[WEP_SUICIDE].Id
- );
- // Make sure that the database has the Kills table
- Exec(@"CREATE TABLE IF NOT EXISTS [Kills] (
- [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL,
- [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL,
- [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL,
- [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL,
- [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL,
- [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL,
- [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL,
- [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL,
- [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL,
- [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL,
- [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL,
- [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL,
- [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL,
- [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL, [%s] NUMERIC DEFAULT '0' NOT NULL,
- [%s] NUMERIC DEFAULT '0' NOT NULL
- )"
- , t_Weapons[WEP_FIST].Id, t_Weapons[WEP_BRASSKNUCKLES].Id, t_Weapons[WEP_SCREWDRIVER].Id
- , t_Weapons[WEP_GOLFCLUB].Id, t_Weapons[WEP_NIGHTSTICK].Id, t_Weapons[WEP_KNIFE].Id
- , t_Weapons[WEP_BASEBALLBAT].Id, t_Weapons[WEP_HAMMER].Id, t_Weapons[WEP_MEATCLEAVER].Id
- , t_Weapons[WEP_MACHETE].Id, t_Weapons[WEP_KATANA].Id, t_Weapons[WEP_CHAINSAW].Id
- , t_Weapons[WEP_GRENADE].Id, t_Weapons[WEP_REMOTE].Id, t_Weapons[WEP_TEARGAS].Id
- , t_Weapons[WEP_MOLOTOV].Id, t_Weapons[WEP_ROCKET].Id, t_Weapons[WEP_COLT45].Id
- , t_Weapons[WEP_PYTHON].Id, t_Weapons[WEP_SHOTGUN].Id, t_Weapons[WEP_SPAS12].Id
- , t_Weapons[WEP_STUBBY].Id, t_Weapons[WEP_TEC9].Id, t_Weapons[WEP_UZI].Id
- , t_Weapons[WEP_INGRAM].Id, t_Weapons[WEP_MP5].Id, t_Weapons[WEP_M4].Id
- , t_Weapons[WEP_RUGER].Id, t_Weapons[WEP_SNIPER].Id, t_Weapons[WEP_LASERSCOPE].Id
- , t_Weapons[WEP_ROCKETLAUNCHER].Id, t_Weapons[WEP_FLAMETHROWER].Id, t_Weapons[WEP_M60].Id
- , t_Weapons[WEP_MINIGUN].Id, t_Weapons[WEP_BOMB].Id, t_Weapons[WEP_HELICANNON].Id
- , t_Weapons[WEP_CAMERA].Id, t_Weapons[WEP_VEHICLE].Id, t_Weapons[WEP_DRIVEBY].Id
- , t_Weapons[WEP_DROWNED].Id, t_Weapons[WEP_FALL].Id, t_Weapons[WEP_EXPLOSION].Id
- , t_Weapons[WEP_SUICIDE].Id
- );
- // Make sure that the database has the Faction table
- Exec(@"CREATE TABLE IF NOT EXISTS [Faction] (
- [Name] VARCHAR(32) NOT NULL,
- [Tag] VARCHAR(8) NOT NULL,
- [Wealth] NUMERIC DEFAULT '0' NOT NULL,
- [Points] NUMERIC DEFAULT '0' NOT NULL
- )");
- // Notify someone about the success
- print("Database was successfully initialized.");
- }
- }
- // ------------------------------------------------------------------------------------------------
- _DB._Queue[DB_LW_QUEUE] <- [];
- _DB._Queue[DB_MD_QUEUE] <- [];
- _DB._Queue[DB_HI_QUEUE] <- [];
- // ------------------------------------------------------------------------------------------------
- function onServerStart()
- {
- _DB.Open();
- _DB.Initialize();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement