HA
pedido

Script De Mudança De Sexo!

Por hadamais, 13 de out. de 2012 em Scripts

!change sex
resolvido
script
10
4.1k
hadamaisH
13 de outubro de 2012 às 14:49

Gostaria de um Script que a pessoa digitasse !change sex, e mudasse de sexo por 10k!

 

 

 

Meu servidor é 8.6, com Distro Real Server 3.0

 

Obrigado desde jah.

fokus090F
13 de outubro de 2012 às 14:59

Va em data/takaction/scripts crie um arquivo .LUA apague tudo q tem dentro e cole:

 

function onSay(cid, words, param)

if getPlayerPremiumDays(cid) > 2 then

doPlayerRemovePremiumDays(cid, 3)

if getPlayerSex(cid) == 0 then

doPlayerSetSex(cid, 1)

else

doPlayerSetSex(cid, 0)

end

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have changed your sex and lost three days of premium account.")

else

doPlayerSendCancel(cid, "You do not have enough premium days, changing sex costs three of your premium days.")

doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)

end

end

 

 

Depois va em Talkaction.XML e adicione:

 

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

Editado Outubro 13 por Frenesy

SkyLighS
13 de outubro de 2012 às 15:19

@Frenesy acho que você nao leu direito ! ele quer que custe 10k n que remova premium

 

aki esta .

 

function onSay(cid, words, param)
local money = 1000
if getPlayerMoney(cid,money) == TRUE then
if doPlayerRemoveMoney(cid,money) == TRUE then
if getPlayerSex(cid) == 0 then
doPlayerSetSex(cid, 1)
else
doPlayerSetSex(cid, 0)
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Parabens voce troco de sexo.")
else
doPlayerSendCancel(cid, "Desculpe voce nao tem dinheiro suficiente.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
end
end
end

 

e em talkactions.xml

 

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

CoGamesC
13 de outubro de 2012 às 15:41

Crie um arquivo.lua em data/talkactions/scripts com o nome de changesex.lua, dentro do arquivo.lua cole:

 

 

function onSay(cid, words, param)

local money = 1000 -- aqui o tanto de dinheiro que o player gastara

if getPlayerMoney(cid,money) == TRUE then -- aqui verifica se o player tem dinheiro

if doPlayerRemoveMoney(cid,money) == TRUE then -- aqui remove o dinheiro do player para trocar de sexo

if getPlayerSex(cid) == 0 then -- aqui muda o sexo do player

doPlayerSetSex(cid, 1) -- aqui o sexo que ele mudará (0=feminino) (1=masculino)

else

doPlayerSetSex(cid, 0) -- aqui o sexo que ele mudará

end -- FIM

doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Aqui coloque a mensagem que quiser apos o player ter trocado de sexo")

else

doPlayerSendCancel(cid, "Aqui coloque a mensagem que quiser quando o player não tiver dinheiro")

doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) -- ali em POFF edite para o efeito que quiser quando ele não tiver dinheiro

end -- FIM

end -- FIM

end -- FIM

 

 

 

Após ter colado isto no changesex.lua, vá em data/talkactions/talkactions.xml e cole em alguma linha:

 

 

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

 

 

 

Ali em azul onde ta escrito !changesex, escreva o comando que você quer que o player de para mudar de sexo.

Ali em roxo onde ta escrito changesex.lua, escreva o nome do arquivo.lua que você escreveu lá em cima, no caso é changesex.lua.

Créditos:

60% OTServer (TODOS OS SERVERS JÁ VEM COM ISSO).

30% SkyLigh (POR TER MODIFICADO O SCRIPT PARA QUE REMOVA O DINHEIRO DO PLAYER).

10% CoGames (POR DAR UM TUTORIAL MELHOR DE ONDE COLOCAR ESTE ARQUIVO, E O QUE PODE MODIFICAR NELE, ETC...).

Editado Outubro 13 por Cogames

SkyLighS
13 de outubro de 2012 às 15:42

Cogames creio que nao era preciso postar com o meu acima mais parabéns pelo tutorial !

hadamaisH
13 de outubro de 2012 às 16:03

do Cogames não deu!

 

@

SkyLigh

 

 

sem sucesso!

SkyLighS
13 de outubro de 2012 às 16:10

@Hadamo refiz o meu testei aki e foi que no meu eu tinha colocado função que ainda nao existe no 8.60

 

function onSay(cid, words, param)
if getPlayerSex(cid) == 0 then
doPlayerSetSex(cid, 1)
else
doPlayerSetSex(cid, 0)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Parabens voce troco de sexo.")
return true
end
if doPlayerRemoveMoney(cid, 1000) == TRUE then
end
return true
end

 

duvida sanada

reportado

Editado Outubro 13 por SkyLigh

hadamaisH
13 de outubro de 2012 às 16:13

Certinho, agora deu. pode fexar!

caoticC
13 de outubro de 2012 às 18:59

Pedido atendindo

Tópico Movido

caoticC
13 de outubro de 2012 às 18:59

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