Ir para conteúdo

Featured Replies

Postado

Então, o script que eu tenho de !party outfit (que o leader da o comando e muda a outfit de quem está na party) está mudando a outfit para citizen quando da o comando... Gostaria de tirar isso, gostaria que mudasse pra outfit que o leader está certinho... Alguém pode ajudar?

Aqui está o script...

local config =

{
sexChangeable = false,
copyOutfitAndAddonsEverytime = false
}
 
function onSay(cid, words, param, channel)
party = getPlayerParty(cid)
if (config.sexChangeable == true) then
sex = getPlayerSex(cid)
end
if (party) then
if (party == cid) then
outfit = getCreatureOutfit(cid)
members = getPartyMembers(party)
if (#members >= 1) then
tmp = outfit
for i=1,#members do
if (config.sexChangeable == true) then
if (sex ~= getPlayerSex(members)) then
doPlayerSetSex(members, sex)
end
end
if(config.copyOutfitAndAddonsEverytime == false and canPlayerWearOutfit(members, tmp.lookType, tmp.lookAddons) ~= true) then
local tmpOutfit = getCreatureOutfit(members)
tmp.lookType = tmpOutfit.lookType
tmp.lookAddons = tmpOutfit.lookAddons
end
doCreatureChangeOutfit(members, tmp)
doSendMagicEffect(getCreaturePosition(members), 66)
end
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Somente o leader da party pode usar o comando!")
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Party outfit!")
end
return true
end

  • Respostas 10
  • Visualizações 1.1k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Agora esse vai pegar!!! <talkaction words="!party" event="script" value="party.lua"/>   function onSay(cid, words, param, channel) if not isInParty(cid) or getPlayerParty(cid) ~= cid t

Postado
Vá em data/talkactions/talkactions.xml e cole isto.
<talkaction words="!Nome do comando que vc quer." script="changeoutfit.lua"/>
Depois vá em talkactions/scripts/ e crie um arquivo chamado changeoutfit.lua e cole isto dentro.
       
    local config = {
        exhaustionInSeconds = 30,
        storage = 34534
}

function onSay(cid, words, param)
        if(exhaustion.check(cid, config.storage) == TRUE) then
                doPlayerSendCancel(cid, "You can change outfit only 1 time per " .. config.exhaustionInSeconds .. " seconds.")
                return TRUE
        end

        local playerGuild = getPlayerGuildId(cid)
        if(playerGuild == FALSE) then
                doPlayerSendCancel(cid, "Sorry, you're not in a guild.")
                return TRUE
        end

        local playerGuildLevel = getPlayerGuildLevel(cid)
        if(playerGuildLevel < GUILDLEVEL_LEADER) then
                doPlayerSendCancel(cid, "You have to be Leader of your guild to change outfits!")
                return TRUE
        end

        local players = getPlayersOnline()
        local outfit = getCreatureOutfit(cid)
        local message = "*Guild* Your outfit has been changed by leader. (" .. getCreatureName(cid) .. ")"
        local members = 0
        local tmp = {}
        for i, tid in ipairs(players) do
                if(getPlayerGuildId(tid) == playerGuild and cid ~= tid) then
                        tmp = outfit
                        if(canPlayerWearOutfit(tid, outfit.lookType, outfit.lookAddons) ~= TRUE) then
                                local tidOutfit = getCreatureOutfit(tid)
                                tmp.lookType = tidOutfit.lookType
                                tmp.lookAddons = tidOutfit.lookAddons
                        end

                        doSendMagicEffect(getCreaturePosition(tid), 66)
                        doCreatureChangeOutfit(tid, tmp)
                        doPlayerSendTextMessage(tid, MESSAGE_INFO_DESCR, message)
                        members = members + 1
                end
        end

        exhaustion.set(cid, config.storage, config.exhaustionInSeconds)
        doPlayerSendCancel(cid, "Guild members outfit has been changed. (Total: " .. members .. ")")
        return TRUE
end
Pronto agora seja feliz, te ajudei? da 1 rep não vai cair seu dedo, vai cair se você não der '-'

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

JqGfm7S.png

Servidor com sources estáveis, com sistemas completos e tudo atualizados, para saber mais acessem   https://www.facebook.com/pokeVKS

Postado

Testa ae

 

local config = {
exhaustionInSeconds = 30,
storage = 34534
}

function onSay(cid, words, param)
if(exhaustion.check(cid, config.storage) == TRUE) then
doPlayerSendCancel(cid, "Voçê só pode alterar o Outfit da party a cada " .. config.exhaustionInSeconds .. " segundos.")
return TRUE
end

local playerParty = getPlayerPartyId(cid)
if(playerParty == FALSE) then
doPlayerSendCancel(cid, "Desculpe, mais voçê não tem party.")
return TRUE
end

local playerPartyLevel = getPlayerPartyLevel(cid)
if(playerPartyLevel < PARTYLEVEL_LEADER) then
doPlayerSendCancel(cid, "Voçê tem que ser Lider de uma party para executar este comando!")
return TRUE
end

local players = getPlayersOnline()
local outfit = getCreatureOutfit(cid)
local message = "*party* Seu Outfit foi mudado pelo lider da party. (" .. getCreatureName(cid) .. ")"
local members = 0
local tmp = {}
for i, tid in ipairs(players) do
if(getPlayerPartyId(tid) == playerParty and cid ~= tid) then
tmp = outfit
if(canPlayerWearOutfit(tid, outfit.lookType, outfit.lookAddons) ~= TRUE) then
local tidOutfit = getCreatureOutfit(tid)
tmp.lookType = tidOutfit.lookType
tmp.lookAddons = tidOutfit.lookAddons
end

doSendMagicEffect(getCreaturePosition(tid), 66)
doCreatureChangeOutfit(tid, tmp)
doPlayerSendTextMessage(tid, MESSAGE_INFO_DESCR, message)
members = members + 1
end
end

exhaustion.set(cid, config.storage, config.exhaustionInSeconds)
doPlayerSendCancel(cid, "Outfit da Party foi mudado com sucesso. (Total de Mudanças: " .. members .. ")")
return TRUE
end

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

JqGfm7S.png

Servidor com sources estáveis, com sistemas completos e tudo atualizados, para saber mais acessem   https://www.facebook.com/pokeVKS

Postado
  • Autor

Eu dou o comando que coloquei no talkactions.xml e não faz nada... :/

----EDIT----
Da esse erro na distro quando vou dar o comando...

 
[15/07/2014 22:45:40] [Error - TalkAction Interface] 
[15/07/2014 22:45:40] data/talkactions/scripts/go.lua:onSay
[15/07/2014 22:45:40] Description: 
[15/07/2014 22:45:40] data/talkactions/scripts/go.lua:12: attempt to call global 'getPlayerPartyId' (a nil value)
[15/07/2014 22:45:40] stack traceback:
[15/07/2014 22:45:40] data/talkactions/scripts/go.lua:12: in function <data/talkactions/scripts/go.lua:6>

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

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