• 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!

Lua storage talkaciton

beliar34

Member
Joined
Feb 28, 2012
Messages
307
Solutions
7
Reaction score
11
Code:
function onSay(cid, words, param)

  storage = 45000 -- 45000 to 45039 used.
                   -- 1, 2, 3, 4, 5,  6,  7,  8,   9,  10,  11,   12,   13
damage_types = {0, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 2014, 2048}
damage_type_names = {"none", "physical", "energy", "earth", "fire", "undefined", "life drain", "mana drain", "healing", "drown", "ice", "holy", "death"}

temp_storage = storage - 1
       for i = 1, 13 do
           local text = ""
           if getPlayerStorageValue(cid, temp_storage + i) <= 0 then
           else
               text = text .. getPlayerNameByGUID(getPlayerStorageValue(cid, temp_storage + i))
           end
           text = text .. " besthit record for " .. damage_type_names[i] .. " damage with " .. getPlayerStorageValue(cid, temp_storage + i + 26) .. " damage!\n"
           text = text .. "Record created on " .. os.date("%x", getPlayerStorageValue(cid, temp_storage + i + 13))

    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "" .. text .. ".")     
       end       
   end
   return true

How to delete prints that print empty storages with no dmg record
Code:
06:25  besthit record for none damage with -1 damage!
Record created on 12/31/69.
06:25  besthit record for physical damage with -1 damage!
Record created on 12/31/69.
06:25  besthit record for energy damage with -1 damage!
Record created on 12/31/69.
06:25  besthit record for earth damage with -1 damage!
Record created on 12/31/69.
06:25  besthit record for fire damage with -1 damage!
Record created on 12/31/69.
06:25  besthit record for undefined damage with -1 damage!
Record created on 12/31/69.
06:25  besthit record for life drain damage with -1 damage!
Record created on 12/31/69.
06:25  besthit record for mana drain damage with -1 damage!
Record created on 12/31/69.
06:25 Znajdek besthit record for healing damage with 2175 damage!
Record created on 12/06/17.
06:25  besthit record for drown damage with -1 damage!
Record created on 12/31/69.
06:25  besthit record for ice damage with -1 damage!
Record created on 12/31/69.
06:25  besthit record for holy damage with -1 damage!
Record created on 12/31/69.
06:25  besthit record for death damage with -1 damage!
Record created on 12/31/69.
@Xikini
 
Solution
Lua:
function onSay(cid, words, param)
    storage = 45000 -- 45000 to 45039 used.
                   -- 1, 2, 3, 4, 5,  6,  7,  8,   9,  10,  11,   12,   13
    damage_types = {0, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 2014, 2048}
    damage_type_names = {"none", "physical", "energy", "earth", "fire", "undefined", "life drain", "mana drain", "healing", "drown", "ice", "holy", "death"}
    temp_storage = storage - 1
    for i = 1, 13 do
        local text = ""
        if getPlayerStorageValue(cid, temp_storage + i) > 0 then
            text = text .. getPlayerNameByGUID(getPlayerStorageValue(cid, temp_storage + i))
            text = text .. " besthit record for " .. damage_type_names[i] .. " damage with " .. getPlayerStorageValue(cid...
Lua:
function onSay(cid, words, param)
    storage = 45000 -- 45000 to 45039 used.
                   -- 1, 2, 3, 4, 5,  6,  7,  8,   9,  10,  11,   12,   13
    damage_types = {0, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 2014, 2048}
    damage_type_names = {"none", "physical", "energy", "earth", "fire", "undefined", "life drain", "mana drain", "healing", "drown", "ice", "holy", "death"}
    temp_storage = storage - 1
    for i = 1, 13 do
        local text = ""
        if getPlayerStorageValue(cid, temp_storage + i) > 0 then
            text = text .. getPlayerNameByGUID(getPlayerStorageValue(cid, temp_storage + i))
            text = text .. " besthit record for " .. damage_type_names[i] .. " damage with " .. getPlayerStorageValue(cid, temp_storage + i + 26) .. " damage!\n"
            text = text .. "Record created on " .. os.date("%x", getPlayerStorageValue(cid, temp_storage + i + 13))
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "" .. text .. ".")
        end
    end     
end
 
Solution
Back
Top