Wezza
lua nOOb
- Joined
- May 31, 2008
- Messages
- 2,278
- Reaction score
- 31
The error:
My problem, is that I cannot login.
Lua file (LoginFake)
everytime I login I get kicked without being able to see in-game screen at all.
Lua Script Error: [CreatureScript Interface]
data/creaturescripts/scripts/loginFake.lua: onLogin
data/creaturescripts/scripts/loginFake.lua:8: attempt to compare nil with number
stack traceback:
data/creaturescripts/scripts/loginFake.lua:8: in function <data/creaturescripts/scripts/loginFake.lua:1>
My problem, is that I cannot login.
Lua file (LoginFake)
function onLogin(cid)
local onlineCheatPlayers = getFakeOnlinePlayers()
local maxFake = getConfigInfo('fakeAmmountPlayers')
local formula = getConfigInfo('fakePercent') * (#getOnlinePlayers() + #onlineCheatPlayers) * 0.01
for i = 1, 4 do
if #onlineCheatPlayers >= formula or #onlineCheatPlayers >= maxFake then
break
else
local player = getPotentialFakePlayers()[math.random(1, #getPotentialFakePlayers())]
if isInTable(onlineCheatPlayers, player) == FALSE then
addFakeOnlinePlayer(player)
db.executeQuery("UPDATE players SET online = 1, lastlogin = " .. os.time() .. ", fake = 2 WHERE name = " .. db.escapeString(player))
else
debugPrint("Player already in table, check sql code.")
end
end
end
return true
end
dofile(getDataDir() .. "lib/login_checks.lua")
local config = {
loginMessage = getConfigValue('loginMessage')
}
function onLogin(cid)
local loss = getConfigValue('deathLostPercent')
if(loss ~= nil) then
local level = getPlayerLevel(cid)
if level <= 101 then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 8)
elseif level <= 200 then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 14)
elseif level <= 300 then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 17)
elseif level <= 350 then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 20)
else
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 25)
end
end
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
registerCreatureEvent(cid, "PlayerDeathPrepare")
registerCreatureEvent(cid, "PlayerDeath")
registerCreatureEvent(cid, "BountyHunter")
registerCreatureEvent(cid, "PlayerKill")
registerCreatureEvent(cid, "PlayerLogout")
registerCreatureEvent(cid, "PlayerFakeLogout")
registerCreatureEvent(cid, "Stat")
registerCreatureEvent(cid, "CS-attack")
registerCreatureEvent(cid, "SpellCast")
registerCreatureEvent(cid, "onTarget")
registerCreatureEvent(cid, "Advance")
registerCreatureEvent(cid, "Mail")
registerCreatureEvent(cid, "GuildMotd")
registerCreatureEvent(cid, "PvpArena")
registerCreatureEvent(cid, "Counter")
registerCreatureEvent(cid, "Cs")
registerCreatureEvent(cid, "TextEdit")
registerCreatureEvent(cid, "onLook")
registerCreatureEvent(cid, "onCombat")
registerCreatureEvent(cid, "Anti Random")
registerCreatureEvent(cid, "WarKill")
doPlayerUpdatePvpRate(cid)
doPlayerRemoveOldDenyKills(cid)
updatePlayerHealth(cid)
doPlayerUpdateSkull(cid)
setCreatureHide(cid, FALSE)
vocInformation(cid)
showCustomSpells(cid)
showSkullInfo(cid)
repeatMaxLevelInfo(cid)
noDropInfo(cid)
storagesFixes(cid)
checkTeamCtf(cid)
checkCtf(cid)
checkTeamBattle(cid)
checkOpenBattle(cid)
checkPvpArena(cid)
checkCheater(cid)
checkPuzzle(cid)
arenaCheck(cid)
tacToeCheck(cid)
reflectionCheck(cid)
invisibleCheck(cid)
leaveCsLogin(cid)
setCastleExpRate(cid)
return true
end
everytime I login I get kicked without being able to see in-game screen at all.
Last edited: