Ir para conteúdo

Posts Recomendados

Como colocar lv nesse script

 

Exemplo : so podera ser usado Lv 30

 

local config = {

costPremiumDays = 0

}

 

function onSay(cid, words, param, channel)

if(getPlayerSex(cid) >= 2) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You cannot change your gender.")

return TRUE

end

 

if(getPlayerPremiumDays(cid) < config.costPremiumDays) then

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, not enough premium time- changing gender costs " .. config.costPremiumDays .. " days.")

doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)

return TRUE

end

 

if(getPlayerPremiumDays(cid) < 65535) then

doPlayerAddPremiumDays(cid, -config.costPremiumDays)

end

 

if(getPlayerSex(cid) == PLAYERSEX_FEMALE) then

doPlayerSetSex(cid, PLAYERSEX_MALE)

else

doPlayerSetSex(cid, PLAYERSEX_FEMALE)

end

 

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have changed your gender and lost " .. config.costPremiumDays .. " days of premium time.")

doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED)

return TRUE

end

 

<talkaction words="!trocardesexo" script="trocadesexo.lua"/>

 

 

Obrigado

Link para o comentário
https://xtibia.com/forum/topic/130120-como-colocar-lv-nesse-script/
Compartilhar em outros sites

Isso ae:

 

local config = {
costPremiumDays = 0
}

function onSay(cid, words, param, channel)
if(getPlayerSex(cid) >= 2) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You cannot change your gender.")
return TRUE
end

if not (getPlayerLevel(cid) >= 30) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can only change your gender at level 30 or higher.")
return TRUE
end

if(getPlayerPremiumDays(cid) < config.costPremiumDays) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, not enough premium time- changing gender costs " .. config.costPremiumDays .. " days.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
return TRUE
end

if(getPlayerPremiumDays(cid) < 65535) then
doPlayerAddPremiumDays(cid, -config.costPremiumDays)
end

if(getPlayerSex(cid) == PLAYERSEX_FEMALE) then
doPlayerSetSex(cid, PLAYERSEX_MALE)
else
doPlayerSetSex(cid, PLAYERSEX_FEMALE)
end

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have changed your gender and lost " .. config.costPremiumDays .. " days of premium time.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED)
return TRUE
end

Link para o comentário
https://xtibia.com/forum/topic/130120-como-colocar-lv-nesse-script/#findComment-857383
Compartilhar em outros sites

Assim:

 

local config = {
costPremiumDays = 0
}

function onSay(cid, words, param, channel)
if(getPlayerSex(cid) >= 2) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You cannot change your gender.")
return TRUE
end

if not (getPlayerLevel(cid) >= 30) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can only change your gender at level 30 or higher.")
return TRUE
end

if(getPlayerPremiumDays(cid) < config.costPremiumDays) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, not enough premium time- changing gender costs " .. config.costPremiumDays .. " days.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
return TRUE
end

if(getPlayerPremiumDays(cid) < 65535) then
doPlayerAddPremiumDays(cid, -config.costPremiumDays)
end

if getPlayerStorageValue(cid, 10999) == -1 then
if(getPlayerSex(cid) == PLAYERSEX_FEMALE) then
doPlayerSetSex(cid, PLAYERSEX_MALE)
setPlayerStorageValue(cid, 10999, 1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have changed your gender and lost " .. config.costPremiumDays .. " days of premium time.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED)
else
doPlayerSetSex(cid, PLAYERSEX_FEMALE)
setPlayerStorageValue(cid, 10999, 1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have changed your gender and lost " .. config.costPremiumDays .. " days of premium time.")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED)
end
else
doPlayerSendTextMessage(cid, 25, "You cannot change your gender because you already have changed.")
end


return TRUE
end

 

flw

Link para o comentário
https://xtibia.com/forum/topic/130120-como-colocar-lv-nesse-script/#findComment-857402
Compartilhar em outros sites

×
×
  • Criar Novo...