Ir para conteúdo

Featured Replies

Postado

gente estou aqui mais uma vez para pedir ajuda de vcs com um Script,

queria que o player só pode-se usar o comando !transformar tento uma certa storage.

versão : 8.60 Tfs 0.4 servidor Derivado

 

aqui vai o Script para analise: 

local config = {
--[vocation id] = { level, nova voc, looktype, efeito}
-- Goku
[7] = { 700, 8, 9, 114}
}
function onSay(cid, words, param, channel)
local voc = config[getPlayerVocation(cid)]
if voc then
if getPlayerLevel(cid) >= voc[1] then
doPlayerSetVocation(cid, voc[2])
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Voce se transformou!")
doCreatureSay(cid, "Transformar", 19)
local outfit = {lookType = voc[3]}
doCreatureChangeOutfit(cid, outfit)
doSendMagicEffect(getCreaturePosition(cid), voc[4])
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Voce precisa estar no level " .. voc[1] .. " para transformar.")
end
else
doPlayerSendCancel(cid, "Nao é possível se transformar.")
end
return true
end

quem poder ajudar agradeço mt, REP+

Editado por dissolima
problema resolvido (veja o histórico de edições)

Resolvido por vankk

Ir para solução
Postado
local config = {
--[vocation id] = { level, nova voc, looktype, efeito, storage}
-- Goku
[7] = { 700, 8, 9, 114, 43902}
}
function onSay(cid, words, param, channel)
local voc = config[getPlayerVocation(cid)]
if (getCreatureStorage(uid, key) >= 1) then
if voc then
if getPlayerLevel(cid) >= voc[1] then
doPlayerSetVocation(cid, voc[2])
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Voce se transformou!")
doCreatureSay(cid, "Transformar", 19)
local outfit = {lookType = voc[3]}
doCreatureChangeOutfit(cid, outfit)
doSendMagicEffect(getCreaturePosition(cid), voc[4])
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Voce precisa estar no level " .. voc[1] .. " para transformar.")
end
else
doPlayerSendCancel(cid, "Nao é possível se transformar.")
end
else
doPlayerSendCancel(cid, "Nao é possível se transformar.")
end
return true
end

Para poder usar a transformação tu tem que usar o método "doSetStorage(storage, valor)", com o argumento valor maior igual à um.

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

Nem todo loop infinito é ruim ;P 

User *eu = new User("otteN");
RepSystem<User> *myRep = new RepSystem<User>("jóinha");
myRep->setAlvo(eu);

/* só por ser criado já sou o melhor membro */ 

while(eu->isMelhorMembro()){
myRep->reputar();
}

 

Postado
  • Solução
local config = {
	--[vocation id] = { level, nova voc, looktype, efeito}
	[7] = {700, 8, 9, 114, 43902}
}

local storage = 123

function onSay(cid, words, param, channel)
	local voc = config[getPlayerVocation(cid)]
	if not voc then
		doPlayerSendCancel(cid, "Nao é possível se transformar.")
		return true 
	end

	if getPlayerStorageValue(cid, storage) ~= 1 then
		doPlayerSendCancel(cid, "Nao é possível se transformar.")
		return true 
	end 

	if getPlayerLevel(cid) < voc[1] then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Voce precisa estar no level " .. voc[1] .. " para transformar.")
		return true
	end

	doPlayerSetVocation(cid, voc[2])
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Voce se transformou!")
	doCreatureSay(cid, "Transformar", 19)
	doCreatureChangeOutfit(cid, {lookType = voc[3]})
	doSendMagicEffect(getCreaturePosition(cid), voc[4])
	return true
end

 

discord.pngDiscord: vankk #7765

Precisando de ajuda? Entre em contato comigo via Discord.

 

Muitos vêm seus muitos dias de glória, mas poucos vêm seus muitos dias de luta.

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