• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved I need help with Rang

GOD Kubus

New Member
Joined
Dec 23, 2012
Messages
60
Reaction score
0
Hello, i have problem. I click on the players I see their range and quantity to kill. But when I click on myself I do not see his rank and number of kill.

Code:
<?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 .. " Frags: " ..getPlayerStorageValue(thing.uid, fragsStorage)+1)
                       
                   
                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)] .. "!")
                        if(titles[getPlayerStorageValue(cid, fragsStorage)]== "Sergeant First Class") then
                            doPlayerAddItem(cid, 9693, 1)
                            end
                    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>
 

Attachments

Back
Top