JH
pedido

Comando !changesex

Por jhonatanp, 08 de fev. de 2014 em Scripts

resolvido
7
1.5k
jhonatanpJ
08 de fevereiro de 2014 às 07:58

Gostaria de um comando que quando o player usar !changesex ele troca de sexo.



Exemplo : Sou male e cansei das outfits !changesex e mudo para female e vise versa.




Agradeço deis de já.


08 de fevereiro de 2014 às 08:21

Tag.xml

<talkaction words="!changesex;/changesex;/changender" script="arquivo.lua" />

Arquivo.lua

 

function onSay(cid, words, param, channel)
local config = {costPremiumDays = 2}
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

Editado Fevereiro 8 por Shoguns

08 de fevereiro de 2014 às 08:27

já ta do jeito que vc quer, não meche em nda ^^

function onSay(cid, words, param)


local look1 = {lookType = 136}
local look2 = {lookType = 128}
local diamond = 2145
local remove = 5


if doPlayerRemoveItem(cid, diamond, remove) == TRUE then
  if (getPlayerSex(cid) == 1) then
   doPlayerSetSex(cid, 0)
   doCreatureChangeOutfit(cid, look1) 
   doPlayerSendTextMessage(cid, 25, "Você agora é Mulher")
  elseif (getPlayerSex(cid) == 0) then
   doPlayerSetSex(cid, 1)
   doCreatureChangeOutfit(cid, look2) 
   doPlayerSendTextMessage(cid, 25, "Você agora é Homem")
  end
else
    doPlayerSendCancel(cid, "Você precisa de "..remove.." Diamond.")
end
return TRUE
end 


Editado Fevereiro 8 por DuuhCarvalho

08 de fevereiro de 2014 às 08:34

 

já ta do jeito que vc quer, não meche em nda ^^

function onSay(cid, words, param)


local look1 = {lookType = 136}
local look2 = {lookType = 128}
local diamond = 2145
local remove = 5


if doPlayerRemoveItem(cid, diamond, remove) == TRUE then
  if (getPlayerSex(cid) == 1) then
   doPlayerSetSex(cid, 0)
   doCreatureChangeOutfit(cid, look1) 
   doPlayerSendTextMessage(cid, 25, "Você agora é Mulher")
  elseif (getPlayerSex(cid) == 0) then
   doPlayerSetSex(cid, 1)
   doCreatureChangeOutfit(cid, look2) 
   doPlayerSendTextMessage(cid, 25, "Você agora é Homem")
  end
else
    doPlayerSendCancel(cid, "Você precisa de "..remove.." Diamond.")
end
return TRUE
end 


 

 

 

 

No pedido o amigo não pede que a troca envolva Diamonds, e que não mude o looktype.

08 de fevereiro de 2014 às 08:35

Man,use a barra de busca,é facil e rapido ^^

jhonatanpJ
08 de fevereiro de 2014 às 08:36


Sky -

A forma que eu queria o Script era toda diferente e eu não achei então pedi para o Duuh em particular para ele fazer para mim e ele pediu para eu criar o tópico como ele ja sabia o que era para ser feito não precisei explicar no topico, mais ireis reputar o Shoguns pela vontade de ajudar.


O do duuh era como eu queria não expliquei muito no topico mais expliquei para ele, shoguns irei lhe reputar tbm quando der.

Você já atingiu seu limite de reputações positivas para hoje

Vlw.

Editado Fevereiro 8 por jhonatanp

zipter98Z
08 de fevereiro de 2014 às 13:36

Tópico movido para a seção de dúvidas e pedidos resolvidos.