Ir para conteúdo

Featured Replies

Postado

Prezados, boa noite!


Gostaria de pedir a ajuda de vocês para criar uma talkaction que ao ser usada /removerfrag "Player" remova apenas 1 frag do player.

 

 

Obrigado desde já!

Att,
Grafit.

Resolvido por MaTTch

Ir para solução
  • Respostas 5
  • Visualizações 466
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Sou iniciante, mas fiz para você acho que vai funcionar, teste:   Frag.lua function onSay(cid, words, param, channel) local frag = 9999 if item.itemid == frag and item.type >= 1 then doRemo

  • function onSay(cid, words, param) if(param == "") then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command need a player name param.") end local pid = getPlayerByNameWildca

Postado

Sou iniciante, mas fiz para você acho que vai funcionar, teste:

 

Frag.lua

function onSay(cid, words, param, channel)
	
local frag = 9999
	
if item.itemid == frag and item.type >= 1 then
doRemoveItem(frag, 1)
doPlayerSendCancel(cid, "Removeu uma frag.")
else
return false
doPlayerSendCancel(cid, "Voce nao tem uma frag.")
end
return true
	
end

Tag:

<talkaction words="/removefrag" event="script" value="frag.lua"/>
Postado
  • Autor
  Em 13/02/2015 em 12:05, GabrielSapient disse:

 

Sou iniciante, mas fiz para você acho que vai funcionar, teste:

 

Frag.lua

function onSay(cid, words, param, channel)
	
local frag = 9999
	
if item.itemid == frag and item.type >= 1 then
doRemoveItem(frag, 1)
doPlayerSendCancel(cid, "Removeu uma frag.")
else
return false
doPlayerSendCancel(cid, "Voce nao tem uma frag.")
end
return true
	
end

Tag:

<talkaction words="/removefrag" event="script" value="frag.lua"/>

 

Eu queria que removesse um FRAG, no caso um KILL..

 

 

Mas de qualquer jeito obrigado.

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

Att,
Grafit.

Postado
  Em 13/02/2015 em 12:30, grafit disse:

Eu queria que removesse um FRAG, no caso um KILL..

 

 

Mas de qualquer jeito obrigado.

kkkk, malz eu nem sei oq e Frag nunca entrei em um Tibia.

Postado
  • Solução
function onSay(cid, words, param)
	if(param == "") then
		return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command need a player name param.")
	end

	local pid = getPlayerByNameWildcard(param)
	if(not pid) then
		return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player not exist or is offline.")
	end
	local result, retInt = db.getResult("SELECT `unjustified` FROM `killers` WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = "..getPlayerGUID(pid)..");"), result:getDataInt("unjustified")
	if(result:getID() ~= -1) then
		if(retInt >= 0) then
			db.executeQuery("UPDATE `killers` SET `unjustified` = "..(retInt - 1).." WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = "..getPlayerGUID(pid)..");")
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Frag removed successfully.")
		else
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player do not have frag.")
		end
		result:free()
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Failed.")
	end
	return true
end

Não testei...

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