I
Icy
Guest
LUA:
function onAdvance(cid, skill, oldLevel, newLevel)
if skill == SKILL__LEVEL then
doSendMagicEffect(getCreaturePosition(cid), 45)
db.executeQuery("UPDATE players SET skill_points = skill_points + 1 WHERE name = "..getPlayerName(cid)..";")
end
return true
end
Any idea why my script is not working? It calls everything correctly, I put the magic effect in for debugging purposes, so I know that the script executes for sure...
However, the database query seems to not be working. If I change it to
Code:
db.executeQuery("UPDATE players SET skill_points = skill_points + 1 WHERE online = 1")
EDIT: Fixed code for any individual who feels like using or modifying my script for their own needs:
LUA:
function onAdvance(cid, skill, oldLevel, newLevel)
if skill == SKILL__LEVEL then
db.executeQuery("UPDATE players SET skill_points = skill_points + 1 WHERE id = "..getPlayerGUID(cid)..";")
end
return true
end
Last edited by a moderator: