RI
dúvida

Comando !bless Só Para Vips

Por rickycostabile, 21 de jun. de 2012 em Scripts

script
4
1k
21 de junho de 2012 às 22:46

Booooa noite, estou usando o vip system by mock ( sistema perfeito por account aliás) e eu peguei o script de bless por comando, mas gostaria de saber como que eu adiciono um comando para fazer só player vips usarem.

 

eu fiz um comando mas não sei se esta certo.

 

 

 

function onSay(cid, words, param)
if getPlayerVipDays(cid) == 0 then
doPlayerSendCancel (cid, 'You nedd to be a vip account to buy bless!')
else
if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then
doPlayerSendCancel(cid,'You have already got one or more blessings!')
else
if doPlayerRemoveMoney(cid, 50000) == TRUE then
doPlayerAddBlessing(cid, 1)
doPlayerAddBlessing(cid, 2)
doPlayerAddBlessing(cid, 3)
doPlayerAddBlessing(cid, 4)
doPlayerAddBlessing(cid, 5)
doSendMagicEffect(getPlayerPosition(cid), 28)
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE, 'You have been blessed by the gods!')
else
doPlayerSendCancel(cid, "You need 50.000 gold coins to get blessed!")
end
end
end
return TRUE
end

 

 

 

Obrigado pela atenção e por sua ajuda.

 

Edit. fui vendo alguns comandos do sistema e alterei para isso.

 

 

 

function onSay(cid, words, param)
if isPlayer(cid) == true then
if vip.hasVip(cid) == FALSE then
oPlayerSendCancel (cid, 'Você precisa ser vip para usar este comando')
else
if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then
doPlayerSendCancel(cid,'You have already got one or more blessings!')
else
if doPlayerRemoveMoney(cid, 50000) == TRUE then
doPlayerAddBlessing(cid, 1)
doPlayerAddBlessing(cid, 2)
doPlayerAddBlessing(cid, 3)
doPlayerAddBlessing(cid, 4)
doPlayerAddBlessing(cid, 5)
doSendMagicEffect(getPlayerPosition(cid), 28)
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE, 'You have been blessed by the gods!')
else
doPlayerSendCancel(cid, "You need 50.000 gold coins to get blessed!")
end
end
end
return TRUE
end

 

 

 

esta certo?

Editado Junho 21 por LordRICKY

LeoxtibiaL
22 de junho de 2012 às 08:39

Usa assim:

 

function onSay(cid, words, param)
if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then
doPlayerSendCancel(cid,'You have already got one or more blessings!')
else
if vip.hasVip(cid) == TRUE then
if doPlayerRemoveMoney(cid, 50000) == TRUE then
doPlayerAddBlessing(cid, 1)
doPlayerAddBlessing(cid, 2)
doPlayerAddBlessing(cid, 3)
doPlayerAddBlessing(cid, 4)
doPlayerAddBlessing(cid, 5)
doSendMagicEffect(getPlayerPosition(cid), 49)
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE, 'You have been blessed by the gods!')
else
doPlayerSendCancel(cid, "You need 50.000 gold coins to get blessed!")
end
else
doPlayerSendCancel(cid, "Only vip players can use the comand.")
end
end
return TRUE
end

22 de junho de 2012 às 19:37

mucho obrigado ;D

 

Resorvido moderação.

22 de junho de 2012 às 19:44

só pra reduzir '-'

 

function onSay(cid, words, param)
   local bless = {1, 2, 3, 4, 5}
   for i = 1, #bless do
       if getPlayerBlessing(cid, i) then
           doPlayerSendCancel(cid, "You have already got one or more blessings!")
       else
           if vip.hasVip(cid) then
               if doPlayerRemoveMoney(cid, 50000) then
                   doPlayerAddBlessing(cid, i)
                   doSendMagicEffect(getPlayerPosition(cid), 49)
                   doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE, "You have been blessed by the gods!")
               else
                   doPlayerSendCancel(cid, "You need 50.000 gold coins to get blessed!")
               end
           else
               doPlayerSendCancel(cid, "Only vip players can use the comand.")
           end
       end
   end
   return true
end

Editado Junho 22 por fireelement