Ir para conteúdo
  • Cadastre-se

(Resolvido)Trocar Money Por Item


Ir para solução Resolvido por .Smile,

Posts Recomendados

Boa Tarde TK

vcs Podem ME Ajudar Com Esse Script??

 

Ele Tira Red E Frags Comprando Com Money ID: 2160 ou 9971

Gostaria Que Fosse Por Uma Moeda Que Tenho No meu Ot 11192 Vip Coins

Alguem Pode Ajudar??

 

local moneyRed = 9000000000 -- Preço cobrado para remover o frag e red skull
local moneyBlack = 800000000 -- Preço cobrado para remover o frag e black skull
local moneySkullNone = 700000000 -- Preço cobrado para remover o frag

function onSay(cid, words, param, channel)

 

        if not getTileInfo(getThingPos(cid)).protection then
        return doPlayerSendCancel(cid, "Você deve estar em protection zone para poder usar este comando.")
        end
            
          pid = getPlayerGUID(cid)
          if getCreatureSkullType(cid) == 4 then
                    if doPlayerRemoveMoney(cid, moneyRed) then
                              doCreatureSetSkullType(cid, 0)
                              doPlayerSendTextMessage(cid, 19, 'His frags and red skull were removed for '.. doNumberFormat(moneyRed) ..' golds. You will be logged off in 5 seconds.')
                              doSendMagicEffect(getPlayerPosition(cid), 14)
                              doRemoveConditions(cid, CONDITION_INFIGHT)
                              doRemoveCreature(cid)
                              db.executeQuery("UPDATE players SET skulltime = 0 WHERE id = ".. pid ..";")
                              db.executeQuery("UPDATE killers SET unjustified = 0 WHERE id IN (SELECT kill_id FROM player_killers WHERE player_id = " .. pid .. ");")
                    else
                              doPlayerSendTextMessage(cid, 19, 'You don\'t have enough money, it takes '.. doNumberFormat(moneyRed) ..' golds')
                              doSendMagicEffect(getPlayerPosition(cid), 2)
                    end
                    return true
          end
          if getCreatureSkullType(cid) == 5 then
                    if doPlayerRemoveMoney(cid, moneyBlack) then
                              doCreatureSetSkullType(cid, 0)
                              doPlayerSendTextMessage(cid, 19, 'His frags and black skull were removed for '.. doNumberFormat(moneyBlack) ..' golds. You will be logged off in 5 seconds.')
                              doSendMagicEffect(getPlayerPosition(cid), 14)
                              doRemoveConditions(cid, CONDITION_INFIGHT)
                              doRemoveCreature(cid)
                              db.executeQuery("UPDATE players SET skulltime = 0 WHERE id = ".. pid ..";")
                              db.executeQuery("UPDATE killers SET unjustified = 0 WHERE id IN (SELECT kill_id FROM player_killers WHERE player_id = " .. pid .. ");")
                    else
                              doPlayerSendTextMessage(cid, 19, 'You don\'t have enough money, it takes '.. doNumberFormat(moneyBlack) ..' golds')
                              doSendMagicEffect(getPlayerPosition(cid), 2)
                    end
                    return true
          end
          if getCreatureSkullType(cid) <= 3 then
                    if doPlayerRemoveMoney(cid, moneySkullNone) then
                              doCreatureSetSkullType(cid, 0)
                              doPlayerSendTextMessage(cid, 19, 'His frags were removed for '.. doNumberFormat(moneySkullNone) ..' golds. You will be logged off in 5 seconds.')
                              doSendMagicEffect(getPlayerPosition(cid), 14)
                              doRemoveConditions(cid, CONDITION_INFIGHT)
                              doRemoveCreature(cid)
                              db.executeQuery("UPDATE players SET skulltime = 0 WHERE id = ".. pid ..";")
                              db.executeQuery("UPDATE killers SET unjustified = 0 WHERE id IN (SELECT kill_id FROM player_killers WHERE player_id = " .. pid .. ");")
                    else
                              doPlayerSendTextMessage(cid, 19, 'You don\'t have enough money, it takes '.. doNumberFormat(moneySkullNone) ..' golds')
                              doSendMagicEffect(getPlayerPosition(cid), 2)
                    end
                    return true
          end
end

+ Rep

Obrigado

Link para o post
Compartilhar em outros sites
  • Solução
local moneyId = 11192 -- ID do item que ira remover
local moneyRed = 5 -- Quatidade de item para remover o frag e red skull
local moneyBlack = 3 -- Quatidade de item para remover o frag e black skull
local moneySkullNone = 1 -- Quatidade de item para remover o frag

function onSay(cid, words, param, channel)

          if not getTileInfo(getThingPos(cid)).protection then
               return doPlayerSendCancel(cid, "You must be in a Protection Zone.")
          end

          pid = getPlayerGUID(cid)
          if getCreatureSkullType(cid) == 4 then
                    if doPlayerRemoveItem(cid, moneyId, moneyRed) then
                              doCreatureSetSkullType(cid, 0)
                              doPlayerSendTextMessage(cid, 19, 'His frags and red skull were removed for '.. doNumberFormat(moneyRed) ..' golds. You will be logged off in 5 seconds.')
                              doSendMagicEffect(getPlayerPosition(cid), 14)
                              doRemoveConditions(cid, CONDITION_INFIGHT)
                              doRemoveCreature(cid)
                              db.executeQuery("UPDATE players SET skulltime = 0 WHERE id = ".. pid ..";")
                              db.executeQuery("UPDATE killers SET unjustified = 0 WHERE id IN (SELECT kill_id FROM player_killers WHERE player_id = " .. pid .. ");")
                    else
                              doPlayerSendTextMessage(cid, 19, 'You don\'t have enough money, it takes '.. doNumberFormat(moneyRed) ..' golds')
                              doSendMagicEffect(getPlayerPosition(cid), 2)
                    end
                    return TRUE
          end
          if getCreatureSkullType(cid) == 5 then
                    if doPlayerRemoveItem(cid, moneyId, moneyBlack) then
                              doCreatureSetSkullType(cid, 0)
                              doPlayerSendTextMessage(cid, 19, 'His frags and black skull were removed for '.. doNumberFormat(moneyBlack) ..' golds. You will be logged off in 5 seconds.')
                              doSendMagicEffect(getPlayerPosition(cid), 14)
                              doRemoveConditions(cid, CONDITION_INFIGHT)
                              doRemoveCreature(cid)
                              db.executeQuery("UPDATE players SET skulltime = 0 WHERE id = ".. pid ..";")
                              db.executeQuery("UPDATE killers SET unjustified = 0 WHERE id IN (SELECT kill_id FROM player_killers WHERE player_id = " .. pid .. ");")
                    else
                              doPlayerSendTextMessage(cid, 19, 'You don\'t have enough money, it takes '.. doNumberFormat(moneyBlack) ..' golds')
                              doSendMagicEffect(getPlayerPosition(cid), 2)
                    end
                    return TRUE
          end
          if getCreatureSkullType(cid) <= 3 then
                    if doPlayerRemoveItem(cid, moneyId, moneySkullNone) then
                              doCreatureSetSkullType(cid, 0)
                              doPlayerSendTextMessage(cid, 19, 'His frags were removed for '.. doNumberFormat(moneySkullNone) ..' golds. You will be logged off in 5 seconds.')
                              doSendMagicEffect(getPlayerPosition(cid), 14)
                              doRemoveConditions(cid, CONDITION_INFIGHT)
                              doRemoveCreature(cid)
                              db.executeQuery("UPDATE players SET skulltime = 0 WHERE id = ".. pid ..";")
                              db.executeQuery("UPDATE killers SET unjustified = 0 WHERE id IN (SELECT kill_id FROM player_killers WHERE player_id = " .. pid .. ");")
                    else
                              doPlayerSendTextMessage(cid, 19, 'You don\'t have enough money, it takes '.. doNumberFormat(moneySkullNone) ..' golds')
                              doSendMagicEffect(getPlayerPosition(cid), 2)
                    end
                    return TRUE
          end
end

 

Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo