Ir para conteúdo
  • Cadastre-se

Ajuda erro condicionais vocação


Posts Recomendados

Entao achei um script de stages de skill, to tentando modificar ele, mas ta dando erro, ele funciona perfeitamente, o erro ta na minha modificação:

 


if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 5 or getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 6 then
    skillStages[sKILL__MAGLEVEL] = {{0,15},{10,8},{20,5},{60,3}}
else if getPlayerVocation(cid) == 8 or getPlayerVocation(cid) == 4 then
    skillStages[sKILL__MAGLEVEL] = {{0,4},{4,3}}
else if getPlayerVocation(cid) == 3 or getPlayerVocation(cid) == 7 then
    skillStages[sKILL__MAGLEVEL] = {{0,4},{4,3}}
end
end
end

else
    skillStages[sKILL__MAGLEVEL] = {{0,4}}
end

 

O que eu fiz de errado? Script


 skillConfig = {skill = getConfigValue('rateSkill'), magiclevel = getConfigValue('rateMagic')}
skillStages = {}
skillStages[sKILL_FIST] = {{0,20},{40,15},{60,10},{80,9}}
skillStages[sKILL_CLUB] = {{0,20},{40,15},{60,10},{80,9}}
skillStages[sKILL_SWORD] = {{0,20},{40,15},{60,10},{80,9}}
skillStages[sKILL_AXE] = {{0,20},{40,15},{60,10},{80,9}}
skillStages[sKILL_DISTANCE] = {{0,20},{40,15},{60,10},{80,9}}
skillStages[sKILL_SHIELD] = {{0,20},{40,15},{60,10},{80,9}}
--skillStages[sKILL_FISHING] = {{0,5},{60,4},{80,3},{100,2},{110,1}} -- uncomment it to make it work, you can remove other skill config if you dont need it
--skillStages[sKILL__MAGLEVEL] = {{0,8},{4,6},{8,5},{60,3}}
if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 5 or getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 6 then
    skillStages[sKILL__MAGLEVEL] = {{0,15},{10,8},{20,5},{60,3}}
else if getPlayerVocation(cid) == 8 or getPlayerVocation(cid) == 4 then
    skillStages[sKILL__MAGLEVEL] = {{0,4},{4,3}}
else if getPlayerVocation(cid) == 3 or getPlayerVocation(cid) == 7 then
    skillStages[sKILL__MAGLEVEL] = {{0,4},{4,3}}
end
end
end

else
    skillStages[sKILL__MAGLEVEL] = {{0,4}}
end

showInfoOnAdvance = true -- send player message about skill rate change
showInfoOnLogin = true -- send player message about skill rates when he login
 
function getPlayerSkillRatesText(cid)
 local skillInfo = getPlayerRates(cid)
 return "YOUR SKILLS STAGES: [ Magic Level: " .. skillInfo[sKILL__MAGLEVEL] * skillConfig.magiclevel .. "x || Fist: " .. skillInfo[sKILL_FIST] * skillConfig.skill .. "x | Club: " .. skillInfo[sKILL_CLUB] * skillConfig.skill .. "x |  Sword: " .. skillInfo[sKILL_SWORD] * skillConfig.skill .. "x | Axe: " .. skillInfo[sKILL_AXE] * skillConfig.skill .. "x |  Distance: " .. skillInfo[sKILL_DISTANCE] * skillConfig.skill .. " | Shielding: " .. skillInfo[sKILL_SHIELD] * skillConfig.skill .. "x | Fishing: " .. skillInfo[sKILL_FISHING] * skillConfig.skill .. "x ]"
end

 

Erro:

WQay0Ib.png

Link para o post
Compartilhar em outros sites
  • 4 years later...
Em 19/06/2014 em 15:52, gmstrikker disse:

 

 

Citar
 

if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 5 or getPlayerVocation(cid) == 2 or getPlayerVocation(cid) == 6 then
    skillStages[sKILL__MAGLEVEL] = {{0,15},{10,8},{20,5},{60,3}}
else if getPlayerVocation(cid) == 8 or getPlayerVocation(cid) == 4 then
    skillStages[sKILL__MAGLEVEL] = {{0,4},{4,3}}
else if getPlayerVocation(cid) == 3 or getPlayerVocation(cid) == 7 then
    skillStages[sKILL__MAGLEVEL] = {{0,4},{4,3}}
end
end
end

else
    skillStages[sKILL__MAGLEVEL] = {{0,4}}
end

 

 

Acho que vc pode mudar as condições para:

 

Spoiler

-- function...
	local pVocation = getPlayerVocation(cid)

	if pVocation == 1 or pVocation == 5 or pVocation == 2 or pVocation == 6 then
		skillStages[sKILL__MAGLEVEL] = {{0, 15}, {10, 8}, {20, 5}, {60, 3}}
	else
		if pVocation == 8 or pVocation == 4 then
			skillStages[sKILL__MAGLEVEL] = {{0, 4}, {4, 3}}
		else
			if pVocation == 3 or pVocation == 7 then
				skillStages[sKILL__MAGLEVEL] = {{0, 4}, {4, 3}}
			else
				if pVocation > 8 then
					skillStages[sKILL__MAGLEVEL] = {{0, 4}}
				end
			end
		end
	end
-- end da function...

 

 

Em 19/06/2014 em 15:52, gmstrikker disse:

O que eu fiz de errado? Script

Veja se funciona:

Spoiler

-- function...
skillConfig = {skill = getConfigValue("rateSkill"), magiclevel = getConfigValue("rateMagic")}
skillStages = {}
skillStages[sKILL_FIST] = {{0, 20}, {40, 15}, {60, 10}, {80, 9}}
skillStages[sKILL_CLUB] = {{0, 20}, {40, 15}, {60, 10}, {80, 9}}
skillStages[sKILL_SWORD] = {{0, 20}, {40, 15}, {60, 10}, {80, 9}}
skillStages[sKILL_AXE] = {{0, 20}, {40, 15}, {60, 10}, {80, 9}}
skillStages[sKILL_DISTANCE] = {{0, 20}, {40, 15}, {60, 10}, {80, 9}}
skillStages[sKILL_SHIELD] = {{0, 20}, {40, 15}, {60, 10}, {80, 9}}
--skillStages[sKILL_FISHING] = {{0,5},{60,4},{80,3},{100,2},{110,1}} -- uncomment it to make it work, you can remove other skill config if you dont need it
--skillStages[sKILL__MAGLEVEL] = {{0,8},{4,6},{8,5},{60,3}}

local pVocation = getPlayerVocation(cid)

if pVocation == nil or pVocation == 0 then
	return false
end

if pVocation == 1 or pVocation == 5 or pVocation == 2 or pVocation == 6 then
	skillStages[sKILL__MAGLEVEL] = {{0, 15}, {10, 8}, {20, 5}, {60, 3}}
else
	if pVocation == 8 or pVocation == 4 then
		skillStages[sKILL__MAGLEVEL] = {{0, 4}, {4, 3}}
	else
		if pVocation == 3 or pVocation == 7 then
			skillStages[sKILL__MAGLEVEL] = {{0, 4}, {4, 3}}
		else
			if pVocation > 8 then
				skillStages[sKILL__MAGLEVEL] = {{0, 4}}
			end
		end
	end
end

showInfoOnAdvance = true -- send player message about skill rate change
showInfoOnLogin = true -- send player message about skill rates when he login

function getPlayerSkillRatesText(cid)
	local skillInfo = getPlayerRates(cid)
	return "YOUR SKILLS STAGES: [ Magic Level: " ..
		skillInfo[sKILL__MAGLEVEL] * skillConfig.magiclevel ..
			"x || Fist: " ..
				skillInfo[sKILL_FIST] * skillConfig.skill ..
					"x | Club: " ..
						skillInfo[sKILL_CLUB] * skillConfig.skill ..
							"x |  Sword: " ..
								skillInfo[sKILL_SWORD] * skillConfig.skill ..
									"x | Axe: " ..
										skillInfo[sKILL_AXE] * skillConfig.skill ..
											"x |  Distance: " ..
												skillInfo[sKILL_DISTANCE] * skillConfig.skill ..
													" | Shielding: " ..
														skillInfo[sKILL_SHIELD] * skillConfig.skill ..
															"x | Fishing: " .. skillInfo[sKILL_FISHING] * skillConfig.skill .. "x ]"
end
-- end da function...

 

 

 

Editado por dirso (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo