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\');
ezt phpmyadminba lefuttatod ..
Nos a következő ERROR állt elő amiről fogalmam sincs hogy lehetne javítani...

(Mint már írtam sajnos a MYSQLhez nem igazán értek...)
Itt lenne az a pár sor:
local result = mysql:query_free(\"UPDATE interiors SET supplies= supplies + \" .. mysql:escape_string(amount) .. \" where id=\'\" .. mysql:escape_string(dbid) .. \"\'\")
if result then
if 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 )
end
triggerClientEvent( source, event or \"finishItemMove\", source )
return
end
return false
end
addEventHandler(\"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...
end
addEventHandler(\"onResourceStart\", getResourceRootElement(), resStart)
Erre mi a megoldás?
Dupla üzenet összevonva ekkor: [time]2014. június 23. - 21:58:25[/time]
És ennél mi a probléma?
Mi nem jó?
A hibakód:

maga a script:
function createCharacter(name, gender, skincolour, weight, height, fatness, muscles, transport, description, age, skin, language)
source = client
local 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 = nil
if (mysql:num_rows(result)>0) then -- Name is already taken
triggerEvent(\"onPlayerCreateCharacter\", source, charname, gender, skincolour, weight, height, fatness, muscles, transport, description, age, skin, language, false)
if (hasBeta[client]) then
triggerClientEvent(client, \"charCreateFail\", client)
end
return
else
-- /////////////////////////////////////
-- 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\"
end
local 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)
end
else
triggerEvent(\"onPlayerCreateCharacter\", source, charname, gender, skincolour, weight, height, fatness, muscles, transport, description, age, skin, language, false)
end
end
exports.logs:logMessage(\"[CREATE CHARACTER] #\" .. accountID .. \"-\" .. accountUsername .. \" has created a character by the name \" .. charname:gsub(\"_\",\" \") .. \"-#\" .. npid, 31)
sendAccounts(source, accountID)
mysql:free_result(result)
end
addEvent(\"onPlayerCreateCharacter\", false)
addEvent(\"createCharacter\", true)
addEventHandler(\"createCharacter\", getRootElement(), createCharacter)
Azt már sikerült megoldanom:) DE!
Egy újabb hiba amire nemtudom mi a megoldás.
Megnéztem MYSQL táblákat minden stimmel mindegyik megvan.
Mi a gond?
ERROR:

És itt a script:
-- ////////////////////////////////////
-- // 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)) then
handler = mysql_connect(sqlHost, sqlUsername, sqlPassword, sqlDB, sqlPort)
end
end
-- setTimer(checkMySQL, 300000, 0)
function closeMySQL()
if (handler) then
mysql_close(handler)
handler = nil
end
end
addEventHandler(\"onResourceStop\", getResourceRootElement(getThisResource()), closeMySQL)
-- ////////////////////////////////////
-- // MYSQL END //
-- ////////////////////////////////////
function loadWorldItems(res)
local ticks = getTickCount( )
checkMySQL()
-- delete items too old
exports.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 items
local 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-t
local 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)
end
else
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)
end
end
end
mysql_free_result(result)
closeMySQL()
outputDebugString(\"Loaded all world items in \" .. ( getTickCount( ) - ticks ) .. \"ms\")
end
addEventHandler(\"onResourceStart\", getResourceRootElement(), loadWorldItems)
módosítottam már a scriptet így is hogy a for feletti sorba ezt írtam:
if (result) then
De így sem jó mi lehet a gond???
Dupla üzenet összevonva ekkor: [time]2014. június 25. - 18:21:46[/time]
Nos SIKERÜLT Megoldanom a problémákat de most ezeket az ERRORokat kaptam:
Mi lehet a gond?

Dupla üzenet összevonva ekkor: 2014. június 25. - 19:22:46
Az a gond hogy ezzel a escape_stringel mindig baja van majdnem minden egyes scriptnél, mi lehet a gond?