Você Está Tendo Algum Problema Com Esse Script?
info
Grupo: Conde
Registrado: 03/09/11
Posts: 703
Reputação: +191
Gênero: Masculino
Char no Tibia: Mirade

Sim....
Gostaria que quando o Player paga-se lvl 150, 180, 200, 250 e 300
Ele ganhasse os pontos conforme ow script...
Porem fazendo 1 teste eu percebi que somente 1 funciona...
Twp eu tiro ow do lvl 45, quando o player pega 150 ele ganha os pontos e ow dinheiro, porem quando ele pega ow 180 logo em seguida, não funciona !
Luck, por favor cara, para de floodar, no tópico está dizendo que ele está tendo problema, e se ele postou aqui é que está com problemas né mano --'
Tópico: Já tentou deixar as storages de cada level diferente?
Atenciosamente, Thiagobji.
Não...
Posso colocar storages aleatórios ?
Acho que sim. Talvez, possa ser as storages iguais que está dando esse erro.
Irei Testar, e edito pra falar se funcionou !
------ EDIT -----
Funcionaou, porem tenho 1 probleminha.... ele não esta somando ow valor dos pontos, ele esta substituindo, acredito que seja 1 problema na Query.
Saberia me ajudar ???
Então consgui, porem toh com problema q ele substitui os pontos, ele n soma...
Como arrumo a query ???
db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` + '"..$points.." WHERE `name` ='"..getPlayerAccount(cid).."'")
doPlayerAddItem(cid, 2160, 5)
esta assim !
Editado Março 19 por Maimbe24
Sei nada de keys, mais vamos lá! Tenta assim:
db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` = '"..$points.." WHERE `name` ='"..getPlayerAccount(cid).."'")
doPlayerAddItem(cid, 2160, 5)
Se eu te ajudei, dá rep+? (que negócio de noob, mais eu fico feliz *-* ![]()
info
Grupo: Herói
Registrado: 14/12/10
Posts: 3.6k
Reputação: +846
Gênero: Masculino

Thiago, já lhe disse que é proibido ficar pedindo/exigindo REP+
Deixe isso por conta do usuário criador do tópico ~~
Do thiago não deu Certo.... porem consegui arrumar... Ficando da seguinte maneira:
function onAdvance(cid, skill, oldlevel, newlevel)
if(getPlayerStorageValue(cid, 99963) ~= 1 and skill == SKILL__LEVEL and newlevel >= 51) then
local points = 0
db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` + "..points.." WHERE `name` ='"..getPlayerAccount(cid).."'")
doPlayerAddItem(cid, 2160, 5)
setPlayerStorageValue(cid, 99963, 1)
doPlayerSendTextMessage(cid, 22, "Voce foi recompensado com 50k")
end
if(getPlayerStorageValue(cid, 99969) ~= 1 and skill == SKILL__LEVEL and newlevel >= 101) then
local points = 0
db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` + "..points.." WHERE `name` ='"..getPlayerAccount(cid).."'")
doPlayerAddItem(cid, 2160, 15)
setPlayerStorageValue(cid, 99969, 1)
doPlayerSendTextMessage(cid, 22, "Voce foi recompensado com 150k")
end
if(getPlayerStorageValue(cid, 99964) ~= 1 and skill == SKILL__LEVEL and newlevel >= 211) then
local points = 5
db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` + "..points.." WHERE `name` ='"..getPlayerAccount(cid).."'")
doPlayerAddItem(cid, 2160, 5)
setPlayerStorageValue(cid, 99964, 1)
doPlayerSendTextMessage(cid, 22, "Voce foi recompensado com 50k e 5 Pontos VIP")
end
if(getPlayerStorageValue(cid, 99965) ~= 1 and skill == SKILL__LEVEL and newlevel >= 231) then
local points = 2
db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` + "..points.." WHERE `name` ='"..getPlayerAccount(cid).."'")
doPlayerAddItem(cid, 2160, 2)
setPlayerStorageValue(cid, 99965, 1)
doPlayerSendTextMessage(cid, 22, "Voce foi recompensado com 20k e 2 Pontos VIP")
end
if(getPlayerStorageValue(cid, 99966) ~= 1 and skill == SKILL__LEVEL and newlevel >= 271) then
local points = 7
db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` + "..points.." WHERE `name` ='"..getPlayerAccount(cid).."'")
doPlayerAddItem(cid, 2160, 7)
setPlayerStorageValue(cid, 99966, 1)
doPlayerSendTextMessage(cid, 22, "Voce foi recompensado com 70k e 7 Pontos VIP")
end
if(getPlayerStorageValue(cid, 99967) ~= 1 and skill == SKILL__LEVEL and newlevel >= 301) then
local points = 6
db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` + "..points.." WHERE `name` ='"..getPlayerAccount(cid).."'")
doPlayerAddItem(cid, 2160, 6)
setPlayerStorageValue(cid, 99967, 1)
doPlayerSendTextMessage(cid, 22, "Voce foi recompensado com 60k e 6 Pontos VIP")
end
if(getPlayerStorageValue(cid, 99968) ~= 1 and skill == SKILL__LEVEL and newlevel >= 401) then
local points = 10
db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` + "..points.." WHERE `name` ='"..getPlayerAccount(cid).."'")
doPlayerAddItem(cid, 2160, 10)
setPlayerStorageValue(cid, 99968, 1)
doPlayerSendTextMessage(cid, 22, "Voce foi recompensado com 100k e 10 Pontos VIP")
end
if(getPlayerStorageValue(cid, 99964) ~= 1 and skill == SKILL__LEVEL and newlevel >= 450) then
local points = 15
db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` + "..points.." WHERE `name` ='"..getPlayerAccount(cid).."'")
doPlayerAddItem(cid, 2160, 20)
setPlayerStorageValue(cid, 99964, 1)
doPlayerSendTextMessage(cid, 22, "Voce foi recompensado com 200k e 5 Pontos VIP")
end
end
info
Grupo: Herói
Registrado: 14/12/10
Posts: 3.6k
Reputação: +846
Gênero: Masculino

Tópico movido para pedidos e dúvidas resolvidos.
Roksas, eu falei se eu ajudei ele, eu não falei se pode me dá rep+, é diferente mano.
Sei não mano. Se for uma dúvida/pedido, cria um tópico aqui no xtibia com esse pedido/dúvida, que eu talvez possa saber e talvez possa te ajudar (eu), ou outras pessoas que saibam, pode te ajudar.





info
Grupo: Campones
Registrado: 11/03/13
Posts: 18
Reputação: 0
Galera....
Seguinte, não sei c é a area certa, mais ai vai !
gostaria de uma ajuda... Fiz esse codigo, tudo em 1 .lua so....
Seria assim ? ou haveria alguma mudança ???
function onAdvance(cid, skill, oldlevel, newlevel)
if(getPlayerStorageValue(cid, 99963) ~= 1 and skill == SKILL__LEVEL and newlevel >= 45) then
local points = 0
db.executeQuery("UPDATE `accounts` SET `premium_points` = "..points.." WHERE `name` ='"..getPlayerAccount(cid).."'")
doPlayerAddItem(cid, 2160, 5)
setPlayerStorageValue(cid, 99963, 1)
doPlayerSendTextMessage(cid, 22, "Voce foi recompensado com 50k")
end
return TRUE
if(getPlayerStorageValue(cid, 99963) ~= 1 and skill == SKILL__LEVEL and newlevel >= 150) then
local points = 5
db.executeQuery("UPDATE `accounts` SET `premium_points` = "..points.." WHERE `name` ='"..getPlayerAccount(cid).."'")
doPlayerAddItem(cid, 2160, 5)
setPlayerStorageValue(cid, 99963, 1)
doPlayerSendTextMessage(cid, 22, "Voce foi recompensado com 50k e 5 Pontos VIP")
end
return TRUE
if(getPlayerStorageValue(cid, 99963) ~= 1 and skill == SKILL__LEVEL and newlevel >= 180) then
local points = 2
db.executeQuery("UPDATE `accounts` SET `premium_points` = "..points.." WHERE `name` ='"..getPlayerAccount(cid).."'")
doPlayerAddItem(cid, 2160, 2)
setPlayerStorageValue(cid, 99963, 1)
doPlayerSendTextMessage(cid, 22, "Voce foi recompensado com 20k e 2 Pontos VIP")
end
return TRUE
if(getPlayerStorageValue(cid, 99963) ~= 1 and skill == SKILL__LEVEL and newlevel >= 200) then
local points = 7
db.executeQuery("UPDATE `accounts` SET `premium_points` = "..points.." WHERE `name` ='"..getPlayerAccount(cid).."'")
doPlayerAddItem(cid, 2160, 7)
setPlayerStorageValue(cid, 99963, 1)
doPlayerSendTextMessage(cid, 22, "Voce foi recompensado com 70k e 7 Pontos VIP")
end
return TRUE
if(getPlayerStorageValue(cid, 99963) ~= 1 and skill == SKILL__LEVEL and newlevel >= 250) then
local points = 6
db.executeQuery("UPDATE `accounts` SET `premium_points` = "..points.." WHERE `name` ='"..getPlayerAccount(cid).."'")
doPlayerAddItem(cid, 2160, 6)
setPlayerStorageValue(cid, 99963, 1)
doPlayerSendTextMessage(cid, 22, "Voce foi recompensado com 60k e 6 Pontos VIP")
end
return TRUE
if(getPlayerStorageValue(cid, 99963) ~= 1 and skill == SKILL__LEVEL and newlevel >= 300) then
local points = 10
db.executeQuery("UPDATE `accounts` SET `premium_points` = "..points.." WHERE `name` ='"..getPlayerAccount(cid).."'")
doPlayerAddItem(cid, 2160, 6)
setPlayerStorageValue(cid, 99963, 1)
doPlayerSendTextMessage(cid, 22, "Voce foi recompensado com 100k e 10 Pontos VIP")
end
return TRUE
end
So funciona ow dinheiro do lvl 45 =/