Engraçado não ?, pois é resolvi fazer um sistema de Reputação para o tibia. Você tá lá noob, ganha um item dum cara fodão, oke vc pode fazer por ele ? de um REP+, pra ele, isso mesmo as pessoas que mais ajudá no server concerteza terá + reps. vejá as SS.
Explicação dos comandos.
!rep (nomi do player) - dá um rep para um player.
!myrep - consulta minha reputação
!rankrep - confere os reps de quem está online
Vamos aos scripts.
1° crie um arquivo com nome de replogin.lua na pasta creaturescripts/scripts
e cole o seguinte script
function onLogin(cid) if getPlayerStorageValue(cid, 6003) <= 0 then setPlayerStorageValue(cid, 6001, 0) setPlayerStorageValue(cid, 6003, 1) end return TRUE end
TAG :
<event type="login" name="RepLogin" event="script" value="replogin.lua"/>
e registre no arquivo creaturescripts/scripts/login.lua
adicione :
registerCreatureEvent(cid, "RepLogin")
vá na pasta talkactions/scripts e crie um arkivo com nomi de rep.lua
e cole o script :
local configs = { rephours = 24 -- qntas em qntas horas pode dar rep, 24 para 1 dia. } function getTime(s) local n = math.floor(s / 60) s = s - (60 * n) return n, s end function onSay(cid, words, param) local cd = math.ceil(configs.rephours/2) local storage = 6002 if words == "!rep" then if os.time()-getPlayerStorageValue(cid, storage) <= cd then minutes,seconds = getTime(cd-(os.time()-getPlayerStorageValue(cid, storage))) return doPlayerSendTextMessage(cid, 27, "Wait " .. configs.rephours .. " fours for the next rep.") end if getPlayerByName(param) then local p = getPlayerByName(param) if getPlayerIp(cid) == getPlayerIp(p) or getPlayerAccount(cid) == getPlayerAccount(p) then return doPlayerSendTextMessage(cid, 27, "IP ACCOUNT PROTECT.") end setPlayerStorageValue(p, 6001, getPlayerStorageValue(p, 6001) + 1) doPlayerSendTextMessage(cid, 27, "You gave reputation + 1 for " .. getCreatureName(p) .. ".") doPlayerSendTextMessage(p, 21, "You received reputation + 1 of ".. getCreatureName(cid) ..".") setPlayerStorageValue(cid, storage, os.time()+3600*cd) else doPlayerSendTextMessage(cid, 27, "Player Not Found.") end elseif words == "!myrep" then return doPlayerSendTextMessage(cid, 27, "My Reputation : " .. getPlayerStorageValue(cid, 6001)) elseif words == "!rankrep" then local e = getPlayersOnline() local text = "" for _, pid in ipairs(e) do text = text .. "[" .. getCreatureName(pid) .. "] Reputation: " .. getPlayerStorageValue(pid, 6001) .. "\n\n" end text = "[RANK REPUTATION ONLINES]\n\n" .. text doShowTextDialog(cid, 2525, text) end return TRUE end
TAG:
<talkaction words="!rep;!myrep;!rankrep" event="script" value="rep.lua"/>
Configurando :
Você só configura essa parte :
local configs = { rephours = 24 }
rephours = 24, significa de qntas em qntas horas pode dar rep, ai caso querer ki for um dia ki tem 24 horas.
ou seja vai fica 1 rep por dia.
Então tá explicado, espero que vcs gostem do script, obrigado a todos.
fui...