Ir para conteúdo

Featured Replies

Postado

.Qual servidor ou website você utiliza como base? 

OtX 2.2

Qual o motivo deste tópico? 

Erro no script

Está surgindo algum erro? Se sim coloque-o aqui. 

Citar

[12:34:13.775] [Error - CreatureScript Interface]
[12:34:13.775] domodlib("ranks")

[12:34:13.775]    function onLook(cid, thing, position, lookDistance)

[12:34:13.776]     if(isPlayer(thing.uid)) then

[12:34:13.777]   local rank = {rank = "Insignificante", frags = 0}

[12:34:13.777]   for k, v in pairs(titles) do

[12:34:13.777]    if(math.max(0, getPlayerStorageValue(thing.uid, fragsStorage))                                                                           > k - 1) then

[12:34:13.777]     if(k - 1 > rank.frags) then

[12:34:13.777]      rank.rank, rank.frags = v, k - 1

[12:34:13.777]     end

[12:34:13.777]    end

[12:34:13.778]   end

[12:34:13.778]   doPlayerSetSpecialDescription(thing.uid, "\n Rank: " .. rank.ra                                                                          nk)

[12:34:13.778]     end

[12:34:13.778]     return true

[12:34:13.778]    end

[12:34:13.778] :onLook
[12:34:13.778] Description:
[12:34:13.779] [string "LuaInterface::loadBuffer"]:11: bad argument #3 to 'max'                                                                           (number expected, got nil)
[12:34:13.779] stack traceback:
[12:34:13.779]  [C]: in function 'max'
[12:34:13.779]  [string "LuaInterface::loadBuffer"]:11: in function <[string "Lu                                                                          aInterface::loadBuffer"]:3>
 

 

Você tem o código disponível? Se tiver publique-o aqui: 

<?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>

 

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 520.1k

Informação Importante

Confirmação de Termo