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

Guilds Outfits !go help rep++

Radyck

New Member
Joined
Dec 23, 2008
Messages
99
Reaction score
1
Hello OTlander's I'm are using this scripts, but i want to members only get colours from leader... not indentical outfit. Its possible?

Script:
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) ~= TRUE) then
local tidOutfit = getCreatureOutfit(tid)
tmp.lookType = tidOutfit.lookType
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

Thanks, I hope anyone help me.
REP++
 
Try this.. (I haven't tested it.)

Lua:
local config = 
{
	sexChangeable = false,
	copyOutfitAndAddonsEverytime = false
}
 
function onSay(cid, words, param, channel)
	guild = getPlayerGuildId(cid)
		if (guild) then
		if (guild == cid) then
			outfit = getCreatureOutfit(cid)
			members = getGuildMembers(guild)
			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 guild!")
		end
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You must be in a guild!")
	end
	return true
end
 
Ok, Im tested it and found error.

17:51 This command can use only leader of a guild! (None error in console)

Also, I'm Leader.
 
try
Lua:
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
	for i, tid in ipairs(players) do
		local tmp = getCreatureOutfit(tid)
				tmp.lookHead = outfit.lookHead
				tmp.lookBody = outfit.lookBody
				tmp.lookLegs = outfit.lookLegs
				tmp.lookFeet = outfit.lookFeet
		doSendMagicEffect(getCreaturePosition(tid), 66)
		doCreatureChangeOutfit(tid, tmp)
		doPlayerSendTextMessage(tid, MESSAGE_INFO_DESCR, message)
		members = members + 1
	end
	exhaustion.set(cid, config.storage, config.exhaustionInSeconds)
	doPlayerSendCancel(cid, "Guild members outfit has been changed. (Total: " .. members .. ")")
	return TRUE
end
 
Last edited:
try
Lua:
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
	for i, tid in ipairs(players) do
		local tmp = getCreatureOutfit(tid)
				tmp.lookHead = outfit.lookHead
				tmp.lookBody = outfit.lookBody
				tmp.lookLegs = outfit.lookLegs
				tmp.lookFeet = outfit.lookFeet
		doSendMagicEffect(getCreaturePosition(tid), 66)
		doCreatureChangeOutfit(tid, tmp)
		doPlayerSendTextMessage(tid, MESSAGE_INFO_DESCR, message)
		members = members + 1
	end
	exhaustion.set(cid, config.storage, config.exhaustionInSeconds)
	doPlayerSendCancel(cid, "Guild members outfit has been changed. (Total: " .. members .. ")")
	return TRUE
end

I tested :) Worked fine for me, just waiting on the post owner's approval xD
 
Back
Top