- Joined
- Nov 15, 2007
- Messages
- 854
- Solutions
- 10
- Reaction score
- 389
- Location
- Santiago, Chile (Australian)
SEE POST #6 FOR THE SOLUTION
Hello,
I'd like to include this old war script in my current war project. TFS 1.2 compat.lua lets the majority of this script function as intended.
In the below code, I have commented out the statement that does not work. The intention of this line is to check if the player using the talkaction is the leader of the party he is in.
There is no error, it just jumps to the else statement.
Any assistance appreciated
Thanks,
Michael
Hello,
I'd like to include this old war script in my current war project. TFS 1.2 compat.lua lets the majority of this script function as intended.
In the below code, I have commented out the statement that does not work. The intention of this line is to check if the player using the talkaction is the leader of the party he is in.
There is no error, it just jumps to the else statement.
Any assistance appreciated
Thanks,
Michael
Code:
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 == player:getId()) 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, "You must be the leader of a party!")
--end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You must be in a party!")
end
return true
end
Last edited: