Ir para conteúdo

Featured Replies

Postado

Eu estava fazendo uma script de look, porem da um certo bug na distro

[25/9/2014 12:35:59] [Error - CreatureScript Interface] 
[25/9/2014 12:35:59] data/creaturescripts/scripts/lookreset.lua:onLook
[25/9/2014 12:35:59] Description: 
[25/9/2014 12:35:59] (LuaInterface::luaGetPlayerNameByGUID) Player not found

Alguém sabe como resolver?

Script:

 function onLook(cid, thing, position, lookDistance)
	if isPlayer(thing.uid) and thing.uid ~= cid then
				local string = 'You see '..getCreatureName(thing.uid)..'. (Level '..  getPlayerLevel(thing.uid)..') [Resets '..getPlayerResets(thing.uid)..'].'
		if getPlayerFlagValue(thing.uid, PLAYERFLAG_SHOWGROUPINSTEADOFVOCATION) then
				if(getPlayerSex(thing.uid)== 1) then
			string = string..' He is '.. getPlayerGroupName(thing.uid) ..'.'
		end
		if(getPlayerSex(thing.uid)== 0) then
			string = string..' She is '.. getPlayerGroupName(thing.uid) ..'.'
		end	

		elseif getPlayerVocation(thing.uid) ~= 0 then
		if(getPlayerSex(thing.uid)== 1) then
			string = string..' He is '.. getPlayerVocationName(thing.uid) ..'.'
		end
		if(getPlayerSex(thing.uid)== 0) then
			string = string..' She is '.. getPlayerVocationName(thing.uid) ..'.'
		end		
		else
		if(getPlayerSex(thing.uid)== 1) then
			string = string..' He has no vocation.'
		end
		if(getPlayerSex(thing.uid)== 0) then
			string = string..' She has no vocation.'
		end	
		end

		if getPlayerNameByGUID(getPlayerPartner(thing.uid), false, false) ~= nil then
		if(getPlayerSex(thing.uid)== 1) then
			string = string..' He is '.. (getPlayerSex(thing.uid) == 0 and 'wife' or 'husband') ..' of '.. getPlayerNameByGUID(getPlayerPartner(thing.uid)) ..'.'
		end
				if(getPlayerSex(thing.uid)== 0) then
			string = string..' She is '.. (getPlayerSex(thing.uid) == 0 and 'wife' or 'husband') ..' of '.. getPlayerNameByGUID(getPlayerPartner(thing.uid)) ..'.'
		end
		end

		if getPlayerGuildId(thing.uid) > 0 then
			if(getPlayerSex(thing.uid)== 1) then
			string = string..' He is ' .. (getPlayerGuildRank(thing.uid) == '' and 'a member' or getPlayerGuildRank(thing.uid)) ..' of the '.. getPlayerGuildName(thing.uid)
		end
				if(getPlayerSex(thing.uid)== 0) then
			string = string..' She is ' .. (getPlayerGuildRank(thing.uid) == '' and 'a member' or getPlayerGuildRank(thing.uid)) ..' of the '.. getPlayerGuildName(thing.uid)
		end
			string = getPlayerGuildNick(thing.uid) ~= '' and string..' ('.. getPlayerGuildNick(thing.uid) ..').' or string..'.'
		end

		if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEECREATUREDETAILS) then
			string = string..'\nHealth: ['.. getCreatureHealth(thing.uid) ..' / '.. getCreatureMaxHealth(thing.uid) ..'], Mana: ['.. getCreatureMana(thing.uid) ..' / '.. getCreatureMaxMana(thing.uid) ..'].'
			string = string..'\nIP: '.. doConvertIntegerToIp(getPlayerIp(thing.uid)) ..'.'
		end

		if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEEPOSITION) then
			string = string..'\nPosition: [X:'.. position.x..'] [Y:'.. position.y..'] [Z:'.. position.z..'].'
		end
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string)  
		return false
----------------------------------------------------------------------------------------------------------------------------------------
	elseif thing.uid == cid then
		local string = 'You see yourself. (Level '..  getPlayerLevel(cid)..') [Resets '..getPlayerResets(cid)..'].'
		if getPlayerFlagValue(cid, PLAYERFLAG_SHOWGROUPINSTEADOFVOCATION) then
			string = string..' You are '.. getPlayerGroupName(cid) ..'.'
		elseif getPlayerVocation(cid) ~= 0 then
			string = string..' You are '.. getPlayerVocationName(cid) ..'.'
		else
			string = string..' You have no vocation.'
		end

		if getPlayerNameByGUID(getPlayerPartner(cid), false, false) ~= nil then
			string = string..' You are '.. (getPlayerSex(cid) == 0 and 'wife' or 'husband') ..' of '.. getPlayerNameByGUID(getPlayerPartner(cid)) ..'.'
		end

		if getPlayerGuildId(cid) > 0 then
			string = string..' You are ' .. (getPlayerGuildRank(cid) == '' and 'a member' or getPlayerGuildRank(cid)) ..' of the '.. getPlayerGuildName(cid)
			string = getPlayerGuildNick(cid) ~= '' and string..' ('.. getPlayerGuildNick(cid) ..').' or string..'.'
		end

		if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEECREATUREDETAILS) then
			string = string..'\nHealth: ['.. getCreatureHealth(cid) ..' / '.. getCreatureMaxHealth(cid) ..'], Mana: ['.. getCreatureMana(cid) ..' / '.. getCreatureMaxMana(cid) ..'].'
			string = string..'\nIP: '.. doConvertIntegerToIp(getPlayerIp(cid)) ..'.'
		end

		if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEEPOSITION) then
			string = string..'\nPosition: [X:'.. position.x..'] [Y:'.. position.y..'] [Z:'.. position.z..'].'
		end
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string)  
		return false
	end
	return true
end

Funciona, so da esse bug, que eu nao sei por que

12:35 You see yourself. (Level 363) [Resets 1]. You are Knight. You are Leader of the No muroo.
12:35 You see ADM Thock. (Level 28) [Resets 4]. He is administrador. He is Leader of the Naequipe.

Pronto, resolvi,pdem fechar o topico


resolvido

Editado por narazaky (veja o histórico de edições)

Te ajudei? Então Rep + ;)

Postado
  • Autor

Na verdade eu só tirei aquela verificação:

		if getPlayerNameByGUID(getPlayerPartner(thing.uid), false, false) ~= nil then
		if(getPlayerSex(thing.uid)== 1) then
			string = string..' He is '.. (getPlayerSex(thing.uid) == 0 and 'wife' or 'husband') ..' of '.. getPlayerNameByGUID(getPlayerPartner(thing.uid)) ..'.'
		end
				if(getPlayerSex(thing.uid)== 0) then
			string = string..' She is '.. (getPlayerSex(thing.uid) == 0 and 'wife' or 'husband') ..' of '.. getPlayerNameByGUID(getPlayerPartner(thing.uid)) ..'.'
		end
		end

		if getPlayerNameByGUID(getPlayerPartner(cid), false, false) ~= nil then
			string = string..' You are '.. (getPlayerSex(cid) == 0 and 'wife' or 'husband') ..' of '.. getPlayerNameByGUID(getPlayerPartner(cid)) ..'.'
		end

Pois no meu servidor nao tem o sistema de casamento.

deixando ele assim:

 function onLook(cid, thing, position, lookDistance)
	if isPlayer(thing.uid) and thing.uid ~= cid then
				local string = 'You see '..getCreatureName(thing.uid)..' (Level '..  getPlayerLevel(thing.uid)..') [Reset '..getPlayerResets(thing.uid)..'].'
		if getPlayerFlagValue(thing.uid, PLAYERFLAG_SHOWGROUPINSTEADOFVOCATION) then
				if(getPlayerSex(thing.uid)== 1) then
			string = string..' He is '.. getPlayerGroupName(thing.uid) ..'.'
		end
		if(getPlayerSex(thing.uid)== 0) then
			string = string..' She is '.. getPlayerGroupName(thing.uid) ..'.'
		end	

		elseif getPlayerVocation(thing.uid) ~= 0 then
		if(getPlayerSex(thing.uid)== 1) then
			string = string..' He is '.. getPlayerVocationName(thing.uid) ..'.'
		end
		if(getPlayerSex(thing.uid)== 0) then
			string = string..' She is '.. getPlayerVocationName(thing.uid) ..'.'
		end		
		else
		if(getPlayerSex(thing.uid)== 1) then
			string = string..' He has no vocation.'
		end
		if(getPlayerSex(thing.uid)== 0) then
			string = string..' She has no vocation.'
		end	
		end

		 -- if getPlayerNameByGUID(getPlayerPartner(thing.uid), false, false) ~= nil then
		 -- if(getPlayerSex(thing.uid)== 1) then
			 -- string = string..' He is '.. (getPlayerSex(thing.uid) == 0 and 'wife' or 'husband') ..' of '.. getPlayerNameByGUID(getPlayerPartner(thing.uid)) ..'.'
		 -- end
				 -- if(getPlayerSex(thing.uid)== 0) then
			 -- string = string..' She is '.. (getPlayerSex(thing.uid) == 0 and 'wife' or 'husband') ..' of '.. getPlayerNameByGUID(getPlayerPartner(thing.uid)) ..'.'
		 -- end
		-- else
		-- string = string
		-- end

		if getPlayerGuildId(thing.uid) > 0 then
			if(getPlayerSex(thing.uid)== 1) then
			string = string..' He is ' .. (getPlayerGuildRank(thing.uid) == '' and 'a member' or getPlayerGuildRank(thing.uid)) ..' of the '.. getPlayerGuildName(thing.uid)
		end
				if(getPlayerSex(thing.uid)== 0) then
			string = string..' She is ' .. (getPlayerGuildRank(thing.uid) == '' and 'a member' or getPlayerGuildRank(thing.uid)) ..' of the '.. getPlayerGuildName(thing.uid)
		end
			string = getPlayerGuildNick(thing.uid) ~= '' and string..' ('.. getPlayerGuildNick(thing.uid) ..').' or string..'.'
		end
		
		if (getPlayerGroupId(cid) >= 5) then
		if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEECREATUREDETAILS) then
			string = string..'\nHealth: ['.. getCreatureHealth(thing.uid) ..' / '.. getCreatureMaxHealth(thing.uid) ..'], Mana: ['.. getCreatureMana(thing.uid) ..' / '.. getCreatureMaxMana(thing.uid) ..'].'
			string = string..'\nIP: '.. doConvertIntegerToIp(getPlayerIp(thing.uid)) ..'.'
		end

		if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEEPOSITION) then
			string = string..'\nPosition: [X:'.. position.x..'] [Y:'.. position.y..'] [Z:'.. position.z..'].'
		end
		end
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string)  
		return false
----------------------------------------------------------------------------------------------------------------------------------------
	elseif thing.uid == cid then
		local string = 'You see yourself. (Level '..  getPlayerLevel(cid)..') [Reset '..getPlayerResets(cid)..'].'
		if getPlayerFlagValue(cid, PLAYERFLAG_SHOWGROUPINSTEADOFVOCATION) then
			string = string..' You are '.. getPlayerGroupName(cid) ..'.'
		elseif getPlayerVocation(cid) ~= 0 then
			string = string..' You are '.. getPlayerVocationName(cid) ..'.'
		else
			string = string..' You have no vocation.'
		end

		-- if getPlayerNameByGUID(getPlayerPartner(cid), false, false) ~= nil then
			-- string = string..' You are '.. (getPlayerSex(cid) == 0 and 'wife' or 'husband') ..' of '.. getPlayerNameByGUID(getPlayerPartner(cid)) ..'.'
		-- end

		if getPlayerGuildId(cid) > 0 then
			string = string..' You are ' .. (getPlayerGuildRank(cid) == '' and 'a member' or getPlayerGuildRank(cid)) ..' of the '.. getPlayerGuildName(cid)
			string = getPlayerGuildNick(cid) ~= '' and string..' ('.. getPlayerGuildNick(cid) ..').' or string..'.'
		end
	
			if (getPlayerGroupId(cid) >= 5) then
		if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEECREATUREDETAILS) then
			string = string..'\nHealth: ['.. getCreatureHealth(cid) ..' / '.. getCreatureMaxHealth(cid) ..'], Mana: ['.. getCreatureMana(cid) ..' / '.. getCreatureMaxMana(cid) ..'].'
			string = string..'\nIP: '.. doConvertIntegerToIp(getPlayerIp(cid)) ..'.'
		end

		if getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEEPOSITION) then
			string = string..'\nPosition: [X:'.. position.x..'] [Y:'.. position.y..'] [Z:'.. position.z..'].'
		end
		end
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, string)  
		return false
	end
	return true
end

Mas em breve postarei o sistema de reset completo

Te ajudei? Então Rep + ;)

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.7k

Informação Importante

Confirmação de Termo