local motdresult = mysql:query_fetch_assoc(\"SELECT value FROM settings WHERE name=\'motd\' LIMIT 1\")exports[\'anticheat-system\']:changeProtectedElementDataEx(getRootElement(), \"account:motd\", motdresult[\"value\" ], false )
CREATE TABLE IF NOT EXISTS `settings` ( `value` mediumtext, `name` mediumtext) ENGINE=MyISAM DEFAULT CHARSET=latin1;---- Dumping data for table `settings`--INSERT INTO `settings` (`value`, `name`) VALUES(\'SR 1.2b is out!.Change vehicle colours from RGB.Improved lights and many bug fixes!.\', \'motd\'),(\'10\', \'tax\'),(\'5\', \'incometax\'),(\'For newbie/gooc unmute fine players 5000$ . /fine is cmd\', \'amotd\'),(\'95400\', \'lotteryjackpot\'),(\'Admins can set welcome message by /setmsg and for admin wel msg use /setamsg command\', \'adminmotd\'),(\'2\', \'count\');
if donator > 0 then
if tonumber(donator) > 0 then
if (tonumber(donator) > 0) then
local result = mysql:query_free(\"UPDATE interiors SET supplies= supplies + \" .. mysql:escape_string(amount) .. \" where id=\'\" .. mysql:escape_string(dbid) .. \"\'\")if result thenif slot == -1 and worldItem and id and isElement(worldItem) then outputChatBox(\"You\'ve added \".. amount ..\" supplies to this business.\", source, 0, 240, 0) mysql:query_free(\"DELETE FROM worlditems WHERE id=\'\" .. id .. \"\'\") destroyElement(worldItem)else outputChatBox(\"You\'ve added \".. amount ..\" supplies to this business.\", source, 0, 240, 0) exports[\'item-system\']:takeItemFromSlot( source, slot )endtriggerClientEvent( source, event or \"finishItemMove\", source )returnendreturn falseendaddEventHandler(\"shop:handleSupplies\", getRootElement(), handleSupplies)function resStart()local result = mysql:query_fetch_assoc(\"SELECT value FROM settings WHERE name=\'globalsupplies\' LIMIT 1\")globalSupplies = tonumber(result[\"value\"]) --ez az 520. sor, nem értem mi lehet a gond...endaddEventHandler(\"onResourceStart\", getResourceRootElement(), resStart)
function createCharacter(name, gender, skincolour, weight, height, fatness, muscles, transport, description, age, skin, language)source = clientlocal charname = string.gsub(tostring(name), \" \", \"_\")local safecharname = mysql:escape_string(charname)description = string.gsub(tostring(description), \"\'\", \"\")local result = mysql:query(\"SELECT charactername FROM characters WHERE charactername=\'\" .. safecharname .. \"\'\")local accountID = getElementData(source, \"gameaccountid\")local accountUsername = getElementData(source, \"gameaccountusername\")local npid = nilif (mysql:num_rows(result)>0) then -- Name is already takentriggerEvent(\"onPlayerCreateCharacter\", source, charname, gender, skincolour, weight, height, fatness, muscles, transport, description, age, skin, language, false)if (hasBeta[client]) then triggerClientEvent(client, \"charCreateFail\", client)endreturnelse-- /////////////////////////////////////-- TRANSPORT-- /////////////////////////////////////local x, y, z, r, lastarea = 0, 0, 0, 0, \"Unknown\"if (transport==1) then x, y, z = 1742.1884765625, -1861.3564453125, 13.577615737915 r = 0.98605346679688 lastarea = \"Unity Bus Station\"else x, y, z = 1685.583984375, -2329.4443359375, 13.546875 r = 0.79379272460938 lastarea = \"Los Santos International\"endlocal salt = \"fingerprintscotland\"local fingerprint = md5(salt .. safecharname)local id = mysql:query_insert_free(\"INSERT INTO characters SET charactername=\'\" .. safecharname .. \"\', x=\'\" .. mysql:escape_string(x) .. \"\', y=\'\" .. mysql:escape_string(y) .. \"\', z=\'\" .. mysql:escape_string(z) .. \"\', rotation=\'\" .. mysql:escape_string(r) .. \"\', faction_id=\'-1\', transport=\'\" .. mysql:escape_string(transport) .. \"\', gender=\'\" .. mysql:escape_string(gender) .. \"\', skincolor=\'\" .. mysql:escape_string(skincolour) .. \"\', weight=\'\" .. mysql:escape_string(weight) .. \"\', height=\'\" .. mysql:escape_string(height) .. \"\', muscles=\'\" .. mysql:escape_string(muscles) .. \"\', fat=\'\" .. mysql:escape_string(fatness) .. \"\', description=\'\" .. mysql:escape_string(description) .. \"\', account=\'\" .. mysql:escape_string(accountID) .. \"\', skin=\'\" .. mysql:escape_string(skin) .. \"\', lastarea=\'\" .. mysql:escape_string(lastarea) .. \"\', age=\'\" .. mysql:escape_string(age) .. \"\', fingerprint=\'\" .. mysql:escape_string(fingerprint) .. \"\', lang1=\" .. mysql:escape_string(language) .. \", lang1skill=100, currLang=1\" )if (id) then exports[\'anticheat-system\']:changeProtectedElementDataEx(source, \"dbid\", id, false) exports.global:giveItem( source, 16, skin ) exports.global:giveItem( source, 17, 1 ) exports.global:giveItem( source, 18, 1 ) exports[\'anticheat-system\']:changeProtectedElementDataEx(source, \"dbid\") -- CELL PHONE local cellnumber = id+15000 local update = mysql:query_free(\"UPDATE characters SET cellnumber=\'\" .. mysql:escape_string(cellnumber) .. \"\' WHERE charactername=\'\" .. safecharname .. \"\'\") if (update) then triggerEvent(\"onPlayerCreateCharacter\", source, charname, gender, skincolour, weight, height, fatness, muscles, transport, description, age, skin, language, true) else outputChatBox(\"Error 100003 - Report on forums.\", source, 255, 0, 0) end npid = tonumber(id) ---ez a 1257. sor ahová írja a hibát, de nem tudom mi a gond vele... if (hasBeta[client]) then triggerClientEvent(client, \"charCreateSuccess\", client, npid) endelse triggerEvent(\"onPlayerCreateCharacter\", source, charname, gender, skincolour, weight, height, fatness, muscles, transport, description, age, skin, language, false)endendexports.logs:logMessage(\"[CREATE CHARACTER] #\" .. accountID .. \"-\" .. accountUsername .. \" has created a character by the name \" .. charname:gsub(\"_\",\" \") .. \"-#\" .. npid, 31)sendAccounts(source, accountID)mysql:free_result(result)endaddEvent(\"onPlayerCreateCharacter\", false)addEvent(\"createCharacter\", true)addEventHandler(\"createCharacter\", getRootElement(), createCharacter)
-- ////////////////////////////////////-- // MYSQL //-- ////////////////////////////////////sqlUsername = exports.mysql:getMySQLUsername()sqlPassword = exports.mysql:getMySQLPassword()sqlDB = exports.mysql:getMySQLDBName()sqlHost = exports.mysql:getMySQLHost()sqlPort = exports.mysql:getMySQLPort()handler = mysql_connect(sqlHost, sqlUsername, sqlPassword, sqlDB, sqlPort)function checkMySQL()if not (mysql_ping(handler)) thenhandler = mysql_connect(sqlHost, sqlUsername, sqlPassword, sqlDB, sqlPort)endend-- setTimer(checkMySQL, 300000, 0)function closeMySQL()if (handler) thenmysql_close(handler)handler = nilendendaddEventHandler(\"onResourceStop\", getResourceRootElement(getThisResource()), closeMySQL)-- ////////////////////////////////////-- // MYSQL END //-- //////////////////////////////////// function loadWorldItems(res)local ticks = getTickCount( )checkMySQL()-- delete items too oldexports.mysql:query_free(\"DELETE FROM `worlditems` WHERE DATEDIFF(NOW(), creationdate) > 14 AND `itemID` != 80 AND `itemID` != 81 AND `itemID` != 103 AND protected = 0\" )-- actually load itemslocal result = mysql_query(handler, \"SELECT id, itemid, itemvalue, x, y, z, dimension, interior, rz, creator, protected FROM worlditems\")for result, row in mysql_rows(result) do ------------erre a sorra írja az ERROR-tlocal id = tonumber(row[1])local itemID = tonumber(row[2])local itemValue = tonumber(row[3]) or row[3]local x = tonumber(row[4])local y = tonumber(row[5])local z = tonumber(row[6])local dimension = tonumber(row[7])local interior = tonumber(row[8])local rz2 = tonumber(row[9])local creator = tonumber(row[10])local protected = tonumber(row[11])if itemID < 0 then -- weapon itemID = -itemID local modelid = 2969 -- MODEL ID if itemValue == 100 then modelid = 1242 elseif itemValue == 42 then modelid = 2690 else modelid = weaponmodels[itemID] end local obj = createItem(id, -itemID, itemValue, modelid, x, y, z - 0.1, 75, -10, rz2) exports.pool:allocateElement(obj) setElementDimension(obj, dimension) setElementInterior(obj, interior) exports[\'anticheat-system\']:changeProtectedElementDataEx(obj, \"creator\", creator, false) if protected and protected ~= 0 then exports[\'anticheat-system\']:changeProtectedElementDataEx(obj, \"protected\", protected, false) endelse local modelid = exports[\'item-system\']:getItemModel(itemID, itemValue) local rx, ry, rz, zoffset = exports[\'item-system\']:getItemRotInfo(itemID) local obj = createItem(id, itemID, itemValue, modelid, x, y, z + ( zoffset or 0 ), rx, ry, rz+rz2) exports.pool:allocateElement(obj) setElementDimension(obj, dimension) setElementInterior(obj, interior) exports[\'anticheat-system\']:changeProtectedElementDataEx(obj, \"creator\", creator, false) if protected and protected ~= 0 then exports[\'anticheat-system\']:changeProtectedElementDataEx(obj, \"protected\", protected, false) endendendmysql_free_result(result)closeMySQL()outputDebugString(\"Loaded all world items in \" .. ( getTickCount( ) - ticks ) .. \"ms\")endaddEventHandler(\"onResourceStart\", getResourceRootElement(), loadWorldItems)
if (result) then