• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Command !go

Stewie

Family Guy # ;3
Joined
May 3, 2010
Messages
786
Reaction score
12
Location
TV
Hello,

I Would like,if leader have addons and member not have,only put outfit without addons.

Lua:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="party-outfit" version="1.0" author="GarQet" contact="[email protected]" enabled="no">
        <config name="party-outfit-config"><![CDATA[
                exhaust = 30 -- in seconds
                storage = 3002 -- storage value used to save exhaustion
        ]]></config>
        <talkaction words="!gosx" event="script"><![CDATA[
                domodlib('party-outfit-config')

  local config =
{
        exhaustionInSeconds = exhaust,
        storage = storage,
        sexChangeable = false
}

function onSay(cid, words, param, channel)
        if(exhaustion.check(cid, config.storage) == TRUE) then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Voce so poder usar este comando a cada " .. config.exhaustionInSeconds .. " segundos.")
                return TRUE
        end

        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[i])) then
                                                        doPlayerSetSex(members[i], sex)
                                                end
                                        end
                                        doCreatureChangeOutfit(members[i], outfit)
                                        doSendMagicEffect(getCreaturePosition(members[i]), 66)
        				exhaustion.set(cid, config.storage, config.exhaustionInSeconds)
                                end
                        end
                else
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Este comando so e usado pelos Lideres da party!")
                end
        else
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Voce precisa esta em uma Party!")
        end
        return true
end
        ]]></talkaction>
</mod>
 
Last edited:
This works for me!

Talkaction.xml

<talkaction words="!go" event="script" value="copyoutfit.lua"/>

Talkaction/scripts

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) 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, "This command can use only leader of a party!")
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You must be in a party!")
end
return true
end
 
Talkaction.xml:
XML:
<talkaction words="!go" event="script" value="copyoutfit.lua"/>

talkactions/scripts:

Lua:
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[i])) then
doPlayerSetSex(members[i], sex)
end
end
if(config.copyOutfitAndAddonsEverytime == false) then
local tmpOutfit = getCreatureOutfit(members[i])
tmp.lookType = tmpOutfit.lookType
tmp.lookAddons = tmpOutfit.lookAddons
end
doCreatureChangeOutfit(members[i], tmp)
doSendMagicEffect(getCreaturePosition(members[i]), 66)
end
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "This command can use only leader of a party!")
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You must be in a party!")
end
return true
end
 
Back
Top