function onLogin(cid)setPlayerStorageValue(cid, 47112120, 2)
Dê espaço entre isso...
function onLogin(cid) setPlayerStorageValue(cid, 47112120, 2)
Por bernardes22, 02 de mar. de 2016 em Scripts
info
Grupo: Marquês
Registrado: 25/09/10
Posts: 1.3k
Reputação: +446
Gênero: Masculino

function onLogin(cid)setPlayerStorageValue(cid, 47112120, 2)
Dê espaço entre isso...
function onLogin(cid) setPlayerStorageValue(cid, 47112120, 2)
info
Grupo: Campones
Registrado: 04/02/16
Posts: 78
Reputação: +1

function onLogin(cid)setPlayerStorageValue(cid, 47112120, 2)Dê espaço entre isso...
function onLogin(cid) setPlayerStorageValue(cid, 47112120, 2)
agora apareceu outro erro na distro
[04/03/2016 12:39:57] [Error - Action Interface] [04/03/2016 12:39:57] In a timer event called from: [04/03/2016 12:39:57] data/actions/scripts/gems.lua:onUse [04/03/2016 12:39:57] Description: [04/03/2016 12:39:57] (luaGetThingPosition) Thing not found [04/03/2016 12:39:57] [Error - Action Interface] [04/03/2016 12:39:57] In a timer event called from: [04/03/2016 12:39:57] data/actions/scripts/gems.lua:onUse [04/03/2016 12:39:57] Description: [04/03/2016 12:39:57] (internalGetPlayerInfo) Player not found when requesting player info #6 [04/03/2016 12:39:57] [Error - Action Interface] [04/03/2016 12:39:57] In a timer event called from: [04/03/2016 12:39:57] data/actions/scripts/gems.lua:onUse [04/03/2016 12:39:57] Description: [04/03/2016 12:39:57] (internalGetPlayerInfo) Player not found when requesting player info #6 [04/03/2016 12:39:57] [Error - Action Interface] [04/03/2016 12:39:57] In a timer event called from: [04/03/2016 12:39:57] data/actions/scripts/gems.lua:onUse [04/03/2016 12:39:57] Description: [04/03/2016 12:39:57] (luaGetCreatureStorage) Creature not found [04/03/2016 12:39:57] [Error - Action Interface] [04/03/2016 12:39:57] In a timer event called from: [04/03/2016 12:39:57] data/actions/scripts/gems.lua:onUse [04/03/2016 12:39:57] Description: [04/03/2016 12:39:57] data/lib/Pivi.lua:34: attempt to compare number with boolean [04/03/2016 12:39:57] stack traceback: [04/03/2016 12:39:57] data/lib/Pivi.lua:34: in function <data/lib/Pivi.lua:19>
Arquivo gems.lua
local config =
{
minLevel = 200, -- Level mínimo para adquirir a gema.
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerLevel(cid) >= config.minLevel then
gem = gems.id[getPlayerVocation(cid)]
if item.itemid == gem then
doUseGem(cid, item, getPlayerVocation(cid))
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Você adquiriu uma gema espíritual.")
doSendMagicEffect(getCreaturePosition(cid), 65)
end
else
doPlayerSendCancel(cid, "Voc\ê precisa ser level "..config.minLevel.." para adquirir a gema esp\íritual.")
end
return TRUE
end
info
Grupo: Marquês
Registrado: 25/09/10
Posts: 1.3k
Reputação: +446
Gênero: Masculino

posta sua lib das gems.
Tópico Movido
Este tópico foi movido de "OTServ → Scripting → Downloads Scripts → Sistemas e mods"
para "OTServ → Scripting → Suporte Scripting".
info
Grupo: Campones
Registrado: 04/02/16
Posts: 78
Reputação: +1

posta sua lib das gems.
Tópico Movido
Este tópico foi movido de "OTServ → Scripting → Downloads Scripts → Sistemas e mods"
para "OTServ → Scripting → Suporte Scripting".
ta aqui amigo
data/lib/gems.lua
function onUse(cid, item, fromPosition, itemEx, toPosition)
gem = gems.id[getPlayerVocation(cid)]
if item.itemid == gem then
doUseGem(cid, item, getPlayerVocation(cid))
end
return TRUE
end
data/lib/pivi.lua
function doUseGem(cid, item)
local voc = getPlayerVocation(cid)
local interval = gems.interval[voc]
if item.itemid ~= gems.id[voc] or getPlayerStorageValue(cid, gems.storage[voc]) > 0 then
return FALSE
end
setPlayerStorageValue(cid, gems.storage[voc], 1)
sendGemEffect(cid, gems.storage[voc], gems.interval[voc])
doRemoveItem(item.uid, 1)
return TRUE
end
function sendGemEffect(cid, storage, interval)
local pos = getThingPos(cid)
local voc = getPlayerVocation(cid)
local color = 1
if voc == 5 then
color = gemMsg.colorDruid[math.random(1,#gemMsg.colorElderDruid)]
elseif voc == 6 then
color = gemMsg.colorSorcerer[math.random(1,#gemMsg.colorMasterSorcerer)]
elseif voc == 7 then
color = gemMsg.colorPaladin[math.random(1,#gemMsg.colorRoyalPaladin)]
elseif voc == 8 then
color = gemMsg.colorKnight[math.random(1,#gemMsg.colorEliteKnight)]
end
doSendAnimatedText(pos, gemMsg.rnd[math.random(1,#gemMsg.rnd)], color)
if getPlayerStorageValue(cid, gems.storage[getPlayerVocation(cid)]) >= 1 then
addEvent(sendGemEffect, interval, cid, storage, interval)
end
end
function doRemoveGemEffect(cid)
if getPlayerStorageValue(cid, gems.storage[getPlayerVocation(cid)]) < 1 then
return FALSE
end
setPlayerStorageValue(cid, gems.storage[getPlayerVocation(cid)], 0)
return TRUE
end
function doRemoveAllGemEffect(cid)
for i = 1, table.maxn(gms.storage) do
setPlayerStorageValue(cid, gems.storage[i], 0)
end
return TRUE
end
function isGemActivated(cid)
if getPlayerStorageValue(cid, gems.storage[getPlayerVocation(cid)]) > 0 then
return TRUE
end
return FALSE
end
data/lib/Pivi_const.lua
gems = {
id = {2156, 2155, 2154, 2153, 2156, 2155, 2154, 2156},
storage = {5001, 5002, 5003, 5004, 5005, 5006, 5007, 5008},
interval = {600, 600, 600, 600, 600, 600, 600}, -- Intervalo dos efeitos
}
gemMsg = {
rnd = {"´ . ,", ". ´ ,", "` . ,", ", ´ ."},
colorDruid = {182,213},
colorSorcerer = {215,215},
colorPaladin = {89,89},
colorKnight = {210,210},
colorElderDruid = {182,213},
colorMasterSorcerer = {215,215},
colorRoyalPaladin = {89,89},
colorEliteKnight = {210,210}
}
Amigo já postei os arquivos da pasta lib.
posta sua lib das gems.
Tópico Movido
Este tópico foi movido de "OTServ → Scripting → Downloads Scripts → Sistemas e mods"
para "OTServ → Scripting → Suporte Scripting".
Você me Abandonou cara
:mellow:
info
Grupo: Conde
Registrado: 07/04/15
Posts: 926
Reputação: +335
Gênero: Masculino

Não manjo de derivados... Mas, aqui vai minha tentativa:
gems.lua:
local config =
{
minLevel = 200, -- Level mínimo para adquirir a gema.
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerLevel(cid) >= config.minLevel then
gem = gems.id[getPlayerVocation(cid)]
if item.itemid == gem then
plVoc = getPlayerVocation(cid)
doUseGem(cid, item, plVoc)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Você adquiriu uma gema espíritual.")
if isPlayer(cid) then
posi = getPlayerPosition(cid)
doSendMagicEffect(posi, 65)
else
posie = getCreaturePosition(cid)
doSendMagicEffect(posie, 65)
end
end
else
doPlayerSendCancel(cid, "Você precisa ser level "..config.minLevel.." para adquirir a gema espíritual.")
end
return true
end
info
Grupo: Campones
Registrado: 04/02/16
Posts: 78
Reputação: +1
Boa Noite Amigos Do XTibia!!
Estou extremamente desesperado... esta aparecendo um erro em meu distro e não estou conseguindo resolver esse erro de jeito nenhum, alguém por favor poderia me ajudar? irei posta o erro que aparece na Distro e os arquivos .lua
Estou Usando o TFS 0.4 Versão do server 8.6
Erro que aparece na Distro
Arquivo Pivi.lua
function doUseGem(cid, item) local voc = getPlayerVocation(cid) local interval = gems.interval[voc] if item.itemid ~= gems.id[voc] or getPlayerStorageValue(cid, gems.storage[voc]) > 0 then return FALSE end setPlayerStorageValue(cid, gems.storage[voc], 1) sendGemEffect(cid, gems.storage[voc], gems.interval[voc]) doRemoveItem(item.uid, 1) return TRUE end function sendGemEffect(cid, storage, interval) local pos = getThingPos(cid) local voc = getPlayerVocation(cid) local color = 1 if voc == 5 then color = gemMsg.colorDruid[math.random(1,#gemMsg.colorElderDruid)] elseif voc == 6 then color = gemMsg.colorSorcerer[math.random(1,#gemMsg.colorMasterSorcerer)] elseif voc == 7 then color = gemMsg.colorPaladin[math.random(1,#gemMsg.colorRoyalPaladin)] elseif voc == 8 then color = gemMsg.colorKnight[math.random(1,#gemMsg.colorEliteKnight)] end doSendAnimatedText(pos, gemMsg.rnd[math.random(1,#gemMsg.rnd)], color) if getPlayerStorageValue(cid, gems.storage[getPlayerVocation(cid)]) >= 1 then addEvent(sendGemEffect, interval, cid, storage, interval) end end function doRemoveGemEffect(cid) if getPlayerStorageValue(cid, gems.storage[getPlayerVocation(cid)]) < 1 then return FALSE end setPlayerStorageValue(cid, gems.storage[getPlayerVocation(cid)], 0) return TRUE end function doRemoveAllGemEffect(cid) for i = 1, table.maxn(gms.storage) do setPlayerStorageValue(cid, gems.storage[i], 0) end return TRUE end function isGemActivated(cid) if getPlayerStorageValue(cid, gems.storage[getPlayerVocation(cid)]) > 0 then return TRUE end return FALSE endArquivo Login.lua
function onLogin(cid)setPlayerStorageValue(cid, 47112120, 2) local voc = getPlayerVocation(cid) if getPlayerStorageValue(cid, gems.storage[getPlayerVocation(cid)]) > 0 then sendGemEffect(cid, gems.storage[voc], gems.interval[voc]) end local loss = getConfigValue('deathLostPercent') if(loss ~= nil) then for i = PLAYERLOSS_EXPERIENCE, PLAYERLOSS_ITEMS do doPlayerSetLossPercent(cid, i, getConfigValue('deathLostPercent')) end end registerCreatureEvent(cid, "owned") registerCreatureEvent(cid, "conected") registerCreatureEvent(cid, "boss") registerCreatureEvent(cid, "thalasteleport") registerCreatureEvent(cid, "thalas_teleport") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) registerCreatureEvent(cid, "zombieevent") registerCreatureEvent(cid, "combat") registerCreatureEvent(cid, "forever amulet") return TRUE end