Galera preciso que editem esse script para mim que só permita o player trocar de sexo em área pz e sem battle!
Script :
config = {
costPremiumDays = 10
}
function onSay(cid, words, param, channel)
if(getPlayerSex(cid) >= 2) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You cannot change your gender.")
return
end
if(getPlayerPremiumDays(cid) < config.costPremiumDays) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, not enough premium time - changing gender costs " .. config.costPremiumDays .. " premium days.")
doSendMagicEffect(getThingPosition(cid), CONST_ME_POFF)
return
end
if(getPlayerPremiumDays(cid) < 65535) then
doPlayerAddPremiumDays(cid, -config.costPremiumDays)
end
local c = {
{3, 1, false, 6, 1},
{3, 2, false, 6, 2},
{6, 1, false, 3, 1},
{6, 2, false, 3, 2}
}
for i = 1, #c do
if canPlayerWearOutfitId(cid, c[i][1], c[i][2]) then
doPlayerRemoveOutfitId(cid, c[i][1], c[i][2])
c[i][3] = true
end
end
doPlayerSetSex(cid, getPlayerSex(cid) == PLAYERSEX_FEMALE and PLAYERSEX_MALE or PLAYERSEX_FEMALE)
doPlayerSendTextMessage(cid,22,"Você alteradou o seu sexo, vai ser kikado!")
addEvent(doRemoveCreature,1*1000,cid,true)
doSendMagicEffect(getThingPosition(cid), 23)
for i = 1, #c do
if c[i][3] == true then
doPlayerAddOutfitId(cid, c[i][4], c[i][5])
end
end
return true
end