• 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!

TalkAction Multiple outfit save slots.

Xagul

deathzot.net
Joined
Jun 30, 2008
Messages
1,294
Solutions
3
Reaction score
1,037
Hello, here is a simple yet annoying talkaction requested by Sportacus. It allows players to save an outfit they are wearing to a slot for use later. Nice if you are the type of person that likes to use more than 1 outfit but are annoyed with changing them manually all the time I suppose. Anyway here is the code :)

Lua:
local foncig = {
	outfitSlots = {
		[1] = {storage = "outfitslot1", prem = false},
		[2] = {storage = "outfitslot2", prem = false},
		[3] = {storage = "outfitslot3", prem = true},
		[4] = {storage = "outfitslot4", prem = true},
		[5] = {storage = "outfitslot5", prem = true}
	},
	acceptedOutfits = {136, 128, 137, 129, 138, 130, 139, 131, 140, 132, 141, 133, 142, 134, 147, 143, 148, 144, 149, 145, 150, 146, 155, 151, 156, 152, 157, 153, 158, 154, 252, 251, 269, 268, 270, 273, 279, 278, 288, 289, 324, 325, 336, 335, 366, 367, 329, 328}
}

function onSay(cid, words, param, channel)
	if(param == '') then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param. (example: !outfit 1 or !outfit 1, save)")
		return true
	end

	local t = string.explode(param, ",")
	t[1] = tonumber(t[1])
	
	if(foncig.outfitSlots[t[1]]) then
		if(not isPremium(cid) and foncig.outfitSlots[t[1]].prem == true) then
			return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This outfit slot is for premium only.")
		end
		
		if(t[2] and t[2] == "save") then
			local currentOutfit = getCreatureOutfit(cid)
			if(isInArray(foncig.acceptedOutfits, currentOutfit.lookType)) then
				doCreatureSetStorage(cid, foncig.outfitSlots[t[1]].storage, "_".. currentOutfit.lookType ..",_".. currentOutfit.lookHead ..",_".. currentOutfit.lookBody ..",_".. currentOutfit.lookLegs ..",_".. currentOutfit.lookFeet ..",_".. currentOutfit.lookAddons)
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your current outfit has been saved in slot ".. t[1] ..".")
			else
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your current outfit type is not allowed to be saved.")
			end
			return true
		end

		local o = tostring(getCreatureStorage(cid, foncig.outfitSlots[t[1]].storage)):gsub('_', ''):explode(',')
		if(o[6]) then
			doCreatureChangeOutfit(cid, {lookType = o[1], lookHead = o[2], lookBody = o[3], lookLegs = o[4], lookFeet = o[5], lookAddons = o[6]})
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your outfit has been changed to slot ".. t[1] ..".")
		else
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You do not have an outfit saved in slot ".. t[1] ..".")
		end
		
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid outfit slot.")
	end
	return true
end

Here is a screenshot of it doing its job.

outfits.jpg

This code is only slightly tested, lemme know if you find any problems with it and I will get them sorted.
 
If you change gender and use the command. It will give the man/woman outfit, lolz
 
If you change gender and use the command. It will give the man/woman outfit, lolz

I suppose you could use maleOutfits and femaleOutfits in the config and check the players sex with getPlayerSex(cid) I don't have time to change it right now but that's the best way I can think to fix it :p
 
I suppose you could use maleOutfits and femaleOutfits in the config and check the players sex with getPlayerSex(cid) I don't have time to change it right now but that's the best way I can think to fix it :p

Eh, I'll update it in the next few days to do a gender check, and change (meaning, if you saved a female outfit on slot 1, then change your gender to male, when you put on outfit 1, it will change the outfit to the male version of the outfit).

I'll also add a couple other features to the script, like a configable delay to changing outfits, a !outfit randomize command that will make a random outfit for you out of what you have available, and a !outfit rainbow, #ms command so that it will cycle through your saved outfits changing them repeatedly, making you look like a walking rainbow.


The reason a gender check wasn't made for it originally is that neither me or Xagul have a server where you can change gender in game, so it wasn't an issue. Just check back in a few days, I have to finish a breeding system for my pokemon OT, than I'll update this.

If anyone has any more suggestions to improve the script, or another feature they want, please post, feedback is always great.
 
The tags xml plz?!

- - - Updated - - -

to use is !outifit save 1??

- - - Updated - - -

When you save the second slot, interrupts everything
 
Hello, here is a simple yet annoying talkaction requested by Sportacus. It allows players to save an outfit they are wearing to a slot for use later. Nice if you are the type of person that likes to use more than 1 outfit but are annoyed with changing them manually all the time I suppose. Anyway here is the code :)

Lua:
local foncig = {
	outfitSlots = {
		[1] = {storage = "outfitslot1", prem = false},
		[2] = {storage = "outfitslot2", prem = false},
		[3] = {storage = "outfitslot3", prem = true},
		[4] = {storage = "outfitslot4", prem = true},
		[5] = {storage = "outfitslot5", prem = true}
	},
	acceptedOutfits = {136, 128, 137, 129, 138, 130, 139, 131, 140, 132, 141, 133, 142, 134, 147, 143, 148, 144, 149, 145, 150, 146, 155, 151, 156, 152, 157, 153, 158, 154, 252, 251, 269, 268, 270, 273, 279, 278, 288, 289, 324, 325, 336, 335, 366, 367, 329, 328}
}

function onSay(cid, words, param, channel)
	if(param == '') then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param. (example: !outfit 1 or !outfit 1, save)")
		return true
	end

	local t = string.explode(param, ",")
	t[1] = tonumber(t[1])
	
	if(foncig.outfitSlots[t[1]]) then
		if(not isPremium(cid) and foncig.outfitSlots[t[1]].prem == true) then
			return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This outfit slot is for premium only.")
		end
		
		if(t[2] and t[2] == "save") then
			local currentOutfit = getCreatureOutfit(cid)
			if(isInArray(foncig.acceptedOutfits, currentOutfit.lookType)) then
				doCreatureSetStorage(cid, foncig.outfitSlots[t[1]].storage, "_".. currentOutfit.lookType ..",_".. currentOutfit.lookHead ..",_".. currentOutfit.lookBody ..",_".. currentOutfit.lookLegs ..",_".. currentOutfit.lookFeet ..",_".. currentOutfit.lookAddons)
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your current outfit has been saved in slot ".. t[1] ..".")
			else
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your current outfit type is not allowed to be saved.")
			end
			return true
		end

		local o = tostring(getCreatureStorage(cid, foncig.outfitSlots[t[1]].storage)):gsub('_', ''):explode(',')
		if(o[6]) then
			doCreatureChangeOutfit(cid, {lookType = o[1], lookHead = o[2], lookBody = o[3], lookLegs = o[4], lookFeet = o[5], lookAddons = o[6]})
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your outfit has been changed to slot ".. t[1] ..".")
		else
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You do not have an outfit saved in slot ".. t[1] ..".")
		end
		
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid outfit slot.")
	end
	return true
end

Here is a screenshot of it doing its job.

View attachment 15375

This code is only slightly tested, lemme know if you find any problems with it and I will get them sorted.

Tested on 0.3.6
When save any outfit, saves on all?
set 5 different outfits, and when swapping it does not change outfit. however in default channel is says it's working.
No error's in console.
;(
 
Back
Top