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

Edit Change Outfit

xLosT

Member
Joined
Jan 11, 2010
Messages
1,022
Reaction score
13
Location
Brasil, Rio Grande do Sul
i need add exastion in to script and if have player_storage 5054 or 5055 not change outfit


PHP:
function onSay(cid, words, param, channel) --made in MG by Eskylo
if not isInParty(cid) or getPlayerParty(cid) ~= cid then
  return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não é líder de uma party")
end
local outfit = getCreatureOutfit(cid)
local addons = outfit.lookAddons
for _, cid2 in ipairs(getPartyMembers(cid)) do
  outfit.lookAddons = 0
  doCreatureChangeOutfit(cid2, outfit)
  doPlayerSendTextMessage(cid2, MESSAGE_STATUS_CONSOLE_BLUE, "Outfit da party trocado.")
  if canPlayerWearOutfit(cid2, outfit.lookType, addons) then
   outfit.lookAddons = addons
   doCreatureChangeOutfit(cid2, outfit)
   return true
  elseif addons == 3 then
   outfit.lookAddons = (canPlayerWearOutfit(cid2, outfit.lookType, 1) and 1) or (canPlayerWearOutfit(cid2, outfit.lookType, 2) and 2) or 0
   doCreatureChangeOutfit(cid2, outfit)
  end
end
return true
end
 
Lua:
function onSay(cid, words, param, channel) --made in MG by Eskylo 
	if not isInParty(cid) or getPlayerParty(cid) ~= cid then 
		return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você n?o é l?der de uma party") 
	elseif (getCreatureStorage(cid, 5054) == 1) or (getCreatureStorage(cid, 5055) == 1) then
		doPlayerSendCancel(cid, "type in the msg that u want it to be sent")  -- write the msg here
		return TRUE
	end 
	
local outfit = getCreatureOutfit(cid) 
local addons = outfit.lookAddons 
	for _, cid2 in ipairs(getPartyMembers(cid)) do 
		outfit.lookAddons = 0 
		doCreatureChangeOutfit(cid2, outfit) 
		doPlayerSendTextMessage(cid2, MESSAGE_STATUS_CONSOLE_BLUE, "Outfit da party trocado.") 
		if canPlayerWearOutfit(cid2, outfit.lookType, addons) then 
			outfit.lookAddons = addons 
			doCreatureChangeOutfit(cid2, outfit) 
			return true 
		elseif addons == 3 then 
			outfit.lookAddons = (canPlayerWearOutfit(cid2, outfit.lookType, 1) and 1) or (canPlayerWearOutfit(cid2, outfit.lookType, 2) and 2) or 0 
			doCreatureChangeOutfit(cid2, outfit) 
		end 
	end 
	return true 
end
I dont know what exastion is tbh ...
 
I have added the exhaustion and cleaned up the code a little bit..

Lua:
function onSay(cid, words, param, channel)
local outfit = getCreatureOutfit(cid) 
local addons = outfit.lookAddons 
local exh_strg = 137	
local exh_time = 10 -- time in seconds
	
	if exhaustion.check(cid, exh_strg) then
		return doPlayerSendCancel(cid, "You are exhausted")
	elseif not isInParty(cid) or getPlayerParty(cid) ~= cid or (getCreatureStorage(cid, 5054) == 1) or (getCreatureStorage(cid, 5055) == 1) then 
		return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você n?o é l?der de uma party") 
	end
	for _, cid2 in ipairs(getPartyMembers(cid)) do 
		outfit.lookAddons = 0 
		doCreatureChangeOutfit(cid2, outfit) 
		doPlayerSendTextMessage(cid2, MESSAGE_STATUS_CONSOLE_BLUE, "Outfit da party trocado.") 
		exhaustion.set(cid, exh_strg, exh_time)
		if canPlayerWearOutfit(cid2, outfit.lookType, addons) then 
			outfit.lookAddons = addons 
			doCreatureChangeOutfit(cid2, outfit) 
			exhaustion.set(cid, exh_strg, exh_time)
			return true 
		elseif addons == 3 then 
			outfit.lookAddons = (canPlayerWearOutfit(cid2, outfit.lookType, 1) and 1) or (canPlayerWearOutfit(cid2, outfit.lookType, 2) and 2) or 0 
			doCreatureChangeOutfit(cid2, outfit) 
			exhaustion.set(cid, exh_strg, exh_time)
		end 
	end 
	return true 
end
 
if the leader has storage 5054 or 5055 not exchange
but if the leader does not have storage and the other player has the 2 outifit exchange

The following should be
when you use the !pt exchange outifit least of all players, are not exchange who have the 5054 or 5055 storage

is possible?
 
I pmed u my Skype, MSG me on there I don't rlly understand wut u r saying here

- - - Updated - - -

This should work as you requested.

Lua:
function onSay(cid, words, param, channel)
local outfit = getCreatureOutfit(cid) 
local addons = outfit.lookAddons 
local exh_strg = 137	
local exh_time = 10 -- time in seconds
	
	if exhaustion.check(cid, exh_strg) then
		return doPlayerSendCancel(cid, "You are exhausted.")
	elseif not isInParty(cid) or getPlayerParty(cid) ~= cid then 
		return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você n?o é l?der de uma party") 
	end
	for _, cid2 in ipairs(getPartyMembers(cid)) do 
		if (getCreatureStorage(cid2, 5054) ~= 1) or (getCreatureStorage(cid2, 5055) ~= 1) then
			outfit.lookAddons = 0 
			doCreatureChangeOutfit(cid2, outfit) 
			doPlayerSendTextMessage(cid2, MESSAGE_STATUS_CONSOLE_BLUE, "Outfit da party trocado.") 
			exhaustion.set(cid, exh_strg, exh_time)
			if canPlayerWearOutfit(cid2, outfit.lookType, addons) then 
				outfit.lookAddons = addons 
				doCreatureChangeOutfit(cid2, outfit) 
				exhaustion.set(cid, exh_strg, exh_time)
				return true 
			elseif addons == 3 then 
				outfit.lookAddons = (canPlayerWearOutfit(cid2, outfit.lookType, 1) and 1) or (canPlayerWearOutfit(cid2, outfit.lookType, 2) and 2) or 0 
				doCreatureChangeOutfit(cid2, outfit) 
				exhaustion.set(cid, exh_strg, exh_time)
			end 
		else
			return doPlayerSendCancel(cid, "You have both storage values")
		end
	end 
	return true 
end
 
Lua:
function onSay(cid, words, param, channel)
local outfit = getCreatureOutfit(cid) 
local addons = outfit.lookAddons 
local exh_strg = 137	
local exh_time = 10 -- time in seconds
 
	if exhaustion.check(cid, exh_strg) then
		return doPlayerSendCancel(cid, "You are exhausted.")
	elseif not isInParty(cid) or getPlayerParty(cid) ~= cid then 
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você n?o é l?der de uma party") 
		return exhaustion.set(cid, exh_strg, exh_time)
	end
	for _, cid2 in ipairs(getPartyMembers(cid)) do 
		if (getCreatureStorage(cid2, 5054) == 1) or (getCreatureStorage(cid2, 5055) == 1) then
			doPlayerSendCancel(cid2, "You have both storage values")
		else
			outfit.lookAddons = 0 
			doCreatureChangeOutfit(cid2, outfit) 
			doPlayerSendTextMessage(cid2, MESSAGE_STATUS_CONSOLE_BLUE, "Outfit da party trocado.") 
			exhaustion.set(cid, exh_strg, exh_time)
			if canPlayerWearOutfit(cid2, outfit.lookType, addons) then 
				outfit.lookAddons = addons 
				doCreatureChangeOutfit(cid2, outfit) 
				exhaustion.set(cid, exh_strg, exh_time)
			elseif addons == 3 then 
				outfit.lookAddons = (canPlayerWearOutfit(cid2, outfit.lookType, 1) and 1) or (canPlayerWearOutfit(cid2, outfit.lookType, 2) and 2) or 0 
				doCreatureChangeOutfit(cid2, outfit) 
				exhaustion.set(cid, exh_strg, exh_time)
			end 
		end
	end 
	return TRUE
end
 
Last edited:
I actually tested it this time, and it works fine ... !

- - - Updated - - -

Lua:
function onSay(cid, words, param, channel)
local outfit = getCreatureOutfit(cid) 
local addons = outfit.lookAddons 
local exh_strg = 137	
local exh_time = 10 -- time in seconds
 
	if exhaustion.check(cid, exh_strg) then
		return doPlayerSendCancel(cid, "You are exhausted.")
	elseif not isInParty(cid) or getPlayerParty(cid) ~= cid then 
		return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você n?o é l?der de uma party") 
	end
	for _, cid2 in ipairs(getPartyMembers(cid)) do 
		if (getCreatureStorage(cid2, 5054) == 1) or (getCreatureStorage(cid2, 5055) == 1) then
			return doPlayerSendCancel(cid2, "Your outfit didn't change because you have one of the storages.")
		else
			outfit.lookAddons = 0 
			doCreatureChangeOutfit(cid2, outfit) 
			doPlayerSendTextMessage(cid2, MESSAGE_STATUS_CONSOLE_BLUE, "Outfit da party trocado.") 
			exhaustion.set(cid, exh_strg, exh_time)
			if canPlayerWearOutfit(cid2, outfit.lookType, addons) then 
				outfit.lookAddons = addons 
				doCreatureChangeOutfit(cid2, outfit) 
				exhaustion.set(cid, exh_strg, exh_time)
				return true 
			elseif addons == 3 then 
				outfit.lookAddons = (canPlayerWearOutfit(cid2, outfit.lookType, 1) and 1) or (canPlayerWearOutfit(cid2, outfit.lookType, 2) and 2) or 0 
				doCreatureChangeOutfit(cid2, outfit) 
				exhaustion.set(cid, exh_strg, exh_time)
				return true
			end 
		end
	end 
	return true 
end

What I tested:
1. A member of the party (not the leader) say !go, didn't work.
2. The leader says !go but one of the members have storage values 5054 or 5055 so it sends to the member (not the leader) a message that your outfit didn't change.
3. The exhaustion works.
 
Last edited:
Back
Top