<?xml version="1.0" encoding="utf-8"?>
<!-- Generated on Fri, 05 Jun 2026 14:23:14 +0200 -->
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>GMod-Fan Inc. - Форум</title>
    <link>https://gmod-fan.com/forum/problems/topic-1617.html</link>
    <description>Последние ответы в теме: Помогите с системой сохранения денег</description>
    <generator>LogicBoard</generator>
    <item>
      <title>Помогите с системой сохранения денег</title>
      <description><![CDATA[<blockquote class="blockspoiler"><span class="titlespoiler"><a href='#' onclick="ShowAndHide('e3baf88e9885ea13c046295be32e275a'); return false;">sv_mysql.lua</a></span><div id='e3baf88e9885ea13c046295be32e275a' style='display:none;' class="textspoiler"><!-- JS code --><div class="javascript" style="font: normal normal 90% monospace; color: #000066; border: 1px solid #d0d0d0; background-color: #f0f0f0;"><div style="font-family: sans-serif; color: #808080; font-size: 70%; font-weight: bold; background-color: #f0f0ff; border-bottom: 1px solid #d0d0d0; padding: 2px;">JavaScript code:</div><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339933;">--</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#91;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; The <span style="color: #003366; font-weight: bold;">use</span> of a MySQL database <span style="color: #000066; font-weight: bold;">is</span> completely optional.</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">This</span> gamemode will be using gmsv_mysqloo which can be</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; found at<span style="color: #339933;">:</span> <span style="color: #339933;">&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;http://forum.gmod-fan.ru/away.php?s=http%3A%2F%2Ffacepunch.com%2Fshowthread.php%3Ft%3D1220537&quot;</span> target<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;_blank&quot;</span><span style="color: #339933;">&gt;</span>http<span style="color: #339933;">:</span><span style="color: #006600; font-style: italic;">//facepunch.com/showthread.php?t=1220537&lt;/a&gt;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; Thanks to Drakehawke.</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #660066;">IMPORTANT</span><span style="color: #339933;">!</span> Make sure that you execute the .<span style="color: #660066;">sql</span> file included <span style="color: #000066; font-weight: bold;">in</span> gamemodes<span style="color: #339933;">/</span>pistachio</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; &nbsp; &nbsp; &nbsp; Otherwise your gamemode will not <span style="color: #003366; font-weight: bold;">use</span> MySQL correctly.</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339933;">--</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">PS_USE_MYSQL <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span> <span style="color: #339933;">--</span> <span style="color: #003366; font-weight: bold;">True</span><span style="color: #339933;">/</span><span style="color: #003366; font-weight: bold;">false</span> to set whether MySQL <span style="color: #000066; font-weight: bold;">is</span> used.</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #660066;">local</span> MYSQL_HOSTNAME <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;localhost&quot;</span><span style="color: #339933;">;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">--</span> The host of your database.</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #660066;">local</span> MYSQL_USERNAME <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;root&quot;</span><span style="color: #339933;">;</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">--</span> Which user it will be logged <span style="color: #000066; font-weight: bold;">in</span> <span style="color: #000066; font-weight: bold;">with</span>.</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #660066;">local</span> MYSQL_PASSWORD <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;password&quot;</span><span style="color: #339933;">;</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">--</span> The password <span style="color: #000066; font-weight: bold;">for</span> the user.</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #660066;">local</span> MYSQL_DATABASE <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;lightrp&quot;</span><span style="color: #339933;">;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">--</span> Which database contains the tables.</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #660066;">local</span> MYSQL_PORT <span style="color: #339933;">=</span> <span style="color: #CC0000;">3306</span><span style="color: #339933;">;</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">--</span> The port <span style="color: #000066; font-weight: bold;">for</span> the database. <span style="color: #003366; font-weight: bold;">Default</span> <span style="color: #000066; font-weight: bold;">is</span> <span style="color: #CC0000;">3306</span>.</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339933;">--</span> You shouldn<span style="color: #3366CC;">'t be changing anything below this line</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">-- unless you want to modify which module to use or something else.</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">db = db or {};</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">-- These are assumed tables that are assumed already made.</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">-- Used in the persist functions.</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">db.tables = {</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; money = {table = &quot;Money&quot;, data = &quot;number&quot;}</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">/*&nbsp; &nbsp; &nbsp; title = {table = &quot;Title&quot;, data = &quot;string&quot;},</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; karma = {table = &quot;Karma&quot;, data = &quot;number&quot;},</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; model = {table = &quot;Model&quot;, data = &quot;string&quot;},</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; hat = {table = &quot;Hat&quot;, data = &quot;string&quot;},</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; particle = {table = &quot;Particle&quot;, data = &quot;string&quot;},</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; color = {table = &quot;Color&quot;, data = &quot;string&quot;},</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; bank = {table = &quot;Bank&quot;, data = &quot;number&quot;}*/</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">};</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">function db:Connect()</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; if (self.obj) then</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print(&quot;[Light RP] MySQL connection already exists.&quot;);</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; end;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; print(&quot;[Light RP] Loading MySQL...&quot;);</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; local database = mysqloo.connect(MYSQL_HOSTNAME, MYSQL_USERNAME, MYSQL_PASSWORD, MYSQL_DATABASE, MYSQL_PORT);</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; function database:onConnected()</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; db.obj = self;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MsgC(Color(0, 255, 0), &quot;[Light RP] Connected to the database!<span style="color: #000099; font-weight: bold;">\n</span>&quot;);</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; end;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; function database:onConnectionFailed(message)</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MsgC(Color(255, 0, 0), &quot;[Light RP] Connection failed! &quot;..message..&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;);</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MsgC(Color(255, 0, 0), &quot;[Light RP] Reverting to file/SQLite storage.<span style="color: #000099; font-weight: bold;">\n</span>&quot;);</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PS_USE_MYSQL = false;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; end;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; if (database) then</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; database:connect();</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; timer.Create(&quot;ps_SQLHeartBeat&quot;, 30, 0, function()</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (PS_USE_MYSQL) then</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; db:Query(&quot;SELECT 1 + 1&quot;);</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end);</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; end;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">end;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">function db:Query(query, Callback)</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; if (!query) then</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; end;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; if (!PS_USE_MYSQL or !self.obj) then</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MsgC(Color(255, 255, 0), &quot;[Light RP MySQL] Warning! A query is being made but no database!<span style="color: #000099; font-weight: bold;">\n</span>&quot;);</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; end;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; local query = self.obj:query(query);</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (Callback) then</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; function query:onSuccess(data)</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Callback(data);</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; function query:onError(message, sql)</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MsgC(Color(255, 0, 0), &quot;[Light RP] Query Error! &quot;..message..&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;);</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MsgC(Color(255, 0, 0), &quot;[Light RP] &quot;..sql..&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; query:start();</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">end;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">if (!PS_USE_MYSQL) then</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; MsgC(Color(255, 0, 0), &quot;[Light RP] Not using MySQL, switching to file/SQLite storage.<span style="color: #000099; font-weight: bold;">\n</span>&quot;);</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; return;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">else</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; require(&quot;mysqloo&quot;);</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; db:Connect();</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">end;</span></div></li>
</ol></div><!--/JS code --></div></blockquote><!--spoiler --><br /><br /><blockquote class="blockspoiler"><span class="titlespoiler"><a href='#' onclick="ShowAndHide('869a806784d188126659eec3498f47ca'); return false;">lightrp2.sql</a></span><div id='869a806784d188126659eec3498f47ca' style='display:none;' class="textspoiler"><!-- JS code --><div class="javascript" style="font: normal normal 90% monospace; color: #000066; border: 1px solid #d0d0d0; background-color: #f0f0f0;"><div style="font-family: sans-serif; color: #808080; font-size: 70%; font-weight: bold; background-color: #f0f0ff; border-bottom: 1px solid #d0d0d0; padding: 2px;">JavaScript code:</div><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">SET FOREIGN_KEY_CHECKS<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">CREATE TABLE `players` <span style="color: #009900;">&#40;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; `Key` tinyint<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">10</span><span style="color: #009900;">&#41;</span> unsigned zerofill NOT <span style="color: #003366; font-weight: bold;">NULL</span> AUTO_INCREMENT<span style="color: #339933;">,</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; `SteamID` varchar<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">64</span><span style="color: #009900;">&#41;</span> NOT <span style="color: #003366; font-weight: bold;">NULL</span><span style="color: #339933;">,</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339933;">--</span> &nbsp;`Karma` tinyint<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">4</span><span style="color: #009900;">&#41;</span> NOT <span style="color: #003366; font-weight: bold;">NULL</span><span style="color: #339933;">,</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; `Money` int<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">150</span><span style="color: #009900;">&#41;</span> NOT <span style="color: #003366; font-weight: bold;">NULL</span><span style="color: #339933;">,</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339933;">--</span> &nbsp;`Bank` int<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">150</span><span style="color: #009900;">&#41;</span> NOT <span style="color: #003366; font-weight: bold;">NULL</span><span style="color: #339933;">,</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; `Title` text NOT <span style="color: #003366; font-weight: bold;">NULL</span><span style="color: #339933;">,</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; `Particle` varchar<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">250</span><span style="color: #009900;">&#41;</span> NOT <span style="color: #003366; font-weight: bold;">NULL</span><span style="color: #339933;">,</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; `Color` varchar<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">50</span><span style="color: #009900;">&#41;</span> NOT <span style="color: #003366; font-weight: bold;">NULL</span><span style="color: #339933;">,</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339933;">--</span> &nbsp;`Hat` varchar<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">250</span><span style="color: #009900;">&#41;</span> NOT <span style="color: #003366; font-weight: bold;">NULL</span><span style="color: #339933;">,</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339933;">--</span> &nbsp;`Model` varchar<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">250</span><span style="color: #009900;">&#41;</span> NOT <span style="color: #003366; font-weight: bold;">NULL</span><span style="color: #339933;">,</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp; PRIMARY KEY <span style="color: #009900;">&#40;</span>`Key`<span style="color: #009900;">&#41;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&#41;</span> ENGINE<span style="color: #339933;">=</span>InnoDB AUTO_INCREMENT<span style="color: #339933;">=</span><span style="color: #CC0000;">2</span> <span style="color: #003366; font-weight: bold;">DEFAULT</span> CHARSET<span style="color: #339933;">=</span>latin1<span style="color: #339933;">;</span></div></li>
</ol></div><!--/JS code --></div></blockquote><!--spoiler -->]]></description>
      <link>https://gmod-fan.com/forum/problems/last/topic-1617.html</link>
      <pubDate>Mon, 18 Feb 2013 16:58:13 +0100</pubDate>
      <author>SmallNibbler</author>
      <guid isPermaLink="true"><![CDATA[https://gmod-fan.com/forum/problems/last/topic-1617.html]]></guid>
    </item>
    <item>
      <title>Помогите с системой сохранения денег</title>
      <description><![CDATA[Вот что написано в файле mysql в pistachio:<br />Make sure that you execute the .sql file included in gamemodes/pistachio Otherwise your gamemode will not use MySQL correctly.<br />Но как этот файл подключить я не знаю. Возможно он поможет, так как я перерыл весь гейммод и только эти 2 файла относятся к mysql.]]></description>
      <link>https://gmod-fan.com/forum/problems/last/topic-1617.html</link>
      <pubDate>Mon, 18 Feb 2013 16:10:47 +0100</pubDate>
      <author>SmallNibbler</author>
      <guid isPermaLink="true"><![CDATA[https://gmod-fan.com/forum/problems/last/topic-1617.html]]></guid>
    </item>
    <item>
      <title>Помогите с системой сохранения денег</title>
      <description><![CDATA[Ну да, если бы все было так просто, во первых у меня нет модуля, поэтому выдает ошибку, но это ладно. Как же тогда pistachio гейммод и DarkRP сохраняют данные без MySQL, локально конечно, на компе. И если играть в сингле то эти данные загружаются.]]></description>
      <link>https://gmod-fan.com/forum/problems/last/topic-1617.html</link>
      <pubDate>Mon, 18 Feb 2013 16:08:38 +0100</pubDate>
      <author>SmallNibbler</author>
      <guid isPermaLink="true"><![CDATA[https://gmod-fan.com/forum/problems/last/topic-1617.html]]></guid>
    </item>
    <item>
      <title>Помогите с системой сохранения денег</title>
      <description><![CDATA[Ох уж это RP<br />Попробуй : <!-- PHP code --><div class="php" style="font: normal normal 90% monospace; color: #000066; border: 1px solid #d0d0d0; background-color: #f0f0f0;"><div style="font-family: sans-serif; color: #808080; font-size: 70%; font-weight: bold; background-color: #f0f0ff; border-bottom: 1px solid #d0d0d0; padding: 2px;">php code:</div><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">PS_USE_MYSQL <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span></div></li>
</ol></div><!--/PHP code -->  заменить  на <!-- PHP code --><div class="php" style="font: normal normal 90% monospace; color: #000066; border: 1px solid #d0d0d0; background-color: #f0f0f0;"><div style="font-family: sans-serif; color: #808080; font-size: 70%; font-weight: bold; background-color: #f0f0ff; border-bottom: 1px solid #d0d0d0; padding: 2px;">php code:</div><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">PS_USE_MYSQL <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span></div></li>
</ol></div><!--/PHP code -->]]></description>
      <link>https://gmod-fan.com/forum/problems/last/topic-1617.html</link>
      <pubDate>Mon, 18 Feb 2013 15:58:19 +0100</pubDate>
      <author>Alexander.S.V.</author>
      <guid isPermaLink="true"><![CDATA[https://gmod-fan.com/forum/problems/last/topic-1617.html]]></guid>
    </item>
    <item>
      <title>Помогите с системой сохранения денег</title>
      <description><![CDATA[Для использования MySQL в Garry's Mod всегда требовался модуль. Думаю что для SQLite тоже нужен модуль.]]></description>
      <link>https://gmod-fan.com/forum/problems/last/topic-1617.html</link>
      <pubDate>Sun, 17 Feb 2013 20:16:15 +0100</pubDate>
      <author>EginKaman</author>
      <guid isPermaLink="true"><![CDATA[https://gmod-fan.com/forum/problems/last/topic-1617.html]]></guid>
    </item>
    <item>
      <title>Помогите с системой сохранения денег</title>
      <description><![CDATA[<div class="block_quote"><span class="block_titlequote">EginKaman (17.02.2013, 22:32) писал:</span><span class="block_textquote"><div class="block_quote"><span class="block_titlequote">SmallNibbler (17.02.2013, 22:09) писал:</span><span class="block_textquote">file/SQLite storage.</span></div><!--quote -->Это файловая база данных SQLite. Записывает всю информацию в файлах.</span></div><!--quote --><br />Спасибо за пояснение, но не мог бы ты рассказать что нужно ещё создать, что-бы она заработала?]]></description>
      <link>https://gmod-fan.com/forum/problems/last/topic-1617.html</link>
      <pubDate>Sun, 17 Feb 2013 20:01:17 +0100</pubDate>
      <author>SmallNibbler</author>
      <guid isPermaLink="true"><![CDATA[https://gmod-fan.com/forum/problems/last/topic-1617.html]]></guid>
    </item>
    <item>
      <title>Помогите с системой сохранения денег</title>
      <description><![CDATA[<div class="block_quote"><span class="block_titlequote">SmallNibbler (17.02.2013, 22:09) писал:</span><span class="block_textquote">file/SQLite storage.</span></div><!--quote -->Это файловая база данных SQLite. Записывает всю информацию в файлах.]]></description>
      <link>https://gmod-fan.com/forum/problems/last/topic-1617.html</link>
      <pubDate>Sun, 17 Feb 2013 19:32:33 +0100</pubDate>
      <author>EginKaman</author>
      <guid isPermaLink="true"><![CDATA[https://gmod-fan.com/forum/problems/last/topic-1617.html]]></guid>
    </item>
    <item>
      <title>Помогите с системой сохранения денег</title>
      <description><![CDATA[<div class="block_quote"><span class="block_titlequote">EginKaman (17.02.2013, 21:42) писал:</span><span class="block_textquote">Мне кажется или здесь ошибка?</span></div><!--quote --><br />Да там ошибка.<br />Вот что пишет:<br />[Light RP] Not using MySQL, switching to file/SQLite storage.<br /><br /><div class="block_quote"><span class="block_titlequote">EginKaman (17.02.2013, 21:42) писал:</span><span class="block_textquote">Здесь указываются параметры подключения к MySQL.</span></div><!--quote --><br />Да это понятно, но он может работать и без нее, и сохранять параметры.<br />Так как этот код я взял из другого гейммода, а он все сохранял и без MySQL базы.]]></description>
      <link>https://gmod-fan.com/forum/problems/last/topic-1617.html</link>
      <pubDate>Sun, 17 Feb 2013 19:09:03 +0100</pubDate>
      <author>SmallNibbler</author>
      <guid isPermaLink="true"><![CDATA[https://gmod-fan.com/forum/problems/last/topic-1617.html]]></guid>
    </item>
    <item>
      <title>Помогите с системой сохранения денег</title>
      <description><![CDATA[<div class="block_quote"><span class="block_titlequote">SmallNibbler (17.02.2013, 21:34) писал:</span><span class="block_textquote">QL base</span></div><!--quote -->Мне кажется или здесь ошибка?<br /><br /><div class="block_quote"><span class="block_titlequote">SmallNibbler (17.02.2013, 21:34) писал:</span><span class="block_textquote">local MYSQL_HOSTNAME = &quot;localhost&quot;;             -- The host of your database.<br />local MYSQL_USERNAME = &quot;root&quot;;                  -- Which user it will be logged in with.<br />local MYSQL_PASSWORD = &quot;password&quot;;              -- The password for the user.<br />local MYSQL_DATABASE = &quot;lightrp&quot;;               -- Which database contains the tables.<br />local MYSQL_PORT = 3306;                                -- The port for the database. Default is 3306.</span></div><!--quote --><br />Здесь указываются параметры подключения к MySQL.]]></description>
      <link>https://gmod-fan.com/forum/problems/last/topic-1617.html</link>
      <pubDate>Sun, 17 Feb 2013 18:42:31 +0100</pubDate>
      <author>EginKaman</author>
      <guid isPermaLink="true"><![CDATA[https://gmod-fan.com/forum/problems/last/topic-1617.html]]></guid>
    </item>
    <item>
      <title>Помогите с системой сохранения денег</title>
      <description><![CDATA[Вот моя mysql:<br /><blockquote class="blockspoiler"><span class="titlespoiler"><a href='#' onclick="ShowAndHide('14fe3791d8d564d31c3627af22616002'); return false;">Спойлер [+]</a></span><div id='14fe3791d8d564d31c3627af22616002' style='display:none;' class="textspoiler"><!-- JS code --><div class="javascript" style="font: normal normal 90% monospace; color: #000066; border: 1px solid #d0d0d0; background-color: #f0f0f0;"><div style="font-family: sans-serif; color: #808080; font-size: 70%; font-weight: bold; background-color: #f0f0ff; border-bottom: 1px solid #d0d0d0; padding: 2px;">JavaScript code:</div><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">PS_USE_MYSQL <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span> <span style="color: #339933;">--</span> <span style="color: #003366; font-weight: bold;">True</span><span style="color: #339933;">/</span><span style="color: #003366; font-weight: bold;">false</span> to set whether MySQL <span style="color: #000066; font-weight: bold;">is</span> used.</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #660066;">local</span> MYSQL_HOSTNAME <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;localhost&quot;</span><span style="color: #339933;">;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">--</span> The host of your database.</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #660066;">local</span> MYSQL_USERNAME <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;root&quot;</span><span style="color: #339933;">;</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">--</span> Which user it will be logged <span style="color: #000066; font-weight: bold;">in</span> <span style="color: #000066; font-weight: bold;">with</span>.</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #660066;">local</span> MYSQL_PASSWORD <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;password&quot;</span><span style="color: #339933;">;</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">--</span> The password <span style="color: #000066; font-weight: bold;">for</span> the user.</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #660066;">local</span> MYSQL_DATABASE <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;lightrp&quot;</span><span style="color: #339933;">;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">--</span> Which database contains the tables.</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #660066;">local</span> MYSQL_PORT <span style="color: #339933;">=</span> <span style="color: #CC0000;">3306</span><span style="color: #339933;">;</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">--</span> The port <span style="color: #000066; font-weight: bold;">for</span> the database. <span style="color: #003366; font-weight: bold;">Default</span> <span style="color: #000066; font-weight: bold;">is</span> <span style="color: #CC0000;">3306</span>.</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339933;">--</span> You shouldn<span style="color: #3366CC;">'t be changing anything below this line</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">-- unless you want to modify which module to use or something else.</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">db = db or {};</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">-- These are assumed tables that are assumed already made.</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">-- Used in the persist functions.</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">db.tables = {</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; money = {table = &quot;Money&quot;, data = &quot;number&quot;}</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">/*&nbsp; &nbsp; &nbsp; title = {table = &quot;Title&quot;, data = &quot;string&quot;},</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; karma = {table = &quot;Karma&quot;, data = &quot;number&quot;},</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; model = {table = &quot;Model&quot;, data = &quot;string&quot;},</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; hat = {table = &quot;Hat&quot;, data = &quot;string&quot;},</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; particle = {table = &quot;Particle&quot;, data = &quot;string&quot;},</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; color = {table = &quot;Color&quot;, data = &quot;string&quot;},</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; bank = {table = &quot;Bank&quot;, data = &quot;number&quot;}*/</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">};</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">function db:Connect()</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; if (self.obj) then</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print(&quot;[Light RP] MySQL connection already exists.&quot;);</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; end;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; print(&quot;[Light RP] Loading MySQL...&quot;);</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; local database = mysqloo.connect(MYSQL_HOSTNAME, MYSQL_USERNAME, MYSQL_PASSWORD, MYSQL_DATABASE, MYSQL_PORT);</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; function database:onConnected()</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; db.obj = self;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MsgC(Color(0, 255, 0), &quot;[Light RP] Connected to the database!<span style="color: #000099; font-weight: bold;">\n</span>&quot;);</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; end;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; function database:onConnectionFailed(message)</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MsgC(Color(255, 0, 0), &quot;[Light RP] Connection failed! &quot;..message..&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;);</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MsgC(Color(255, 0, 0), &quot;[Light RP] Reverting to file/SQLite storage.<span style="color: #000099; font-weight: bold;">\n</span>&quot;);</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PS_USE_MYSQL = false;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; end;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; if (database) then</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; database:connect();</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; timer.Create(&quot;ps_SQLHeartBeat&quot;, 30, 0, function()</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (PS_USE_MYSQL) then</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; db:Query(&quot;SELECT 1 + 1&quot;);</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end);</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; end;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">end;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">function db:Query(query, Callback)</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; if (!query) then</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; end;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; if (!PS_USE_MYSQL or !self.obj) then</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MsgC(Color(255, 255, 0), &quot;[Light RP MySQL] Warning! A query is being made but no database!<span style="color: #000099; font-weight: bold;">\n</span>&quot;);</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; end;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; local query = self.obj:query(query);</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (Callback) then</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; function query:onSuccess(data)</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Callback(data);</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; function query:onError(message, sql)</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MsgC(Color(255, 0, 0), &quot;[Light RP] Query Error! &quot;..message..&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;);</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MsgC(Color(255, 0, 0), &quot;[Light RP] &quot;..sql..&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; query:start();</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">end;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">if (!PS_USE_MYSQL) then</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; MsgC(Color(255, 0, 0), &quot;[Light RP] Not using MySQL, switching to file/SQLite storage.<span style="color: #000099; font-weight: bold;">\n</span>&quot;);</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; return;</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">else</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; require(&quot;mysqloo&quot;);</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; db:Connect();</span></div></li>
<li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 12px/15px monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">end;</span></div></li>
</ol></div><!--/JS code --></div></blockquote><!--spoiler --><br /><br />Но она не сохраняет деньги все равно, видимо нужно что-то ещё. Она пишет что так как она отключена, она переходит на QL base кажется так, как-то.]]></description>
      <link>https://gmod-fan.com/forum/problems/last/topic-1617.html</link>
      <pubDate>Sun, 17 Feb 2013 18:34:45 +0100</pubDate>
      <author>SmallNibbler</author>
      <guid isPermaLink="true"><![CDATA[https://gmod-fan.com/forum/problems/last/topic-1617.html]]></guid>
    </item>
    <item>
      <title>Помогите с системой сохранения денег</title>
      <description><![CDATA[Насколько я понял это MySQL Database? Или нет? Если да, то можно ли обойтись без нее?]]></description>
      <link>https://gmod-fan.com/forum/problems/last/topic-1617.html</link>
      <pubDate>Sun, 17 Feb 2013 18:18:36 +0100</pubDate>
      <author>SmallNibbler</author>
      <guid isPermaLink="true"><![CDATA[https://gmod-fan.com/forum/problems/last/topic-1617.html]]></guid>
    </item>
    <item>
      <title>Помогите с системой сохранения денег</title>
      <description><![CDATA[В общем то после перезапуска сервера деньги не сохраняются, в DarkRP такой проблемы нет Но я не знаю где находится эта функция в DarkRP. Может поможете с этим? Расскажите пожалуйста как вообщем провести процесс сохранения денег каждого игрока. Или может есть у кого-то код.]]></description>
      <link>https://gmod-fan.com/forum/problems/last/topic-1617.html</link>
      <pubDate>Sun, 17 Feb 2013 18:03:28 +0100</pubDate>
      <author>SmallNibbler</author>
      <guid isPermaLink="true"><![CDATA[https://gmod-fan.com/forum/problems/last/topic-1617.html]]></guid>
    </item>
  </channel></rss>