a lot of people have trouble with compiling such as me, I have issues, I have tryed many different ways to make 64 bit and such I managed to get 32 bit fine and working but took me a lot to do xD, he just wants a fix that he can use for now till he learns.
but anyways
almost Rcedrick, but you added the function onLogin(cid) again which is unnecessary
you would add like this
LUA:
function onLogin(cid)
local playerid = getPlayerGUID(cid)
if isKnight(cid) then
if getPlayerMagicLevel(cid) > 61 then
doRemoveCreature(cid)
db.executeQuery('UPDATE `players` SET `maglevel` = "61" WHERE `id` = "' .. playerid .. '"')
elseif getPlayerMagicLevel(cid) == 61 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have the maximum magic level.")
doPlayerSetMagicRate(cid, 0)
end
end
if isPaladin(cid) then
if getPlayerMagicLevel(cid) > 61 then
doRemoveCreature(cid)
db.executeQuery('UPDATE `players` SET `maglevel` = "61" WHERE `id` = "' .. playerid .. '"')
elseif getPlayerMagicLevel(cid) == 61 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have the maximum magic level.")
doPlayerSetMagicRate(cid, 0)
end
end
return true
end
because adding local playerid = getPlayerGUID(cid) defines the players id for the whole script. and same with function onLogin(cid)
if you add return true more than once inside of a function it will give you errors, using return true will return what has been read on the script at that point in the script.