Recebi uma mensagem pessoal do usuário Tonin que seria mais ou menos assim:
@NostradamusSei que você e 1 cara meio ocupado e uma sugestao sou 1 apreciador do seu trabalho, e isso era algo que eu queria em 1 ot se achar nobice desconsidere,
por exemploo 1 ot que se vc tem 1 frag vc nao fala com1 npc ou red nao viaja de barco , tipo 1 sistema de honra tem em alguns jogos e eu acho legal... acho que e so add a funçaoo pra chega os frags nos npcs ne?
brigadao xd
Como eu estava sem idéias, resolvi atender o pedido dele.
Antes de mais nada quero avisar, que o script não foi testado.
Vamos as funções:
function setHonor(cid, value) local storage = 999 local stor_value = getPlayerStorageValue(cid,storage) if value < 0 then if value >= stor_value then doPlayerSendTextMessage(cid,22,'Your cannot set the values that can turn the honor negative values.') else setPlayerStorageValue(cid,storage,stor_value + (value)) doPlayerSendTextMessage(cid,22,'Your honor was decreased by ' .. result .. '.') end elseif value >= 1 then setPlayerStorageValue(cid,storage,stor_value + value) result = value - stor_value doPlayerSendTextMessage(cid,22,'Your honor was increased by ' .. result .. '.') else debugPrint("[Honor] ERROR: value returned LUA_ERROR or LUA_NULL. returning.") return LUA_ERROR end end function getHonor(cid) local storage = 999 local stor_value = getPlayerStorageValue(cid,storage) if stor_value <= 0 then debugPrint("[Honor] ERROR: stor_value returned LUA_ERROR or LUA_NULL. returning.") return LUA_ERROR elseif stor_value < 10 then honor = 'guardian' elseif stor_value > 10 and stor_value < 20 then honor = 'noble' elseif stor_value > 20 and stor_value < 30 then honor = 'lord' else honor = 'master' end doPlayerSendTextMessage(cid,22,'Your honor is ' .. stor_value .. ' this means that you\'re a ' .. honor .. '.') end
Como não tive muito tempo, não saiu como eu esperava, mas creio que assim já é uma boa forma.
Tenham bom proveito das funções.