Pronto, dei uma arrumada, deve ter ficado melhor agora pra você editar se precisar, tente assim:
local tempovip = db.getResult("SELECT `vip_time` FROM `accounts` WHERE `name` = '"..getPlayerAccount(cid).."';")
if tempovip:getDataInt("vip_time") > 0 then -- se o jogador tiver dias de VIP, então...
if getPlayerPromotionLevel(cid) < 2 then -- se o nível de promotion for menor que 2, então...
setPlayerPromotionLevel(cid, 2) -- mudar o nível de promotion para 2.
end
local playerstorage = db.getResult("SELECT `value` FROM `player_storage` WHERE `key` = 35870 AND `player_id` = '"..cid.."';")
if playerstorage:getDataInt("value") > 0 then
mensagem = "Bem vindo, VIP!"
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, mensagem)
else
db.getResult("DELETE FROM `player_storage` WHERE `key` = 35870 AND `player_id` = '"..cid.."';")
end
end


info
Grupo: Campones
Registrado: 09/11/05
Posts: 16
Reputação: +2
Olá pessoal eu preciso de ajudar
to pensando em fazer um script que quando loga verifica se tem dias premium, caso tenha verificar se ja é promotion, caso não seja, ele poe como promotion 2, caso ele seja, nao faz nada... Mas verifica também se tem dias premium ainda, se não tem mais tira promotion caso tenha...
como faço??
tenho uma base, mas não funciona
local vipkod = db.getResult("SELECT `vip_time` FROM `accounts` WHERE `name` = '"..getPlayerAccount(cid).."';") if vipkod:getDataInt("vip_time") > 0 then if getPlayerPromotionLevel(cid) != 2 then setPlayerPromotionLevel(cid, 2) end else if getPlayerPromotionLevel(cid) == 2 then setPlayerPromotionLevel(cid, 1) end local storagekod = db.getResult("SELECT `value` FROM `player_storage` WHERE `key` = 35870 AND `player_id` = '"..cid.."';") if storagekod:getDataInt("value") > 0 then strkod = "Bem vindo VIP" doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, strkod) else db.getResult("DELETE FROM `player_storage` WHERE `key` = 35870 AND `player_id` = '"..cid.."';") end end