Ninkobi
Owner /Founder of Syphera
I need help with my script to give levels and ml using a query when they login. Heres my script and it crashs my server (no error)
It is supposed to run a query when your storage value 77100 = 1 and your vocation is X then it will set your storage value to -1 when its done.
It doesn't give ANY ERROR when I reload it or start server. I am using TFS 0.2 Patch 14 (8.22) AKA the latest patch with 8.22
Code:
dofile("./config.lua")
function onLogin(cid)
if sqlType == "mysql" then
env = assert(luasql.mysql())
con = assert(env:connect(mysqlDatabase, mysqlUser, mysqlPass, mysqlHost, mysqlPort))
else -- sqlite
env = assert(luasql.sqlite3())
con = assert(env:connect(sqliteDatabase))
end
local target = getPlayerName (cid)
assert(con:execute("UPDATE players SET level = 100, experience = 15694800, health = 645, healthmax = 645, maglevel = 75, manaspent = 0, mana = 2795,manamax = 2795, cap = 1390 WHERE name = "..target..";"))
doCreatureSay(cid, "Your character has been upgraded to level 100. Thanks for donating!", TALKTYPE_ORANGE_1)
registerCreatureEvent(cid, "PlayerDeath")
return TRUE
end
end
end
It doesn't give ANY ERROR when I reload it or start server. I am using TFS 0.2 Patch 14 (8.22) AKA the latest patch with 8.22