Postado Setembro 1, 2014 10 anos Oi galera, decidi testar o script de rank militar do teckman: Script: <?xml version = "1.0" encoding = "UTF-8"?> <mod name = "Military Ranks" version = "1.0" author = "Teckman" enabled = "yes"> <config name = "ranks"><![CDATA[ titles = { [5] = "Private First Class", [10] = "Specialist", [15] = "Corporal", [20] = "Sergeant", [25] = "Staff Sergeant", [30] = "Sergeant First Class", [35] = "Master Sergeant", [40] = "First Sergeant", [45] = "Sergeant Major", [50] = "Command Sergeant Major", [55] = "Sergeant Major of the Army", [60] = "Second Lieutenant", [65] = "First Lieutenant", [70] = "Captain", [75] = "Major", [80] = "Lieutenant Colonel", [90] = "Colonel", [100] = "Brigadier General", [110] = "Major General", [120] = "Lieutenant General", [140] = "General", [170] = "General of the Army" } fragsStorage = 600 ]]></config> <event type = "look" name = "ranksLook" event = "script"><![CDATA[ domodlib("ranks") function onLook(cid, thing, position, lookDistance) if(isPlayer(thing.uid)) then local rank = {rank = "Private", frags = 0} for k, v in pairs(titles) do if(math.max(0, getPlayerStorageValue(thing.uid, fragsStorage)) > k - 1) then if(k - 1 > rank.frags) then rank.rank, rank.frags = v, k - 1 end end end doPlayerSetSpecialDescription(thing.uid, "\n Military rank: " .. rank.rank) end return true end ]]></event> <event type = "kill" name = "ranksKill" event = "script"><![CDATA[ domodlib("ranks") function onKill(cid, target) if(isPlayer(target)) then setPlayerStorageValue(cid, fragsStorage, math.max(0, getPlayerStorageValue(cid, fragsStorage) + 1)) if(titles[getPlayerStorageValue(cid, fragsStorage)]) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You advanced to military rank: " .. titles[getPlayerStorageValue(cid, fragsStorage)] .. ". Congratulations " .. titles[getPlayerStorageValue(cid, fragsStorage)] .. "!") end end return true end ]]></event> <event type = "login" name = "ranksLogin" event = "script"><![CDATA[ function onLogin(cid) registerCreatureEvent(cid, "ranksKill") registerCreatureEvent(cid, "ranksLook") return true end ]]></event> </mod> Mas eu achei um problema, sempre que eu fecho o distro e volto a iniciar, os ranks dos player voltam baixando para o rank inicial como se não tivessem frags. Qual será o problema? TibiaServers.org | A sua nova lista de servidores de Tibia [url=https://tibiaservers.org/server/evolution-ot][img]https://tibiaservers.org/dynamic_banners/76-ankrahmun.png[/img][/url]
Postado Setembro 2, 2014 10 anos ---- esquece oque eu falei, tava errado ------------- acabei de dar uma olhada melhor no script e entendi oque ele fez Todos os meus trabalhos importantes estão na seção "Sobre mim" no meu perfil; Dá uma passada lá! "Há três caminhos para o fracasso: não ensinar o que se sabe, não praticar o que se ensina, e não perguntar o que se ignora." - São Beda (obg ao @Beeny por fazer essa linda sign <3)
Postado Setembro 2, 2014 10 anos 2 coisas: 1- Mude a storage e teste novamente, aqui: [Altere o valor, bem aleatóreo] fragsStorage = 600 2- Modifique no seu script 'config.lua', pois seus frags podem estar sendo removidos automaticamente. [Na parte de frags em config.lua, copie] seFragHandler = true redSkullLength = 1 * 24 * 60 * 60 blackSkullLength = 3 * 24 * 60 * 60 dailyFragsToRedSkull = 10 weeklyFragsToRedSkull = 60 monthlyFragsToRedSkull = 130 dailyFragsToBlackSkull = 15 weeklyFragsToBlackSkull = 90 monthlyFragsToBlackSkull = 150 dailyFragsToBanishment = 99999 weeklyFragsToBanishment = 99999 monthlyFragsToBanishment = 99999 blackSkulledDeathHealth = 40 blackSkulledDeathMana = 0 useBlackSkull = true advancedFragList = true Se não for nenhum dos dois, poste que faço o possível pra encontrar a solução. Atenciosamente, Meu servidor: pbOT
Postado Setembro 2, 2014 10 anos Autor 2 coisas: 1- Mude a storage e teste novamente, aqui: [Altere o valor, bem aleatóreo] fragsStorage = 600 2- Modifique no seu script 'config.lua', pois seus frags podem estar sendo removidos automaticamente. [Na parte de frags em config.lua, copie] seFragHandler = true redSkullLength = 1 * 24 * 60 * 60 blackSkullLength = 3 * 24 * 60 * 60 dailyFragsToRedSkull = 10 weeklyFragsToRedSkull = 60 monthlyFragsToRedSkull = 130 dailyFragsToBlackSkull = 15 weeklyFragsToBlackSkull = 90 monthlyFragsToBlackSkull = 150 dailyFragsToBanishment = 99999 weeklyFragsToBanishment = 99999 monthlyFragsToBanishment = 99999 blackSkulledDeathHealth = 40 blackSkulledDeathMana = 0 useBlackSkull = true advancedFragList = true Se não for nenhum dos dois, poste que faço o possível pra encontrar a solução. Acabei de fazer um pequeno teste no script e fiquei percebendo ainda menos: adicionei isso: local fragsMicael = getPlayerStorageValue(cid, fragStorage) doPlayerSetSpecialDescription(thing.uid, "\n Military rank: " .. rank.rank.."\n frags:"..fragsMicael) E aparece isso : 14:01 You see Knight (Level 186). He is an Elite Knight Military rank: Private frags:-1. He is Leader of the blabla. TibiaServers.org | A sua nova lista de servidores de Tibia [url=https://tibiaservers.org/server/evolution-ot][img]https://tibiaservers.org/dynamic_banners/76-ankrahmun.png[/img][/url]
Postado Setembro 2, 2014 10 anos Bom, se eu entendi bem esse script, quando você morre, você perde frag. Tenta matar um player, e ver se seus frags voltam pra 0, e mate de novo pra ver se ele vai pra +1. Atenciosamente, Meu servidor: pbOT
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.