CS
pedido

Adicionar dias VIP para todos

Por cs007, 11 de jan. de 2014 em Scripts

resolvido
script
25
2.6k
cs007C
21 de janeiro de 2014 às 01:21

Meu sistema é pelo vip_time


up

OmegaO
21 de janeiro de 2014 às 01:24

Meu sistema é pelo vip_time

up

 

Insuficiente para uma resposta, cara. Não consigo obter nenhuma informação disso pra poder ajudar, então se deixar só assim, vai ficar falando up pra sempre e nada vai mudar.

 

Como sempre, é uma dificuldade ajudar algo para sistemas VIPs porque existem vários, então seja específico. Se for por storage, precisamos saber qual storage; se for na tabela players no banco de dados, precisamos do nome da tabela e da coluna que contém essa informação. Se esse sistema estiver postado aqui no fórum, facilita.

VodkartV
21 de janeiro de 2014 às 11:48

é não tem como saber que sistema de vip ele usa

KilluaK
21 de janeiro de 2014 às 12:03

Deve ter alguma action ou talkaction que adiciona VIP no seu ot, coloca ela aqui que já ajuda

cs007C
23 de janeiro de 2014 às 13:58
function onSay(cid, words, param)
         if param == "" then
            return  doPlayerPopupFYI(cid,"Está com problemas?\nAprenda os comandos!\n---------------\nAdicionar vip:\n/vip add days player\n/vip add 30 Real\n---------------\nDeletar vip:\n/vip del player\n/vip del Real\n---------------\nVer a vip:\n/vip see player\n/vip see Real\n---------------\n")
         end
         if param:lower():find('add') == 1 and 3 then
            local _,_,id,name = param:lower():find('add (%d+) (.+)')
            name = name or ""
            id = tonumber(id or 1) or 1
            if tonumber(id) == nil or getPlayerByName(name) == false then
               return doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"Adicionar vip:\n/vip add days player\n/vip add 30 Real\n [Player: "..name.."]")
            end  
            if isPlayer(getPlayerByName(name)) == TRUE then
            vip.addVipByAccount(getPlayerAccount(getPlayerByName(name)) ,vip.getDays(id))

            doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"Foram adicionados "..tonumber(id).." dias de vip a "..name..".")
            doPlayerSendTextMessage(getPlayerByName(name),MESSAGE_INFO_DESCR,"Você recebeu "..tonumber(id).." dias de vip.")
         else
           doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,name.." não esta online ou não existe.")
         end
         elseif param:lower():find('del') == 1 and 3 then
            local _,_,name = param:lower():find('del (.+)')
            if getPlayerByName(name) == false then
               return doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"Deletar vip:\n/vip del player\n/vip del Real\n")
            end

            vip.setVipByAccount(getPlayerAccount(getPlayerByName(name)),-os.time())
            doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"A vip de "..name.." foi apagada.")                                                                                                                                               
         elseif param:lower():find('see') == 1 and 3 then
            local _,_,name = param:lower():find('see (.+)')
            name = name or ""
            if getPlayerByName(name) == false then
               return doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"Ver a vip:\n/vip see player\n/vip see Real\n")
            end
            local ret_ = vip.getVip(getPlayerByName(name))
            if ret_ == 0 then
              return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,name.." Não tem vip, e nunca teve.")
            else
              return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "A vip de "..name.." Acaba/terminou em "..os.date("%d %B %Y %X ",ret_))
            end
         end
         return TRUE
end

Esse aí é o addvipp.lua que está no talkaction. Desculpe por não ser direto.

OmegaO
23 de janeiro de 2014 às 14:26

Então lá vai mais uma tentativa:

local days_to_add = 2

function onSay(cid, words, param)
	for _, pid in pairs(getPlayersOnline()) do
		vip.addVipByAccount(getPlayerAccount(pid) , days_to_add)
		doPlayerSendTextMessage(pid, 27, "You have received " .. days_to_add .. " VIP days.")
	end
	return true
end
cs007C
23 de janeiro de 2014 às 14:37

 

Então lá vai mais uma tentativa:

local days_to_add = 2

function onSay(cid, words, param)
	for _, pid in pairs(getPlayersOnline()) do
		vip.addVipByAccount(getPlayerAccount(pid) , days_to_add)
		doPlayerSendTextMessage(pid, 27, "You have received " .. days_to_add .. " VIP days.")
	end
	return true
end

Não aconteceu nada Omega, nem erro deu.

meubkM
23 de janeiro de 2014 às 14:38
function onSay(cid, words, param)
	return tonumber(param) and (function ()
	for _, player in pairs(getPlayerOnlines()) do
		vip.addVipByAccount(player, vip.getDays(param))
		doPlayerSendTextMessage(player, MESSAGE_STATUS_CONSOLE_BLUE, "You have received " .. param .. " VIP days.")
	end return true end)() or doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "invalid param.")
end

/addvip dias

Editado Janeiro 23 por xotservx

cs007C
23 de janeiro de 2014 às 14:51
function onSay(cid, words, param)
	return tonumber(param) and (function ()
	for _, player in pairs(getPlayerOnlines()) do
		vip.addVipByAccount(player, vip.getDays(param))
		doPlayerSendTextMessage(player, MESSAGE_STATUS_CONSOLE_BLUE, "You have received " .. param .. " VIP days.")
	end return true end)() or doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "invalid param.")
end

/addvip dias

 

 

Se colocar só o /addvip ele dá invalid param, se colocar /addvip 2 não acontece nada.

 

Então lá vai mais uma tentativa:

local days_to_add = 2

function onSay(cid, words, param)
	for _, pid in pairs(getPlayersOnline()) do
		vip.addVipByAccount(getPlayerAccount(pid) , days_to_add)
		doPlayerSendTextMessage(pid, 27, "You have received " .. days_to_add .. " VIP days.")
	end
	return true
end

Omega funcionou, :D Estava colocando no lugar errado @: kkkkkkkkkk' Valeu mesmo REP+

zipter98Z
23 de janeiro de 2014 às 15:00

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