SHARE
TWEET

Untitled

a guest May 21st, 2019 93 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void CreateTables()
  2. {
  3.     char szDriver[16];
  4.     DBDriver dbdriver = g_hDatabase.Driver;
  5.     dbdriver.GetIdentifier(szDriver, sizeof szDriver);
  6.  
  7.     SQL_LockDatabase(g_hDatabase);
  8.  
  9.     if(StrEqual(szDriver, "sqlite", false))
  10.     {
  11.         g_hDatabase.Query(SQL_Callback_ErrorCheck, "CREATE TABLE IF NOT EXISTS `mining_farm_main` (`auth` int(11) NOT NULL, `name` varchar(32) NOT NULL, `date` int(11) NOT NULL, `balance` int(11) NOT NULL default '0', `all_time_balance` int(11) NOT NULL default '0', `e_count` int(11) NOT NULL default '0', `e_amount` int(11) NOT NULL default '0', `farm_0` int(11) NOT NULL default '0', `farm_1` int(11) NOT NULL default '0', `farm_2` int(11) NOT NULL default '0', `farm_3` int(11) NOT NULL default '0', `farm_4` int(11) NOT NULL default '0', `farm_5` int(11) NOT NULL default '0');");
  12.         g_hDatabase.Query(SQL_Callback_ErrorCheck, "CREATE TABLE IF NOT EXISTS `mining_farm_exchange` (`auth` int(11) NOT NULL, `steamid64` varchar(32) NOT NULL, `count` int(11) NOT NULL, `price` int(11) NOT NULL, `date` int(11) NOT NULL);");
  13.         g_hDatabase.Query(SQL_Callback_ErrorCheck, "CREATE TABLE IF NOT EXISTS `mining_farm_exchange_stat` (`date` int(11) NOT NULL, `next_date` int(11) NOT NULL, `price` int(11) NOT NULL);");
  14.     }
  15.     else
  16.     {
  17.         g_hDatabase.Query(SQL_Callback_ErrorCheck, "CREATE TABLE IF NOT EXISTS `mining_farm_main` (`auth` INT NOT NULL, `name` VARCHAR(64) NOT NULL default 'unknown', `date` INT NOT NULL, `balance` INT NOT NULL default '0', `all_time_balance` INT NOT NULL default '0', `e_count` INT NOT NULL default '0', `e_amount` INT NOT NULL default '0', `farm_0` INT NOT NULL default '0', `farm_1` INT NOT NULL default '0', `farm_2` INT NOT NULL default '0', `farm_3` INT NOT NULL default '0', `farm_4` INT NOT NULL default '0', `farm_5` INT NOT NULL default '0') DEFAULT CHARSET=utf8;");
  18.         g_hDatabase.Query(SQL_Callback_ErrorCheck, "CREATE TABLE IF NOT EXISTS `mining_farm_exchange` (`auth` INT NOT NULL, `steamid64` VARCHAR(64) NOT NULL, `count` INT NOT NULL, `price` INT NOT NULL, `date` INT NOT NULL) DEFAULT CHARSET=utf8;");
  19.         g_hDatabase.Query(SQL_Callback_ErrorCheck, "CREATE TABLE IF NOT EXISTS `mining_farm_exchange_stat` (`date` INT NOT NULL, `next_date` INT NOT NULL, `price` INT NOT NULL) DEFAULT CHARSET=utf8;");
  20.     }
  21.  
  22.     g_hDatabase.SetCharset("utf8");
  23.  
  24.     SQL_UnlockDatabase(g_hDatabase);
  25.  
  26.     #if DEBUG 1
  27.     LogToFile(g_szLogFile, "Краш?");
  28.     #endif
  29.  
  30.     for(int i = 1; i <= MaxClients; i++)
  31.     {
  32.         if(IsClientInGame(i) && !IsFakeClient(i) && g_hDatabase != null)
  33.         {
  34.             LoadClient(i);
  35.         }
  36.     }
  37. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top