Advertisement
Guest User

Untitled

a guest
Jan 10th, 2016
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 105.18 KB | None | 0 0
  1. <?php
  2. session_start();
  3. ob_start();
  4. $_SESSION['loads']++;
  5. if (!$_SESSION['playerid'] || $_SESSION['playerid'] <= '0') {
  6.     header('location:login.php');
  7. }
  8. if ($_SESSION['playerid'] != 1) {
  9.     ini_set('display_errors', 0);
  10. }
  11. $q_ry = "SELECT *
  12.             FROM members  
  13.             WHERE playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $_SESSION['playerid']) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  14. $ci   = mysqli_fetch_array(mysqli_query($GLOBALS["___mysqli_ston"], $q_ry));
  15. if ($ci['my_traveltime'] > time() && $_SERVER['SCRIPT_NAME'] != "/travelling.php" && $_SERVER['SCRIPT_NAME'] != "/netbook.php" || $ci['my_city'] > '0' && $_SERVER['SCRIPT_NAME'] != "/travelling.php" && $_SERVER['SCRIPT_NAME'] != "/netbook.php") {
  16.     header('location:travelling.php');
  17. }
  18. if ($ci['force_off'] > '0') {
  19.     session_unset();
  20.     session_destroy();
  21.     header("location:login.php");
  22. }
  23. if ($_SERVER['SCRIPT_NAME'] != "/city.php") {
  24.     $_SESSION['refreshes'] = 0;
  25. }
  26. $q_ry   = "SELECT fj_time
  27.             FROM fed_jailed
  28.             WHERE fj_playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $_SESSION['playerid']) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  29. $injail = mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  30. if (mysqli_num_rows($injail) && $_SERVER['SCRIPT_NAME'] != "/fedjail.php") {
  31.     $fj = mysqli_fetch_array($injail);
  32.     if (($fj['fj_time']) >= '0') {
  33.         header('location:fedjail.php');
  34.         exit();
  35.         die();
  36.     }
  37. }
  38.  
  39.  
  40. $auctions = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT a.*,i.item_name FROM auctions a LEFT JOIN items i ON a.item = i.item_id WHERE a.time < " . time());
  41. If (mysqli_num_rows($auctions)) {
  42.     While ($a = mysqli_fetch_assoc($auctions)) {
  43.          
  44.         If ($a['bids'] > 0 && $a['bidder']) {
  45.              
  46.             $playername = mysqli_fetch_assoc(mysqli_query($GLOBALS["___mysqli_ston"], "SELECT playername FROM members WHERE playerid = " . $a['bidder']));
  47.             $playername = $playername['playername'];
  48.              
  49.             event_add($a['owner'], 'Your ' . $a['item_name'] . ' sold for $' . number_format($a['bid']) . ' with a total of ' . number_format($a['bids']) . ' bids. the winner was <a href="profile.php?XID=' . $a['bidder'] . '">' . $playername . '</a>.');
  50.             event_add($a['bidder'], 'Congratulations, you won the bid on the ' . $a['item_name'] . ' for a total of $' . number_format($a['bid']) . '!');
  51.              
  52.             mysqli_query($GLOBALS["___mysqli_ston"], "UPDATE members SET wallet = wallet + " . $a['bid'] . " WHERE playerid = " . $a['owner']);
  53.              
  54.             $itm_check = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT * FROM members_items WHERE it_playerid = " . $a['bidder'] . " AND it_itemid = " . $a['item'] . " AND it_qty >= 1");
  55.             If (mysqli_num_rows($itm_check) > 0) {
  56.                 mysqli_query($GLOBALS["___mysqli_ston"], "UPDATE members_items SET it_qty = it_qty + 1 WHERE it_playerid = " . $a['bidder'] . " AND it_itemid = " . $a['item'] . " AND it_qty >= 1");
  57.             } else if(!mysqli_num_rows($itm_check)) {
  58.                 mysqli_query($GLOBALS["___mysqli_ston"], "INSERT INTO members_items (it_ID, it_playerid, it_itemid, it_qty) VALUES ('', " . $a['bidder'] . ", " . $a['item'] . ", 1) ");
  59.             }
  60.             mysqli_query($GLOBALS["___mysqli_ston"], "DELETE FROM auctions WHERE id = " . $a['id']);
  61.              
  62.         } else {
  63.              
  64.             event_add($a['owner'], 'Your ' . $a['item_name'] . ' received 0 bids and has been returned to your inventory.');
  65.              
  66.             $itm_check = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT * FROM members_items WHERE it_playerid = " . $a['owner'] . " AND it_itemid = " . $a['item'] . " AND it_qty >= 1");
  67.             If (mysqli_num_rows($itm_check) > 0) {
  68.                 mysqli_query($GLOBALS["___mysqli_ston"], "UPDATE members_items SET it_qty = it_qty + 1 WHERE it_playerid = " . $a['owner'] . " AND it_itemid = " . $a['item'] . " AND it_qty >= 1");
  69.             } else if (!mysqli_num_rows($itm_check)) {
  70.                 mysqli_query($GLOBALS["___mysqli_ston"], "INSERT INTO members_items (it_ID, it_playerid, it_itemid, it_qty) VALUES ('', " . $a['owner'] . ", " . $a['item'] . ", 1) ");
  71.             }
  72.             mysqli_query($GLOBALS["___mysqli_ston"], "DELETE FROM auctions WHERE id = " . $a['id']);
  73.              
  74.         }
  75.     }
  76. }
  77.  
  78. mysqli_query($GLOBALS["___mysqli_ston"], "UPDATE members SET my_life = my_maxlife, my_hosp = 60 WHERE playerid = 0 AND my_hosp > 60");
  79. mission_one_check();
  80. mission_two_check();
  81.  
  82. function mission_one_check()
  83. {
  84.      
  85.     $active = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT * FROM active_missions WHERE am_playerid = " . $_SESSION['playerid'] . " AND am_mission = 1");
  86.     if (mysqli_num_rows($active)) {
  87.         $active = mysqli_fetch_assoc($active);
  88.          
  89.         $missone = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT * FROM game_missions WHERE m_id = 1");
  90.         $missone = mysqli_fetch_array($missone);
  91.         $time    = $active['am_time'] - ($missone['m_timelimit'] * 60);
  92.         if ($active['am_objective_1_done'] == 'no') {
  93.             //objective 1
  94.             $atk_log = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT * FROM attack_logs WHERE attacker = " . $_SESSION['playerid'] . " AND attacked = 23 AND time > $time AND attacklog NOT LIKE '%stalemated.%' AND attacklog NOT LIKE '% managed to run from %'");
  95.             if (mysqli_num_rows($atk_log)) {
  96.                  
  97.                 $item_check = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT * FROM members_items WHERE it_playerid = " . $_SESSION['playerid'] . " AND it_itemid = 77");
  98.                 if (mysqli_num_rows($item_check)) {
  99.                     mysqli_query($GLOBALS["___mysqli_ston"], "UPDATE members_items SET it_qty = it_qty + 1 WHERE it_playerid = " . $_SESSION['playerid'] . " AND it_itemid = 77");
  100.                 } else {
  101.                     mysqli_query($GLOBALS["___mysqli_ston"], "INSERT INTO members_items VALUES ('', " . $_SESSION['playerid'] . ", 77, 1)");
  102.                 }
  103.                 mysqli_query($GLOBALS["___mysqli_ston"], "UPDATE active_missions SET am_objective_1_done = 'yes' WHERE am_playerid = " . $_SESSION['playerid'] . " AND am_mission = 1");
  104.                 event_add($_SESSION['playerid'], 'You stole the Samsung Digital Camera from Nigga[23] and completed the first step of Mission One!');
  105.             }
  106.         }
  107.          
  108.         if ($active['am_objective_2_done'] == 'no' AND $active['am_objective_1_done'] == 'yes') {
  109.             //objective 2
  110.             $user        = mysqli_fetch_assoc(mysqli_query($GLOBALS["___mysqli_ston"], "SELECT playername FROM members WHERE playerid = " . $_SESSION['playerid']));
  111.             $itmsend_log = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT * FROM member_logs WHERE l_type = 'itemxfer' AND l_playerid = " . $_SESSION['playerid'] . " AND l_text = '" . $user['playername'] . "[" . $_SESSION['playerid'] . "] sent a/an Samsung Digital Camera to Services[3].' AND l_time > $time");
  112.              
  113.             if (mysqli_num_rows($itmsend_log)) {
  114.                 mysqli_query($GLOBALS["___mysqli_ston"], "UPDATE active_missions SET am_objective_2_done = 'yes' WHERE am_playerid = " . $_SESSION['playerid'] . " AND am_mission = 1");
  115.                 event_add($_SESSION['playerid'], 'You sent the Samsung Digital Camera to Services[3] and completed the second step of Mission One!');
  116.             }
  117.         }
  118.     } else {
  119.         mysqli_query($GLOBALS["___mysqli_ston"], "DELETE FROM members_items WHERE it_playerid = " . $_SESSION['playerid'] . " AND it_itemid = 167");
  120.     }
  121.      
  122. }
  123.  
  124.  
  125.  
  126. function mission_two_check()
  127. {
  128.      
  129.      
  130.     $active = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT * FROM active_missions WHERE am_playerid = " . $_SESSION['playerid'] . " AND am_mission = 2");
  131.     if (mysqli_num_rows($active)) {
  132.         $active = mysqli_fetch_assoc($active);
  133.          
  134.         if ($active['am_objective_3_done'] == 'no') {
  135.              
  136.             $my_job = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT my_job FROM members_extra WHERE playerid = " . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $_SESSION['playerid']) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")));
  137.             if (mysqli_num_rows($my_job)) {
  138.                 $my_job = mysqli_fetch_array($my_job);
  139.                  
  140.                 //objective 3
  141.                 if ($my_job['my_job']) {
  142.                     mysqli_query($GLOBALS["___mysqli_ston"], "UPDATE active_missions SET am_objective_3_done = 'yes' WHERE am_playerid = " . $_SESSION['playerid'] . " AND am_mission = 2");
  143.                     event_add($_SESSION['playerid'], 'You have a job and completed the third step of Mission Two!');
  144.                 }
  145.                  
  146.             }
  147.         }
  148.     }
  149. }
  150.  
  151.  
  152. function new_token()
  153. {
  154.     $_SESSION['token'] = md5(uniqid(rand(), TRUE));
  155. }
  156. mysqli_query($GLOBALS["___mysqli_ston"], "UPDATE members_extra SET my_crimeexp = '0' WHERE my_crimeexp < '0'");
  157. mysqli_query($GLOBALS["___mysqli_ston"], "UPDATE members  
  158.                 SET my_life = my_maxlife,
  159.                     my_hosp = '0'
  160.                 WHERE my_hosp > '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], time()) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'
  161.                 AND am_i_staff = '0' ||  
  162.                     my_hosp > '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], time()) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'
  163.                 AND playerid = '0'");
  164. mysqli_query($GLOBALS["___mysqli_ston"], "UPDATE members  
  165.                 SET laston = '" . time() . "',
  166.                     last_hit_IP = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $_SERVER['REMOTE_ADDR']) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'
  167.                 WHERE playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $_SESSION['playerid']) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'");
  168.  
  169.  
  170.  
  171. function pageblock($page, $playerid)
  172. {
  173.     $res = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT setting,lastrun,started FROM survive_config WHERE setting = 'Active'");
  174.     if (mysqli_num_rows($res)) {
  175.         // check if user is in lockdown
  176.         $user    = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT * FROM lockdown_users WHERE user = '" . $playerid . "'");
  177.         $ret     = mysqli_fetch_array($user);
  178.         $getpage = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT page_name FROM lockdown_pageblocks");
  179.         while ($page = mysqli_fetch_array($getpage)) {
  180.             // pages that are blocked during the lockdown  
  181.             if (($_SERVER['SCRIPT_NAME'] == $page['page_name']) && $ret['lockdown'] == 'Yes') {
  182.                 echo 'This page has been disabled during the Lockdown';
  183.                 exit;
  184.             }
  185.         }
  186.     }
  187. }
  188.  
  189.  
  190. function errors_($err)
  191. {
  192.     $error = array(
  193.         'user' => 'Invalid User!',
  194.         'qty' => 'Invalid quantity!',
  195.         'XID' => 'Invalid ID!',
  196.         'jail' => 'Sorry, This page cannot be accessed while in jail.',
  197.         'hosp' => 'Sorry, This page cannot be accessed while in hospital.',
  198.         'jailorhosp' => 'Sorry, This page cannot be accessed while in jail or hospital.',
  199.         'shop' => 'Looks like you have walked into a closed down shop!',
  200.         'action' => 'Invalid action.'
  201.     );
  202.     return $error[$err];
  203. }
  204. function page_access($jailtime, $hosptime)
  205. {
  206.     $jailtime = abs(intval($jailtime));
  207.     $hosptime = abs(intval($hosptime));
  208.     if ($jailtime AND !$hosptime) {
  209.         if ($jailtime > time())
  210.             return FALSE;
  211.         else
  212.             return TRUE;
  213.     } else if (!$jailtime AND $hosptime) {
  214.         if ($hosptime > time())
  215.             return FALSE;
  216.         else
  217.             return TRUE;
  218.     } else if ($jailtime AND $hosptime) {
  219.         if ($jailtime || $hosptime > time())
  220.             return "FALSE";
  221.         else
  222.             return "TRUE";
  223.     } else {
  224.         return TRUE;
  225.     }
  226. }
  227. function money_alter($mon)
  228. {
  229.     if ($mon < 0) {
  230.         return "<font color=#FF0000>\$" . number_format($mon) . "</font>";
  231.     } else {
  232.         return "\$" . number_format($mon) . "";
  233.     }
  234. }
  235. function valid_form($lasturl, $ext)
  236. {
  237.     $urltocheck = "http://www.reunited-city.com/" . ($ext) . ".php";
  238.     if ($lasturl != $urltocheck)
  239.         return FALSE;
  240.     else
  241.         return TRUE;
  242. }
  243. function check_qty($player, $item, $qty, $xid)
  244. {
  245.     $player = abs(intval($player));
  246.     $item   = abs(intval($item));
  247.     $qty    = abs(intval($qty));
  248.     $xid    = abs(intval($xid));
  249.     if ($xid == 0) {
  250.         $cq   = array();
  251.         $q_ry = array();
  252.         $q_ry = "SELECT * FROM members_items
  253.                      WHERE it_playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $player) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'  
  254.                      AND it_itemid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $item) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'  
  255.                      AND it_qty >= '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $qty) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  256.         $cq   = mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  257.     } else {
  258.         $cq   = array();
  259.         $q_ry = array();
  260.         $q_ry = "SELECT * FROM members_items  
  261.             WHERE it_playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $player) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'  
  262.             AND it_qty >= '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $qty) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'  
  263.             AND it_ID = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $xid) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  264.         $cq   = mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  265.     }
  266.     $cq = mysqli_num_rows($cq) ? mysqli_num_rows($cq) : '';
  267.     if (!$cq) {
  268.         return "FALSE";
  269.     } else {
  270.         return "TRUE";
  271.     }
  272. }
  273.  
  274. function mkglobal($vars)
  275. {
  276.     if (!is_array($vars))
  277.         $vars = explode(":", $vars);
  278.     foreach ($vars as $v) {
  279.         if (isset($_GET[$v]))
  280.             $GLOBALS[$v] = ($_GET[$v]);
  281.         elseif (isset($_POST[$v]))
  282.             $GLOBALS[$v] = ($_POST[$v]);
  283.         else
  284.             return 0;
  285.     }
  286.     return 1;
  287. }
  288.  
  289.  
  290. function add_clips($player, $gun, $qty)
  291. {
  292.     $player = abs(intval($player));
  293.     $item   = abs(intval($item));
  294.     $qty    = abs(intval($qty));
  295.     $q_ry   = array();
  296.     $q_ry   = "SELECT * FROM members_ammo  
  297.             WHERE ma_playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $player) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'  
  298.             AND ma_gun = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $gun) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  299.     $ic     = array();
  300.     $ic     = mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  301.      
  302.     if (mysqli_num_rows($ic)) {
  303.         $p = array();
  304.         $p = mysqli_fetch_array($ic);
  305.         mysqli_query($GLOBALS["___mysqli_ston"], "UPDATE members_ammo  
  306.                         SET ma_clips = ma_clips + '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $qty) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'  
  307.                         WHERE ma_id = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $p['ma_id']) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'");
  308.     } else {
  309.         mysqli_query($GLOBALS["___mysqli_ston"], "INSERT INTO members_ammo  
  310.                            VALUES ('NULL',
  311.                                    '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $player) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "',
  312.                                    '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $gun) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "',
  313.                                    '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $qty) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "',
  314.                                    '0')");
  315.     }
  316. }
  317. function use_clips($player, $gun, $qty)
  318. {
  319.     $player = abs(intval($player));
  320.     $gun    = abs(intval($gun));
  321.     $q_ry   = array();
  322.     $q_ry   = "SELECT ma_loaded
  323.                FROM members_ammo
  324.                WHERE ma_gun = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $gun) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'
  325.                AND ma_playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $player) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  326.     $per    = array();
  327.     $per    = mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  328.     $p      = array();
  329.     $p      = mysqli_fetch_array($per);
  330.     if ($p['ma_loaded'] <= $qty) {
  331.         $q_ry = array();
  332.         $q_ry = "UPDATE members_ammo
  333.                    SET ma_loaded = '0'
  334.                    WHERE ma_playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $player) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'
  335.                    AND ma_gun = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $gun) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  336.         mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  337.     } else {
  338.         $q_ry = array();
  339.         $q_ry = "UPDATE members_ammo
  340.                    SET ma_loaded = ma_loaded - '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $qty) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'
  341.                    WHERE ma_playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $player) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'
  342.                    AND ma_gun = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $gun) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  343.         mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  344.     }
  345.     $q_ry = array();
  346.     $q_ry = "DELETE FROM members_ammo
  347.                    WHERE ma_clips <= '0'
  348.                    AND ma_loaded <= '0'";
  349.     mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  350.     stock_remove(3, 1);
  351. }
  352. function reload_gun($player, $gun)
  353. {
  354.     $player = abs(intval($player));
  355.     $gun    = abs(intval($gun));
  356.     $q_ry   = array();
  357.     $q_ry   = "SELECT a_perclip
  358.                FROM ammo
  359.                WHERE a_gun = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $gun) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  360.     $per    = array();
  361.     $per    = mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  362.     $p      = array();
  363.     $p      = mysqli_fetch_array($per);
  364.     $q_ry   = array();
  365.     $q_ry   = "UPDATE members_ammo
  366.                SET ma_loaded = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $p['a_perclip']) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "',
  367.                    ma_clips = ma_clips - '1'
  368.                WHERE ma_playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $player) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'
  369.                AND ma_gun = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $gun) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  370.     mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  371.     $q_ry = array();
  372.     $q_ry = "DELETE FROM members_ammo
  373.                WHERE ma_clips <= '0'
  374.                AND ma_loaded <= '0'";
  375.     mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  376. }
  377. function i_credit($player, $item, $qty)
  378. {
  379.     $player = abs(intval($player));
  380.     $item   = abs(intval($item));
  381.     $qty    = abs(intval($qty));
  382.     $ic     = array();
  383.     $q_ry   = array();
  384.     $p      = array();
  385.     $q_ry   = "SELECT * FROM members_items  
  386.             WHERE it_playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $player) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'  
  387.             AND it_itemid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $item) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  388.     $ic     = mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  389.      
  390.     if (mysqli_num_rows($ic)) {
  391.         $p = mysqli_fetch_array($ic);
  392.         mysqli_query($GLOBALS["___mysqli_ston"], "UPDATE members_items  
  393.                         SET it_qty = it_qty + '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $qty) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'  
  394.                         WHERE it_ID = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $p['it_ID']) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'");
  395.     } else {
  396.         mysqli_query($GLOBALS["___mysqli_ston"], "INSERT INTO members_items  
  397.                            VALUES ('NULL',
  398.                                    '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $player) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "',
  399.                                    '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $item) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "',
  400.                                    '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $qty) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "')");
  401.     }
  402.      
  403.     $miss_two = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT * FROM active_missions WHERE am_playerid = " . $_SESSION['playerid'] . " AND am_mission = 2");
  404.     if (mysqli_num_rows($miss_two)) {
  405.         $miss_two = mysqli_fetch_assoc($miss_two);
  406.         if ($miss_two['am_objective_2_done'] == 'no') {
  407.             $itm_class = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT item_class FROM items WHERE item_id = " . $item);
  408.              
  409.             if (mysqli_num_rows($itm_class)) {
  410.                 $itm_class = mysqli_fetch_assoc($itm_class);
  411.                 if ($itm_class['item_class'] == 1 || $itm_class['item_class'] == 2 || $itm_class['item_class'] == 3 || $itm_class['item_class'] == 4) {
  412.                     mysqli_query($GLOBALS["___mysqli_ston"], "UPDATE active_missions SET am_objective_2_done = 'yes' WHERE am_playerid = " . $_SESSION['playerid'] . " AND am_mission = 2");
  413.                     event_add($_SESSION['playerid'], 'You have bought a weapon and completed the second step of Mission Two!');
  414.                 }
  415.             }
  416.         }
  417.     }
  418. }
  419. function i_remove($player, $item, $qty)
  420. {
  421.     $player = abs(intval($player));
  422.     $item   = abs(intval($item));
  423.     $qty    = abs(intval($qty));
  424.     $ir     = array();
  425.     $q_ry   = array();
  426.     $p      = array();
  427.     $q_ry   = "SELECT * FROM members_items  
  428.             WHERE it_playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $player) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'  
  429.             AND it_itemid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $item) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'  
  430.             AND it_qty > '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $qty) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  431.     $ir     = mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  432.      
  433.     if (mysqli_num_rows($ir)) {
  434.         $p = mysqli_fetch_array($ir);
  435.         mysqli_query($GLOBALS["___mysqli_ston"], "UPDATE members_items  
  436.                  SET it_qty = it_qty - '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $qty) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'  
  437.                  WHERE it_ID = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $p['it_ID']) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'");
  438.     } else {
  439.         mysqli_query($GLOBALS["___mysqli_ston"], "DELETE FROM members_items  
  440.                   WHERE it_playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $player) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'  
  441.                   AND it_itemid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $item) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'");
  442.     }
  443. }
  444.  
  445. function i_fac_add($faction, $item, $qty)
  446. {
  447.     $faction = abs(intval($faction));
  448.     $item    = abs(intval($item));
  449.     $qty     = abs(intval($qty));
  450.     $ir      = array();
  451.     $q_ry    = array();
  452.     $p       = array();
  453.     $q_ry    = "SELECT * FROM faction_armouries  
  454.             WHERE fa_fac = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $faction) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'  
  455.             AND fa_item = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $item) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  456.     $ir      = mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  457.      
  458.     if (mysqli_num_rows($ir)) {
  459.         $p = mysqli_fetch_array($ir);
  460.         mysqli_query($GLOBALS["___mysqli_ston"], "UPDATE faction_armouries  
  461.                  SET fa_qty = fa_qty + '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $qty) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'  
  462.                  WHERE fa_id = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $p['fa_id']) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'");
  463.     } else {
  464.         mysqli_query($GLOBALS["___mysqli_ston"], "INSERT INTO faction_armouries  
  465.                   VALUES ('NULL',
  466.                           '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $faction) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "',
  467.                           '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $item) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "',
  468.                           '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $qty) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "')");
  469.     }
  470. }
  471. function i_fac_remove($faction, $item, $qty)
  472. {
  473.     $faction = abs(intval($faction));
  474.     $item    = abs(intval($item));
  475.     $qty     = abs(intval($qty));
  476.     $ir      = array();
  477.     $q_ry    = array();
  478.     $p       = array();
  479.     $q_ry    = "SELECT * FROM faction_armouries  
  480.             WHERE fa_fac = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $faction) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'  
  481.             AND fa_item = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $item) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'  
  482.             AND fa_qty > '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $qty) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  483.     $ir      = mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  484.      
  485.     if (mysqli_num_rows($ir)) {
  486.         $p = mysqli_fetch_array($ir);
  487.         mysqli_query($GLOBALS["___mysqli_ston"], "UPDATE faction_armouries  
  488.                  SET fa_qty = fa_qty - '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $qty) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'  
  489.                  WHERE fa_id = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $p['fa_id']) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'");
  490.     } else {
  491.         mysqli_query($GLOBALS["___mysqli_ston"], "DELETE FROM faction_armouries  
  492.                   WHERE fa_fac = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $faction) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'  
  493.                   AND fa_item = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $item) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'");
  494.     }
  495. }
  496.  
  497.  
  498. function add_fac_lend($faction, $item, $user)
  499. {
  500.     $faction = abs(intval($faction));
  501.     $item    = abs(intval($item));
  502.     $user    = abs(intval($user));
  503.     $q_ry    = array();
  504.     $q_ry    = "INSERT INTO faction_lends
  505.             VALUES ('NULL',
  506.                     '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $faction) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "',
  507.                     '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $item) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "',
  508.                     '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $user) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "',
  509.                     unix_timestamp(),
  510.                     '0')";
  511.     mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  512. }
  513. function remove_fac_lend($id)
  514. {
  515.     $id        = abs(intval($id));
  516.     $q_ry      = array();
  517.     $q_ry      = "SELECT fl_itemid,fl_playerid,fl_equipped
  518.             FROM faction_lends
  519.             WHERE fl_id = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $id) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  520.     $lend_stat = array();
  521.     $lend_stat = mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  522.     $ls        = array();
  523.     $ls        = mysqli_fetch_array($lend_stat);
  524.     if ($ls['fl_equipped'] != '0') {
  525.         $q_ry     = array();
  526.         $q_ry     = "SELECT item_class
  527.               FROM items
  528.               WHERE item_id = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $ls['fl_itemid']) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  529.         $i_claass = array();
  530.         $i_class  = mysqli_fetch_array(mysqli_query($GLOBALS["___mysqli_ston"], $q_ry));
  531.          
  532.         $type = array(
  533.             1 => 'melee',
  534.             2 => 'secondary',
  535.             3 => 'primary',
  536.             5 => 'armour'
  537.         );
  538.         $q_ry = array();
  539.         $q_ry = "UPDATE member_equipped
  540.               SET " . $type[$i_class['item_class']] . " = '0'
  541.               WHERE playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $ls['fl_playerid']) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  542.         mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  543.         $q_ry = array();
  544.         $q_ry = "DELETE FROM faction_lends
  545.             WHERE fl_id = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $id) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  546.         mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  547.     } else {
  548.         $q_ry = array();
  549.         $q_ry = "DELETE FROM faction_lends
  550.             WHERE fl_id = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $id) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  551.         mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  552.     }
  553. }
  554.  
  555. function valid_XID($xid)
  556. {
  557.     $xid = abs(intval($xid));
  558.     $xid = (isset($xid) ? $xid : '');
  559.     if (!$xid) {
  560.         return FALSE;
  561.     } else {
  562.         return TRUE;
  563.     }
  564. }
  565. function valid_PID($pid)
  566. {
  567.     $pid = abs(intval($pid));
  568.     $pid = (isset($pid) ? $pid : '');
  569.     if (!$pid) {
  570.         return FALSE;
  571.     } else {
  572.         return TRUE;
  573.     }
  574. }
  575. function in_event($player, $text)
  576. {
  577.     $player = abs(intval($player));
  578.     $text   = stripslashes($text);
  579.     mysqli_query($GLOBALS["___mysqli_ston"], "INSERT INTO member_events  
  580.                                                 VALUES('NULL',  
  581.                                                        '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $player) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "',  
  582.                                                        '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $text) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "',
  583.                                                        unix_timestamp(),  
  584.                                                        '0')");
  585.     mysqli_query($GLOBALS["___mysqli_ston"], "UPDATE city_statistic  
  586.                                                 SET cs_value = cs_value + '1'
  587.                                                 WHERE cs_id = '1'");
  588. }
  589. function event_add($player, $text)
  590. {
  591.     $player = abs(intval($player));
  592.     $text   = stripslashes($text);
  593.     mysqli_query($GLOBALS["___mysqli_ston"], "INSERT INTO member_events VALUES('NULL',  
  594.                                                        '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $player) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "',  
  595.                                                        '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $text) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "',
  596.                                                        unix_timestamp(),  
  597.                                                        '0')");
  598.     mysqli_query($GLOBALS["___mysqli_ston"], "UPDATE city_statistic  
  599.                                                 SET cs_value = cs_value + '1'
  600.                                                 WHERE cs_id = '1'");
  601. }
  602. function in_notif($player, $text)
  603. {
  604.     $player = abs(intval($player));
  605.     $text   = stripslashes($text);
  606.     mysqli_query($GLOBALS["___mysqli_ston"], "INSERT INTO member_notifs  
  607.                                                 VALUES('NULL',  
  608.                                                        '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $player) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "',  
  609.                                                        '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $text) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "',
  610.                                                        unix_timestamp(),  
  611.                                                        '0')");
  612. }
  613. function fac_event($faction, $text)
  614. {
  615.     $faction = abs(intval($faction));
  616.     $text    = stripslashes($text);
  617.     mysqli_query($GLOBALS["___mysqli_ston"], "INSERT INTO faction_events  
  618.                                                 VALUES('NULL',  
  619.                                                        '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $faction) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "',  
  620.                                                        '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $text) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "',
  621.                                                        unix_timestamp())");
  622. }
  623. function org_log($faction, $text, $gain, $cash, $stat)
  624. {
  625.     $faction = abs(intval($faction));
  626.     $text    = stripslashes($text);
  627.     $gain    = abs(intval($gain));
  628.     $cash    = abs(intval($cash));
  629.     $stat    = stripslashes($stat);
  630.     mysqli_query($GLOBALS["___mysqli_ston"], "INSERT INTO org_logs  
  631.                                                 VALUES('NULL',  
  632.                                                        '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $faction) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "',  
  633.                                                        '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $text) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "',
  634.                                                        '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $gain) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "',
  635.                                                        '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $cash) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "',
  636.                                                        '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $stat) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "',
  637.                                                        unix_timestamp())");
  638. }
  639. function user_name($player)
  640. {
  641.     $player = abs(intval($player));
  642.     $ch     = array();
  643.     $q_ry   = array();
  644.     $q_ry   = "SELECT playername,my_dondays,am_i_staff
  645.            FROM members  
  646.            WHERE playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $player) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  647.     $ch     = mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  648.     if (!mysqli_num_rows($ch)) {
  649.         $name = "None";
  650.     } else {
  651.         $c = mysqli_fetch_array($ch);
  652.         if ($c['my_dondays']) {
  653.             $name = "<font color = 'blue'><b>" . htmlentities($c['playername']) . "</b></font>[" . $player . "]";
  654.         } else {
  655.             if ($c['am_i_staff'] < 2) {
  656.                 $name .= htmlentities($c['playername']) . "</a>[" . $player . "]";
  657.             } else if ($c['am_i_staff'] == 2) {
  658.                 $name .= "<b><font color=#660099>" . htmlentities($c['playername']) . "</font></b></a>[" . $player . "]";
  659.             } else if ($c['am_i_staff'] == 3) {
  660.                 $name .= "<b><font color=#0085A3>" . htmlentities($c['playername']) . "</font></b></a>[" . $player . "]";
  661.             } else if ($c['am_i_staff'] == 4) {
  662.                 $name .= "<b><font color=#006633>" . htmlentities($c['playername']) . "</font></b></a>[" . $player . "]";
  663.             } else if ($c['am_i_staff'] == 5) {
  664.                 $name .= "<b><font color=#AA0000>" . htmlentities($c['playername']) . "</font></b></a>[" . $player . "]";
  665.             }
  666.         }
  667.     }
  668.     return $name;
  669. }
  670. function user_name_icons($player)
  671. {
  672.     $player = abs(intval($player));
  673.     $ch     = array();
  674.     $q_ry   = array();
  675.     $q_ry   = "SELECT playername,my_dondays,vipday,my_jail,my_hosp,my_gender,am_i_staff
  676.            FROM members  
  677.            WHERE playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $player) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  678.     $ch     = mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  679.     if (!mysqli_num_rows($ch)) {
  680.         $name = "None";
  681.     } else {
  682.         $name = "<a href='profile.php?XID=" . $player . "'>";
  683.         $c    = mysqli_fetch_array($ch);
  684.         if ($c['my_dondays'] && $c['am_i_staff'] < 2) {
  685.             $name .= "<font color = 'blue'><b>" . htmlentities($c['playername']) . "</b></font></a>[" . $player . "]";
  686.         } else {
  687.             if ($c['am_i_staff'] < 2) {
  688.                 $name .= htmlentities($c['playername']) . "</a>[" . $player . "]";
  689.             } else if ($c['am_i_staff'] == 2) {
  690.                 $name .= "<b><font color=#660099>" . htmlentities($c['playername']) . "</font></b></a>[" . $player . "]";
  691.             } else if ($c['am_i_staff'] == 3) {
  692.                 $name .= "<b><font color=#0085A3>" . htmlentities($c['playername']) . "</font></b></a>[" . $player . "]";
  693.             } else if ($c['am_i_staff'] == 4) {
  694.                 $name .= "<b><font color=#006633>" . htmlentities($c['playername']) . "</font></b></a>[" . $player . "]";
  695.             } else if ($c['am_i_staff'] == 5) {
  696.                 $name .= "<b><font color=#AA0000>" . htmlentities($c['playername']) . "</font></b></a>[" . $player . "]";
  697.             }
  698.         }
  699.         $name .= "<img src='images/" . $c['my_gender'] . ".gif' border = '0'>";
  700.         if ($c['my_dondays']) {
  701.             $name .= "<img src = 'images/donator.gif' border = '0'>";
  702.         }
  703.         if ($c['vipday']) {
  704.             $name .= "<img src = 'images/vip.jpg' border = '0'>";
  705.         }
  706.         if ($c['my_jail'] > time()) {
  707.             $name .= "<img src = 'images/jail.png' border = '0'>";
  708.         }
  709.         if ($c['my_hosp'] > time()) {
  710.             $name .= "<img src = 'images/hospital.png' border = '0'>";
  711.              
  712.         }
  713.     }
  714.     return $name;
  715. }
  716.  
  717. function user_name_id($player)
  718. {
  719.     $player = abs(intval($player));
  720.     $ch     = array();
  721.     $q_ry   = array();
  722.     $q_ry   = "SELECT playername,my_dondays,vipday,my_jail,my_hosp,my_gender,am_i_staff
  723.            FROM members  
  724.            WHERE playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $player) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  725.     $ch     = mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  726.     if (!mysqli_num_rows($ch)) {
  727.         $name = "None";
  728.     } else {
  729.         $name = "<a href='profile.php?XID=" . $player . "'>";
  730.         $c    = mysqli_fetch_array($ch);
  731.         if ($c['my_dondays'] && $c['am_i_staff'] < 2) {
  732.             $name .= "<font color = 'blue'><b>" . htmlentities($c['playername']) . "</b></font></a>[" . $player . "]";
  733.         } else {
  734.             if ($c['am_i_staff'] < 2) {
  735.                 $name .= htmlentities($c['playername']) . "</a>[" . $player . "]";
  736.             } else if ($c['am_i_staff'] == 2) {
  737.                 $name .= "<b><font color=#660099>" . htmlentities($c['playername']) . "</font></b></a>[" . $player . "]";
  738.             } else if ($c['am_i_staff'] == 3) {
  739.                 $name .= "<b><font color=#0085A3>" . htmlentities($c['playername']) . "</font></b></a>[" . $player . "]";
  740.             } else if ($c['am_i_staff'] == 4) {
  741.                 $name .= "<b><font color=#006633>" . htmlentities($c['playername']) . "</font></b></a>[" . $player . "]";
  742.             } else if ($c['am_i_staff'] == 5) {
  743.                 $name .= "<b><font color=#AA0000>" . htmlentities($c['playername']) . "</font></b></a>[" . $player . "]";
  744.             }
  745.              
  746.         }
  747.     }
  748.     return $name;
  749. }
  750. function getdogname($dog)
  751. {
  752.     $dog  = abs(intval($dog));
  753.     $ch   = array();
  754.     $q_ry = array();
  755.     $q_ry = "SELECT md_name
  756.            FROM members_dogs  
  757.            WHERE md_id = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $dog) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  758.     $ch   = mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  759.     if (!mysqli_num_rows($ch)) {
  760.         return "None";
  761.     } else {
  762.         $c = mysqli_fetch_array($ch);
  763.         return htmlentities($c['md_name']);
  764.     }
  765. }
  766. function getdogwins($dog)
  767. {
  768.     $dog  = abs(intval($dog));
  769.     $ch   = array();
  770.     $q_ry = array();
  771.     $q_ry = "SELECT md_raceswon
  772.            FROM members_dogs  
  773.            WHERE md_id = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $dog) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  774.     $ch   = mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  775.     if (!mysqli_num_rows($ch)) {
  776.         return "None";
  777.     } else {
  778.         $c = mysqli_fetch_array($ch);
  779.         return number_format($c['md_raceswon']);
  780.     }
  781. }
  782. function check_player($player)
  783. {
  784.     $player = abs(intval($player));
  785.     $ch     = array();
  786.     $q_ry   = array();
  787.     $q_ry   = "SELECT playerid  
  788.            FROM members  
  789.            WHERE playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $player) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  790.     $ch     = mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  791.     if (!mysqli_num_rows($ch)) {
  792.         return FALSE;
  793.     } else {
  794.         return TRUE;
  795.     }
  796. }
  797.  
  798.  
  799.  
  800.  
  801. function exp_level($lev)
  802.   {
  803.     $need = (($lev+1)*($lev+1)*($lev+1)*3);
  804.  
  805. return $need;
  806.  
  807. }
  808.  
  809.  
  810. function check_rank($myrank, $totexp, $player)
  811. {
  812.     $totexp = abs(intval($totexp));
  813.     for ($i = 2; $i <= 30; $i++) {
  814.         if ($i == 2) {
  815.             if ($totexp >= 300) {
  816.                 if ($i > $myrank) {
  817.                     $q_ry = array();
  818.                     $q_ry = "UPDATE members
  819.                        SET my_rank = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $i) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'
  820.                        WHERE playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $player) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  821.                     mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  822.                     in_event($player, 'Congratulations, You have ranked up to rank ' . $i . '!');
  823.                 }
  824.             }
  825.         } else {
  826.             if ($totexp >= (($i * 200) * $i * $i)) {
  827.                 if ($i > $myrank) {
  828.                     $q_ry = array();
  829.                     $q_ry = "UPDATE members
  830.                        SET my_rank = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $i) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'
  831.                        WHERE playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $player) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  832.                     mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  833.                     in_event($player, 'Congratulations, You have ranked up to rank ' . $i . '!');
  834.                 }
  835.             }
  836.         }
  837.          
  838.     }
  839. }
  840.  
  841.  
  842.  
  843.  
  844. function check_graft_bar($crimeexp, $curgraft, $player)
  845. {
  846.     $crimeexp = abs(intval($crimeexp));
  847.     $curgraft = abs(intval($curgraft));
  848.     $newgraft = 10;
  849.     $poss     = array(
  850.         1 => 2500,
  851.         2 => 12500,
  852.         3 => 75000,
  853.         4 => 200000,
  854.         5 => 500000,
  855.         6 => 1750000
  856.     );
  857.     $calc     = array(
  858.         2500 => 15,
  859.         12500 => 20,
  860.         75000 => 25,
  861.         200000 => 30,
  862.         500000 => 35,
  863.         1750000 => 40
  864.     );
  865.     for ($i = 1; $i <= 6; $i++) {
  866.         if ($crimeexp >= $poss[$i]) {
  867.             $newgraft = $calc[$poss[$i]];
  868.         } else {
  869.             $newgraft = $newgraft;
  870.         }
  871.     }
  872.     $q_ry       = array();
  873.     $q_ry       = "SELECT ms_times
  874.            FROM member_merit_spent
  875.            WHERE ms_playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $player) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'
  876.            AND ms_tier = '1'";
  877.     $graftgrade = array();
  878.     $graftgrade = mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  879.     if (mysqli_num_rows($graftgrade)) {
  880.         $gg = array();
  881.         $gg = mysqli_fetch_array($graftgrade);
  882.         $newgraft += $gg['ms_times'];
  883.     }
  884.     if ($newgraft != $curgraft) {
  885.         $q_ry = array();
  886.         $q_ry = "UPDATE members
  887.            SET my_maxnerve = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $newgraft) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'
  888.            WHERE playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $player) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  889.         mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  890.     }
  891. }
  892.  
  893.  
  894. function getgmt() {
  895.        return date("Y-m-d H:i:s");
  896.       }
  897.       function gmtime() {
  898.                return strtotime(getgmt());
  899.                }
  900.                function sqltounix($s) {
  901.                    return mktime(substr($s, 11, 2), substr($s, 14, 2), substr($s, 17, 2), substr($s, 5, 2),
  902.                    substr($s, 8, 2), substr($s, 0, 4));
  903.                   }  
  904.                   function gettimeleft($tl) {
  905.                   if($tl <= time()) { $release = "0 Seconds"; }
  906.                   else
  907.                   {
  908.                   $mins = floor(($tl - time()) / 60);
  909.                   $hours = floor($mins / 60);
  910.                   $mins -= $hours * 60;
  911.                   $days = floor($hours / 24);
  912.                   $hours -= $days * 24;
  913.                   $months = floor($days / 31);
  914.                   $days -= $months * 31;
  915.                   $weeks = floor($days / 7);
  916.                   $days -= $weeks * 7;
  917.                   $timeleft = ($tl - time());
  918.                   $secs = round($timeleft%60);
  919.                               if ($months > 0)//MONTHS
  920.                                  {
  921.                                   $release .= " $months Month" . ($months > 1 ? "s" : "");
  922.                                  }
  923.                               if ($weeks > 0)//WEEKS
  924.                                  {
  925.                               if ($months > 0)
  926.                                  {
  927.                                   $release .= ",";
  928.                                  }
  929.                                   $release .= " $weeks Week" . ($weeks > 1 ? "s" : "");
  930.                                  }
  931.                               if ($days > 0)//DAYS
  932.                                  {
  933.                               if ($months > 0 ||$weeks > 0)
  934.                                  {
  935.                                   $release .= ",";
  936.                                  }
  937.                                   $release .= " $days Day" . ($days > 1 ? "s" : "");
  938.                                  }
  939.                               if ($hours > 0)//HOURS
  940.                                  {
  941.                               if ($months > 0 ||$weeks > 0 || $days > 0)
  942.                                  {
  943.                                   $release .= ",";
  944.                                  }
  945.                                   $release .= " $hours Hour" . ($hours > 1 ? "s" : "");
  946.                                  }
  947.                               if ($mins > 0)//MINUTES
  948.                                  {
  949.                               if ($months > 0 ||$weeks > 0 || $days > 0 || $hours > 0)
  950.                                  {
  951.                                   $release .= ",";
  952.                                  }
  953.                                   $release .= " $mins Minute" . ($mins > 1 ? "s" : "");
  954.                                  }
  955.                               if($secs > 0)//SECONDS
  956.                               {
  957.                                   if($release != "")
  958.                                   {
  959.                                     $release .= " and";
  960.                                   }
  961.                                   $release .= " $secs Second" . ($secs > 1 ? "s" : "");
  962.                               }
  963.                               }
  964.                        return $release;
  965.                    }
  966. function end_war($att, $def)
  967. {
  968.     $att       = abs(intval($att));
  969.     $def       = abs(intval($def));
  970.     $q_ry      = array();
  971.     $q_ry      = "SELECT *
  972.                FROM faction_wars
  973.                WHERE war_attacker = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $att) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "' &&
  974.                      war_defender = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $def) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "' ||
  975.                      war_attacker = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $def) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "' &&
  976.                      war_defender = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $att) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  977.     $in_war    = array();
  978.     $in_war    = mysqli_fetch_array(mysqli_query($GLOBALS["___mysqli_ston"], $q_ry));
  979.     $q_ry      = array();
  980.     $q_ry      = "SELECT fac_name
  981.                FROM faction_s
  982.                WHERE fac_id = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $att) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  983.     $attackers = array();
  984.     $attackers = mysqli_fetch_array(mysqli_query($GLOBALS["___mysqli_ston"], $q_ry));
  985.     $q_ry      = array();
  986.     $q_ry      = "SELECT fac_name
  987.                FROM faction_s
  988.                WHERE fac_id = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $def) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  989.     $defenders = array();
  990.     $defenders = mysqli_fetch_array(mysqli_query($GLOBALS["___mysqli_ston"], $q_ry));
  991.     if ($in_war['war_amade'] > $in_war['war_dmade']) {
  992.         $message = "<font color = 'green'>The war between you and " . htmlentities($defenders['fac_name']) . " has now ended, You won!</font>";
  993.         fac_event($att, $message);
  994.         $message = "<font color = 'red'>The war between you and " . htmlentities($attackers['fac_name']) . " has now ended, You lost!</font>";
  995.         fac_event($def, $message);
  996.     } else {
  997.         $message = "<font color = 'red'>The war between you and " . htmlentities($defenders['fac_name']) . " has now ended, You lost!</font>";
  998.         fac_event($att, $message);
  999.         $message = "<font color = 'green'>The war between you and " . htmlentities($attackers['fac_name']) . " has now ended, You won!</font>";
  1000.         fac_event($def, $message);
  1001.     }
  1002.     $q_ry = array();
  1003.     $q_ry = "DELETE FROM faction_wars
  1004.           WHERE war_id = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $in_war['war_id']) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  1005.     mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  1006.     add_pact($att, $def);
  1007. }
  1008. function end_war_time($att, $def, $id)
  1009. {
  1010.     $att       = abs(intval($att));
  1011.     $def       = abs(intval($def));
  1012.     $id        = abs(intval($id));
  1013.     $q_ry      = array();
  1014.     $q_ry      = "SELECT fac_name
  1015.                FROM faction_s
  1016.                WHERE fac_id = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $att) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  1017.     $attackers = array();
  1018.     $attackers = mysqli_fetch_array(mysqli_query($GLOBALS["___mysqli_ston"], $q_ry));
  1019.     $q_ry      = array();
  1020.     $q_ry      = "SELECT fac_name
  1021.                FROM faction_s
  1022.                WHERE fac_id = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $def) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  1023.     $defenders = array();
  1024.     $defenders = mysqli_fetch_array(mysqli_query($GLOBALS["___mysqli_ston"], $q_ry));
  1025.     $message   = "The war between you and " . htmlentities($defenders['fac_name']) . " has now ended, Nobody won!";
  1026.     fac_event($att, $message);
  1027.     $message = "The war between you and " . htmlentities($attackers['fac_name']) . " has now ended, Nobody won!";
  1028.     fac_event($def, $message);
  1029.     $q_ry = array();
  1030.     $q_ry = "DELETE FROM faction_wars
  1031.           WHERE war_id = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $id) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  1032.     mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  1033. }
  1034. function start_war($att, $def)
  1035. {
  1036.     $att  = abs(intval($att));
  1037.     $def  = abs(intval($def));
  1038.     $q_ry = array();
  1039.     $q_ry = "INSERT INTO faction_wars (war_attacker,war_defender,war_time)
  1040.             VALUES ('" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $att) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "',
  1041.                     '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $def) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "',
  1042.                     '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], time() + 604800) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "')";
  1043.     mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  1044. }
  1045.  
  1046. function add_pact($att, $def)
  1047. {
  1048.     $att  = abs(intval($att));
  1049.     $def  = abs(intval($def));
  1050.     $q_ry = array();
  1051.     $q_ry = "INSERT INTO none_agressive (na_faction,na_pactwith,na_days)
  1052.             VALUES ('" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $att) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "',
  1053.                     '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $def) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "',
  1054.                     '50')";
  1055.     mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  1056. }
  1057. function p_stats_add($field, $amount, $player)
  1058. {
  1059.     $amount = abs(intval($amount));
  1060.     $player = abs(intval($player));
  1061.     $fld    = array(
  1062.         'attack_lost' => 'my_attlost',
  1063.         'attack_won' => 'my_attwon',
  1064.         'myattack_comp' => 'attack_comp',
  1065.         'stale' => 'my_attstale',
  1066.         'i_run' => 'my_timesran',
  1067.         'i_defend' => 'my_defwon',
  1068.         'i_dont_defend' => 'my_deflost',
  1069.         'they_ran' => 'my_theyran',
  1070.         'def_stale' => 'my_defstale',
  1071.         'streak' => 'my_currstreak',
  1072.         'i_hit' => 'my_hits',
  1073.         'i_missed' => 'my_misses',
  1074.         'one_hit' => 'my_onehitkill',
  1075.         'fired' => 'my_rounds',
  1076.         'mugged' => 'my_muggain',
  1077.         'damage' => 'my_totaldamage',
  1078.         'respect' => 'my_respectgain',
  1079.         'high_level' => 'my_bestlevel',
  1080.         'itemarket' => 'my_ifrommarket',
  1081.         'bars_bought' => 'my_pointsbought',
  1082.         'bars_sold' => 'my_pointssold',
  1083.         'gunsrfun' => 'my_igunshop',
  1084.         'send_item' => 'my_isent',
  1085.         'trades' => 'my_trades',
  1086.         'bailed' => 'my_timesbailed',
  1087.         'spent_bail' => 'my_bailfees',
  1088.         'busted' => 'my_timesbusted',
  1089.         'failed_bust' => 'my_failedbusts',
  1090.         'jailed' => 'my_timesjailed',
  1091.         'medical' => 'my_medsused',
  1092.         'mail' => 'my_mailsent',
  1093.         'mail_spouse' => 'my_mailspouse',
  1094.         'mail_faction' => 'my_mailfaction',
  1095.         'mail_comp' => 'my_mailcolleage',
  1096.         'merits_bought' => 'my_meritsbought',
  1097.         'refills' => 'my_refills',
  1098.         'trained' => 'my_trains',
  1099.         'r_recieved' => 'my_beenrevived',
  1100.         'r_revived' => 'my_revived',
  1101.         'b_placed' => 'my_bounties',
  1102.         'b_spent' => 'my_bountyspent',
  1103.         'b_collect' => 'my_collected',
  1104.         'b_rewarded' => 'my_rewarded',
  1105.         'b_recieved' => 'my_bountyrecieved',
  1106.         'personal' => 'my_personals',
  1107.         'classified' => 'my_classified',
  1108.         'mail_friend' => 'my_mailfriend',
  1109.         'auctionadd' => 'my_iauctioned',
  1110.         'auctionwon' => 'my_auctionwon',
  1111.         'i_found' => 'my_ifound',
  1112.         'crit_hits' => 'my_crithits',
  1113.         'tot_invest' => 'my_totinvested',
  1114.         'tot_profit' => 'my_totprofit',
  1115.         'enhancers' => 'my_statenhance',
  1116.         'druguse' => 'my_drugsused',
  1117.         'overdose' => 'my_overdoses',
  1118.         'viruses' => 'my_viruses',
  1119.         'stealth' => 'my_stealths',
  1120.         'timesabroad' => 'my_traveled'
  1121.     );
  1122.      
  1123.      
  1124.     if ($fld[$field] == 'my_mailsent') {
  1125.         $q_ry = array();
  1126.         $q_ry = "UPDATE city_statistic
  1127.                 SET cs_value = (cs_value + '1')
  1128.                 WHERE cs_id = '2'";
  1129.         mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  1130.     }
  1131.      
  1132.      
  1133.     if ($fld[$field] == 'my_currstreak') {
  1134.         $q_ry    = array();
  1135.         $q_ry    = "SELECT my_currstreak,my_beststreak
  1136.               FROM members_personal
  1137.               WHERE playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $player) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  1138.         $my_best = array();
  1139.         $my_best = mysqli_fetch_array(mysqli_query($GLOBALS["___mysqli_ston"], $q_ry));
  1140.         if ($my_best['my_beststreak'] <= ($my_best['my_currstreak'] + 1)) {
  1141.             $q_ry = array();
  1142.             $q_ry = "UPDATE members_personal
  1143.                 SET my_beststreak = (my_currstreak + '1')
  1144.                 WHERE playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $player) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  1145.             mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  1146.         }
  1147.     }
  1148.      
  1149.      
  1150.     if ($fld[$field] == 'my_totaldamage') {
  1151.         $q_ry    = array();
  1152.         $q_ry    = "SELECT my_bestdamage
  1153.               FROM members_personal
  1154.               WHERE playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $player) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  1155.         $my_best = array();
  1156.         $my_best = mysqli_fetch_array(mysqli_query($GLOBALS["___mysqli_ston"], $q_ry));
  1157.         if ($my_best['my_bestdamage'] <= $amount) {
  1158.             $q_ry = array();
  1159.             $q_ry = "UPDATE members_personal
  1160.                 SET my_bestdamage = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $amount) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'
  1161.                 WHERE playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $player) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  1162.             mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  1163.         }
  1164.     }
  1165.      
  1166.      
  1167.     if ($fld[$field] == 'my_bestlevel') {
  1168.         $q_ry    = array();
  1169.         $q_ry    = "SELECT my_bestlevel
  1170.               FROM members_personal
  1171.               WHERE playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $player) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  1172.         $my_best = array();
  1173.         $my_best = mysqli_fetch_array(mysqli_query($GLOBALS["___mysqli_ston"], $q_ry));
  1174.         if ($my_best['my_bestlevel'] <= $amount) {
  1175.             $q_ry = array();
  1176.             $q_ry = "UPDATE members_personal
  1177.                 SET my_bestlevel = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $amount) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'
  1178.                 WHERE playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $player) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  1179.             mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  1180.         }
  1181.     } else {
  1182.          
  1183.         $q_ry = array();
  1184.         $q_ry = "UPDATE members_personal
  1185.             SET " . $fld[$field] . " = " . $fld[$field] . " + '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $amount) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'
  1186.             WHERE playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $player) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  1187.         mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  1188.     }
  1189. }
  1190.  
  1191. function reset_streak($player)
  1192. {
  1193.     $q_ry = array();
  1194.     $q_ry = "UPDATE members_personal
  1195.                 SET my_currstreak = '0'
  1196.                 WHERE playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $player) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  1197.     mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  1198. }
  1199. function check_bounty($player, $target)
  1200. {
  1201.     $q_ry  = array();
  1202.     $q_ry  = "SELECT *
  1203.                 FROM active_claims
  1204.                 WHERE c_playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $player) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'
  1205.                 AND c_target = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $target) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  1206.     $check = array();
  1207.     $check = mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  1208.     if (mysqli_num_rows($check)) {
  1209.         $c          = array();
  1210.         $c          = mysqli_fetch_array($check);
  1211.         $q_ry       = array();
  1212.         $q_ry       = "SELECT m.playername,b.*
  1213.                   FROM members m
  1214.                   LEFT JOIN bounties_placed b
  1215.                   ON b.b_target = m.playerid
  1216.                   WHERE b.b_id = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $c['c_claiming']) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  1217.         $the_bounty = array();
  1218.         $the_bounty = mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  1219.         $outcome    = '';
  1220.         if (!mysqli_num_rows($the_bounty)) {
  1221.             $outcome = "Sorry but it looks like the bounty you was tryin to claim has already been taken by someone else.";
  1222.         } else {
  1223.             $tb      = array();
  1224.             $tb      = mysqli_fetch_array($the_bounty);
  1225.             $outcome = "You have claimed the bounty that was on " . htmlentities($tb['playername']) . "'s head,
  1226.                      You have recieved " . money_alter($tb['b_reward']) . "!";
  1227.             $q_ry    = array();
  1228.             $q_ry    = "UPDATE members
  1229.                      SET wallet = wallet + '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $tb['b_reward']) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'
  1230.                      WHERE playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $player) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  1231.             mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  1232.             p_stats_add('b_collect', 1, $_SESSION['playerid']);
  1233.             p_stats_add('b_rewarded', $tb['b_reward'], $_SESSION['playerid']);
  1234.             $q_ry    = array();
  1235.             $q_ry    = "SELECT playername
  1236.                       FROM members
  1237.                       WHERE playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $_SESSION['playerid']) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  1238.             $claimer = array();
  1239.             $claimer = mysqli_fetch_array(mysqli_query($GLOBALS["___mysqli_ston"], $q_ry));
  1240.             $message = "<a href='profile.php?XID=" . $_SESSION['playerid'] . "'>" . htmlentities($claimer['playername']) . "</a>  
  1241.                          claimed the bounty that was on " . htmlentities($tb['playername']) . "'s head,
  1242.                          They have recieved the " . money_alter($tb['b_reward']) . " reward!";
  1243.             in_event($tb['b_playerid'], $message);
  1244.         }
  1245.         $q_ry = array();
  1246.         $q_ry = "DELETE FROM active_claims
  1247.                 WHERE c_id = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $c['c_id']) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  1248.         mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  1249.         $q_ry = array();
  1250.         $q_ry = "DELETE FROM bounties_placed
  1251.                 WHERE b_id = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $c['c_claiming']) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  1252.         mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  1253.          
  1254.         return $outcome;
  1255.     } else {
  1256.         return "";
  1257.     }
  1258. }
  1259. function stock_credit($id, $credit)
  1260. {
  1261.     $q_ry = array();
  1262.     $q_ry = "UPDATE stock_market
  1263.             SET s_profit = s_profit + '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $credit) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'
  1264.             WHERE s_id = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $id) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  1265.     mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  1266. }
  1267. function stock_remove($id, $credit)
  1268. {
  1269.     $q_ry = array();
  1270.     $q_ry = "UPDATE stock_market
  1271.             SET s_losses = s_losses + '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $credit) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'
  1272.             WHERE s_id = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $id) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  1273.     mysqli_query($GLOBALS["___mysqli_ston"], $q_ry) or die(((is_object($GLOBALS["___mysqli_ston"])) ? mysqli_error($GLOBALS["___mysqli_ston"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));
  1274. }
  1275.  
  1276. function send_recieve_log($type, $player, $playerip, $reciever, $text)
  1277. {
  1278.     $text       = trim($text);
  1279.     $q_ry       = array();
  1280.     $q_ry       = "SELECT last_hit_IP
  1281.              FROM members  
  1282.              WHERE playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $reciever) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  1283.     $recieverip = array();
  1284.     $recieverip = mysqli_fetch_array(mysqli_query($GLOBALS["___mysqli_ston"], $q_ry));
  1285.     $q_ry       = array();
  1286.     $q_ry       = "INSERT INTO member_logs
  1287.              VALUES ('NULL',
  1288.                      '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $type) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "',
  1289.                      '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $player) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "',
  1290.                      '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $reciever) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "',
  1291.                      '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $playerip) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "',
  1292.                      '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $recieverip['last_hit_IP']) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "',
  1293.                      '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $text) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "',
  1294.                      unix_timestamp())";
  1295.     mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  1296. }
  1297. function other_log($type, $player, $playerip, $text)
  1298. {
  1299.     $text = trim($text);
  1300.     $q_ry = array();
  1301.     $q_ry = "INSERT INTO member_logs (l_type,l_playerid,l_IP,l_text,l_time)
  1302.              VALUES ('" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $type) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "',
  1303.                      '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $player) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "',
  1304.                      '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $playerip) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "',
  1305.                      '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $text) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "',
  1306.                      unix_timestamp())";
  1307.     mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  1308. }
  1309. function vault_add($amount, $id)
  1310. {
  1311.     $q_ry     = array();
  1312.     $q_ry     = "SELECT v_id
  1313.              FROM member_vaults
  1314.              WHERE v_property = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $id) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  1315.     $thivault = array();
  1316.     $thivault = mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  1317.     if (mysqli_num_rows($thivault)) {
  1318.         $q_ry = array();
  1319.         $q_ry = "UPDATE member_vaults
  1320.                SET v_amount = v_amount + '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $amount) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'
  1321.                WHERE v_property = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $id) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  1322.         mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  1323.         $q_ry = array();
  1324.         $q_ry = "UPDATE members
  1325.                SET wallet = wallet - '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $amount) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'
  1326.                WHERE playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $_SESSION['playerid']) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  1327.         mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  1328.     } else {
  1329.         $q_ry = array();
  1330.         $q_ry = "INSERT INTO member_vaults
  1331.                VALUES('NULL',
  1332.                       '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $id) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "',
  1333.                       '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $amount) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "')";
  1334.         mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  1335.         $q_ry = array();
  1336.         $q_ry = "UPDATE members
  1337.                SET wallet = wallet - '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $amount) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'
  1338.                WHERE playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $_SESSION['playerid']) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  1339.         mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  1340.     }
  1341.      
  1342. }
  1343. function vault_remove($amount, $id)
  1344. {
  1345.     $q_ry = array();
  1346.     $q_ry = "UPDATE member_vaults
  1347.                SET v_amount = v_amount - '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $amount) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'
  1348.                WHERE v_property = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $id) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  1349.     mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  1350.     $q_ry = array();
  1351.     $q_ry = "UPDATE members
  1352.                SET wallet = wallet + '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $amount) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'
  1353.                WHERE playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $_SESSION['playerid']) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  1354.     mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  1355.     $q_ry = array();
  1356.     $q_ry = "DELETE FROM member_vaults
  1357.                WHERE v_amount <= '0'";
  1358.     mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  1359. }
  1360.  
  1361.  
  1362.  
  1363. function new_effect($time, $effect, $drugid, $addiction)
  1364. {
  1365.     $q_ry = "DELETE FROM member_influences
  1366.                WHERE mi_playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $_SESSION['playerid']) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  1367.     mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  1368.      
  1369.     $q_ry = "INSERT INTO member_influences
  1370.                VALUES('NULL',
  1371.                       '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $_SESSION['playerid']) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "',
  1372.                       '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $time) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "',
  1373.                       '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $effect) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "',
  1374.                       '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $drugid) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "')";
  1375.     mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  1376.     $q_ry = "UPDATE members_extra  
  1377.                SET my_drugadd = my_drugadd + '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $addiction) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'
  1378.                WHERE playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $_SESSION['playerid']) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  1379.     mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  1380.     p_stats_add('druguse', 1, $_SESSION['playerid']);
  1381. }
  1382.  
  1383. function fhc($time)
  1384. {
  1385.     $q_ry = "UPDATE members  
  1386.                SET fhc = 0
  1387.                WHERE playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $_SESSION['playerid']) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  1388.     mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  1389.     $q_ry = "UPDATE members  
  1390.                SET fhc = fhc + '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $time) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'
  1391.                WHERE playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $_SESSION['playerid']) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  1392.     mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  1393.      
  1394. }
  1395.  
  1396. function profile_image($id, $width)
  1397. {
  1398.     $q_ry = array();
  1399.     $q_ry = "SELECT i_image  
  1400.                             FROM member_images  
  1401.                             WHERE i_playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $id) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'  
  1402.                             AND i_profile = '1'";
  1403.     $im   = array();
  1404.     $im   = mysqli_query($GLOBALS["___mysqli_ston"], $q_ry);
  1405.     if (!mysqli_num_rows($im)) {
  1406.         return "<a href=profile.php?XID=" . $id . "><img src='images/blank_man.jpg' alt = 'No images' title = 'No images' width = '" . $width . "px' border = '0'></a>";
  1407.     } else {
  1408.         $mi       = array();
  1409.         $mi       = mysqli_fetch_array($im);
  1410.         $imgcheck = array();
  1411.         $imgcheck = "images/uploads/id" . $id . "/" . $mi['i_image'] . "";
  1412.         $size     = array();
  1413.         $size     = getimagesize($imgcheck);
  1414.         if ($size) {
  1415.             $q_ry = array();
  1416.             $q_ry = "SELECT playername,my_level,my_gender
  1417.                                FROM members
  1418.                                WHERE playerid = '" . ((isset($GLOBALS["___mysqli_ston"]) && is_object($GLOBALS["___mysqli_ston"])) ? mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $id) : ((trigger_error("[MySQLConverterToo] Fix the mysql_escape_string() call! This code does not work.", E_USER_ERROR)) ? "" : "")) . "'";
  1419.             $myi  = array();
  1420.             $myi  = mysqli_fetch_array(mysqli_query($GLOBALS["___mysqli_ston"], $q_ry));
  1421.             return "<a href=profile.php?XID=" . $id . " rel = 'tooltip' title = '<b>User image</b><br/><img src = \"" . $imgcheck . "\" width = \"100px\" border = \"0\"><br/>User image for " . htmlentities($myi['playername']) . "[" . $id . "]<br/>Level: " . $myi['my_level'] . "<br/>Gender: " . $myi['my_gender'] . "'>
  1422.                             <img src = '" . $imgcheck . "' width = '" . $width . "px' border = '0'></a>";
  1423.         } else {
  1424.             // error
  1425.             return "<font color = 'red'><br/><b>Image error</b><br/></font>.";
  1426.         }
  1427.     }
  1428. }
  1429. function ae_detect_ie()
  1430. {
  1431.     if (isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false))
  1432.         return true;
  1433.     else
  1434.         return false;
  1435. }
  1436. function back()
  1437. {
  1438.     return "<hr width='75%'>&gt;<a href='javascript:history.back();'>Back</a><hr width='75%'>";
  1439. }
  1440. function round_table($size)
  1441. {
  1442.     if ($size) {
  1443.         $size = "width = '" . ($size + 4) . "px'";
  1444.     } else {
  1445.         $size = '';
  1446.     }
  1447.     $content = "<table cellspacing = '0' cellpadding = '0' border = '0' " . $size . ">
  1448.         <tr>
  1449.            <td style = 'background: url(images/round-table/topleft.png) no-repeat left top;' width = '14px' height = '14px'></td>
  1450.            <td style = 'background: url(images/round-table/top.png) repeat-x center top;' height = '14px'></td>
  1451.            <td style = 'background: url(images/round-table/topright.png) no-repeat right top;' width = '14px' height = '14px'></td>
  1452.         </tr>
  1453.         <tr>
  1454.            <td style = 'background: url(images/round-table/left.png) repeat-y left top;' width = '14px'></td>
  1455.            <td align = 'center'>";
  1456.     return $content;
  1457. }
  1458. function end_round()
  1459. {
  1460.     $content = "</td>
  1461.            <td style = 'background: url(images/round-table/right.png) repeat-y right top;' width = '14px'></td>
  1462.         </tr>
  1463.         <tr>
  1464.            <td style = 'background: url(images/round-table/bottomleft.png) no-repeat left bottom;' width = '14px' height = '14px'></td>
  1465.            <td style = 'background: url(images/round-table/bottom.png) repeat-x center bottom;' height = '14px'></td>
  1466.            <td style = 'background: url(images/round-table/bottomright.png) no-repeat right bottom;' width = '14px' height = '14px'></td>
  1467.         </tr>
  1468.      </table>";
  1469.     return $content;
  1470. }
  1471. function round_table1($size)
  1472. {
  1473.     if ($size) {
  1474.         $size = "width = '" . ($size + 4) . "px'";
  1475.     } else {
  1476.         $size = '';
  1477.     }
  1478.     $content = "<table cellspacing = '0' cellpadding = '0' border = '0' " . $size . ">
  1479.         <tr>
  1480.            <td style = 'background: url(images/round-table/topleft.png) no-repeat left top;' width = '14px' height = '14px'></td>
  1481.            <td style = 'background: url(images/round-table/top.png) repeat-x center top;' height = '14px'></td>
  1482.            <td style = 'background: url(images/round-table/topright.png) no-repeat right top;' width = '14px' height = '14px'></td>
  1483.         </tr>
  1484.         <tr>
  1485.            <td style = 'background: url(images/round-table/left.png) repeat-y left top;' width = '14px'></td>
  1486.            <td align = 'left'>";
  1487.     return $content;
  1488. }
  1489. function end_round1()
  1490. {
  1491.     $content = "</td>
  1492.            <td style = 'background: url(images/round-table/right.png) repeat-y right top;' width = '14px'></td>
  1493.         </tr>
  1494.         <tr>
  1495.            <td style = 'background: url(images/round-table/bottomleft.png) no-repeat left bottom;' width = '14px' height = '14px'></td>
  1496.            <td style = 'background: url(images/round-table/bottom.png) repeat-x center bottom;' height = '14px'></td>
  1497.            <td style = 'background: url(images/round-table/bottomright.png) no-repeat right bottom;' width = '14px' height = '14px'></td>
  1498.         </tr>
  1499.      </table>";
  1500.     return $content;
  1501. }
  1502. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement