TalkAction Change Party Outfit

averatec

Intermediate OT User
Joined
Jun 1, 2007
Messages
2,222
Best answers
2
Reaction score
145
Location
Poland
Idea: Shakaal (thanks)
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 and canPlayerWearOutfit(members[i], tmp.lookType, tmp.lookAddons) ~= true) 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
Rep++ ;]
 
Last edited:

JDB

OtLand Veteran
Joined
Jun 1, 2009
Messages
4,145
Best answers
2
Reaction score
109
Interesting :thumbup:
 

cbrm

Top Class brunet scripter
Staff member
Global Moderator
Joined
Jan 6, 2009
Messages
6,585
Best answers
3
Reaction score
852
Location
Caribbean Sea
there are some already posted
 

razorenn

Banned User
Joined
Jul 28, 2008
Messages
51
Best answers
0
Reaction score
0
Location
Poland
Takie pytanie, skoro jesteśmy przy polskim języku.. Da się zrobić, aby komenda nie kopiowała addonów party leader'a ? Bo to trochę lipa ;)

@ english - Is there any way to do a script, what isn't copying addons of party leader?
 

Shakaal

;x
Joined
Mar 12, 2009
Messages
266
Best answers
0
Reaction score
4
Location
Rzeszów/Poland
Hm, take this :)

Code:
local config = 
{
        sexChangeable = 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(canPlayerWearOutfit(members[i], tmp.lookType, tmp.lookAddons) ~= true) then
											local tmpOutfit = getCreatureOutfit(members[i])
											tmp.lookType = tmpOutfit.lookType
											tmp.lookAddons = tmpOutfit.lookAddons
										end

                                        doCreatureChangeOutfit(members[i], outfit)
                                        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
 

Zonet

Web Developer
Joined
Sep 1, 2008
Messages
4,375
Best answers
0
Reaction score
38
Location
realpath( dirname( __FILE__ ) );
Takie pytanie, skoro jesteśmy przy polskim języku.. Da się zrobić, aby komenda nie kopiowała addonów party leader'a ? Bo to trochę lipa ;)

@ english - Is there any way to do a script, what isn't copying addons of party leader?
Does this copy only the color, or outfit + addon? What if the guy dont have the addons ;(
 
OP
averatec

averatec

Intermediate OT User
Joined
Jun 1, 2007
Messages
2,222
Best answers
2
Reaction score
145
Location
Poland
Thanks gonna try it :$ :$
#edit, it still doesn't work. If you are male and the party leader are female, you're sex changes to female too.
sexChangeable must be false
 
OP
averatec

averatec

Intermediate OT User
Joined
Jun 1, 2007
Messages
2,222
Best answers
2
Reaction score
145
Location
Poland
It is false ;) I just copied the script without any changes, and as I see it's false. :huh:
sorry Zonet, I haven't got free time, but now script was fixed :)
 
OP
averatec

averatec

Intermediate OT User
Joined
Jun 1, 2007
Messages
2,222
Best answers
2
Reaction score
145
Location
Poland
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
Try it.
 
OP
averatec

averatec

Intermediate OT User
Joined
Jun 1, 2007
Messages
2,222
Best answers
2
Reaction score
145
Location
Poland
Code:
canPlayerWearOutfit(members[i], tmp.lookType, tmp.lookAddons)
idk... it isn't work...
 
Top