Ir para conteúdo

Featured Replies

Postado

Oie,enfim...meu servidor de war está com um problema,toda vez que um knight loga pela primeira vez,dá debug...e isso é bem chato,acaba perdendo players...

O meu startskills era assim :

  Citar
function onLogin(cid)

local playerVoc = getPlayerVocation(cid)

local reqTries = getPlayerRequiredSkillTries

local skillStor = 56364

local gotSkills = getPlayerStorageValue(cid, 56364)

if playerVoc == 1 and gotSkills == -1 then

doPlayerAddSpentMana(cid, (getPlayerRequiredMana(cid,65)))

setPlayerStorageValue(cid, skillStor, 1)

elseif playerVoc == 2 and gotSkills == -1 then

doPlayerAddSpentMana(cid, (getPlayerRequiredMana(cid,65)))

setPlayerStorageValue(cid, skillStor, 1)

elseif playerVoc == 3 and gotSkills == -1 then

doPlayerAddSkillTry(cid, SKILL_DISTANCE, reqTries(cid, SKILL_DISTANCE, 70))

doPlayerAddSkillTry(cid, SKILL_SHIELD, reqTries(cid, SKILL_SHIELD, 60))

doPlayerAddSpentMana(cid, (getPlayerRequiredMana(cid,10)))

setPlayerStorageValue(cid, skillStor, 1)

elseif playerVoc == 4 and gotSkills == -1 then

doPlayerAddSkillTry(cid, SKILL_AXE, reqTries(cid, SKILL_AXE, 70))

doPlayerAddSkillTry(cid, SKILL_SWORD, reqTries(cid, SKILL_SWORD, 70))

doPlayerAddSkillTry(cid, SKILL_CLUB, reqTries(cid, SKILL_CLUB, 70))

doPlayerAddSkillTry(cid, SKILL_SHIELD, reqTries(cid, SKILL_SHIELD, 65))

doPlayerAddMagLevel(cid, 8)

setPlayerStorageValue(cid, skillStor, 1)

end

return TRUE

end

Esse aí,dá debug no knight na primeira vez...

Troquei o script,pra esse =

  Citar
function onLogin(cid)

local playerVoc = getPlayerVocation(cid)

local skillStor = 2848635

local gotSkills = getPlayerStorageValue(cid, 2848635)

if playerVoc == 1 and gotSkills == -1 then

doPlayerAddSpentMana(cid, (getPlayerRequiredMana(cid,65)))

setPlayerStorageValue(cid, skillStor, 1)

elseif playerVoc == 2 and gotSkills == -1 then

doPlayerAddSpentMana(cid, (getPlayerRequiredMana(cid,65)))

setPlayerStorageValue(cid, skillStor, 1)

elseif playerVoc == 3 and gotSkills == -1 then

doPlayerSetSkill(cid, SKILL_DISTANCE, 70)

doPlayerSetSkill(cid, SKILL_SHIELDING, 60)

doPlayerAddSpentMana(cid, (getPlayerRequiredMana(cid,10)))

setPlayerStorageValue(cid, skillStor, 1)

elseif playerVoc == 4 and gotSkills == -1 then

doPlayerSetSkill(cid, SKILL_SWORD, 70)

doPlayerSetSkill(cid, SKILL_SHIELDING, 65)

doPlayerSetSkill(cid, SKILL_AXE, 70)

doPlayerSetSkill(cid, SKILL_CLUB, 70)

doPlayerSetMagic(cid, 8)

setPlayerStorageValue(cid, skillStor, 1)

end

return TRUE

end

Adicionei nas libs :

  Citar
function doPlayerSetSkill(cid, skill, amount)

local pid = getPlayerGUID(cid)

doRemoveCreature(cid,true)

db.executeQuery("UPDATE `player_skills` SET `value` = ".. amount .." WHERE `player_id` = ".. pid .. " and `skillid` = ".. skill ..";")

return true

end

function doPlayerSetMagic(cid, amount)

local pid = getPlayerGUID(cid)

doRemoveCreature(cid,true)

db.executeQuery("UPDATE `players` SET `maglevel` = " .. amount .. " WHERE `id` = "..pid)

return TRUE

end

Ok...tudo certo até ai,mais quando loga algum char...e ainda dá esse erro no distro :

[

07/07/2012 20:59:41] [Error - CreatureScript Interface]

[07/07/2012 20:59:41] data/creaturescripts/scripts/startskills.lua:onLogin

[07/07/2012 20:59:41] Description:

[07/07/2012 20:59:41] data/lib/050-function.lua:658: attempt to concatenate local 'skill' (a nil value)

[07/07/2012 20:59:41] stack traceback:

[07/07/2012 20:59:41] data/lib/050-function.lua:658: in function 'doPlayerSetSkill'

[07/07/2012 20:59:41] data/creaturescripts/scripts/startskills.lua:14: in function <data/creaturescripts/scripts/startskills.lua:1>

Oque pode ser?

  • Respostas 6
  • Visualizações 1k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Em algum lugar ai o Skill é nulo troque o seu por este function onLogin(cid) local playerVoc = getPlayerVocation(cid) local reqTries = getPlayerRequiredSkillTries local skillStor =

Postado

Em algum lugar ai o Skill é nulo

troque o seu por este



function onLogin(cid)

local playerVoc = getPlayerVocation(cid)

local reqTries = getPlayerRequiredSkillTries

local skillStor = 56364

local gotSkills = getPlayerStorageValue(cid, 56364)



if playerVoc == 1 and gotSkills == -1 then

doPlayerAddSpentMana(cid, (getPlayerRequiredMana(cid,65)))

setPlayerStorageValue(cid, skillStor, 1)


elseif playerVoc == 2 and gotSkills == -1 then

doPlayerAddSpentMana(cid, (getPlayerRequiredMana(cid,65)))

setPlayerStorageValue(cid, skillStor, 1)


elseif playerVoc == 3 and gotSkills == -1 then

doPlayerAddSkillTry(cid, SKILL_DISTANCE, reqTries(cid, SKILL_DISTANCE, 70))

doPlayerAddSkillTry(cid, SKILL_SHIELD, reqTries(cid, SKILL_SHIELD, 60))

doPlayerAddSpentMana(cid, (getPlayerRequiredMana(cid,10)))

setPlayerStorageValue(cid, skillStor, 1)


elseif playerVoc == 4 and gotSkills == -1 then

local sks = {axe = SKILL_AXE, sword = SKILL_SWORD, club = SKILL_CLUB, shield = SKILL_SHIELD}

for i, v in pairs (sks) do

if not (v) then

print("\n\n--------------------------------------------\n## REPORTANDO; ".. i .. " é nulo!\n--------------------------------------------\n\n")

end

end

doPlayerAddSkillTry(cid, SKILL_AXE, reqTries(cid, SKILL_AXE, 70))

doPlayerAddSkillTry(cid, SKILL_SWORD, reqTries(cid, SKILL_SWORD, 70))

doPlayerAddSkillTry(cid, SKILL_CLUB, reqTries(cid, SKILL_CLUB, 70))

doPlayerAddSkillTry(cid, SKILL_SHIELD, reqTries(cid, SKILL_SHIELD, 65))

doPlayerAddMagLevel(cid, 8)

setPlayerStorageValue(cid, skillStor, 1)


end

return TRUE

end


e por favor poste aqui o que vai ser impresso no seu console!

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo