• 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 value xml

Old Times

New Member
Joined
Feb 11, 2015
Messages
24
Solutions
1
Reaction score
3
I have a problem with npc I did a task for my makeshift server but it is 😊 and it counts nicely how many repetitions I have killed. Now I only have a problem with npc when it kills that you want you to know if the 3 demon is ok, but when the greater that is 4 or higher the value is the higher value. I have a question, is there any possibility to rewrite this small script? i work on xml engine old and you are working hardcore
Setplayerstoragevalue(cid, 5000, 3)
If getplayerstoragevalue(cid, 5000) == 1 then
 
I have a problem with npc I did a task for my makeshift server but it is 😊 and it counts nicely how many repetitions I have killed. Now I only have a problem with npc when it kills that you want you to know if the 3 demon is ok, but when the greater that is 4 or higher the value is the higher value. I have a question, is there any possibility to rewrite this small script? i work on xml engine old and you are working hardcore
Setplayerstoragevalue(cid, 5000, 3)
If getplayerstoragevalue(cid, 5000) == 1 then
will-ferrell-anchorman.gif
 
I'm sorry, my english is bad🙈
I use a translator.
if the value of x exceeds, npc doesn't recognize the task. is it possible even if it exceeds this value?
 
thank you Xikini.
I also need the command.! Name to show me how much I have in my storage
I have
Lua:
function onSay(cid, words, param)
local storage = {10000,10001,10002,10003,10004}
for i = 1, #storage do
    setPlayerStorageValue(cid, storage[i], 1)
doPlayerSendTextMessage(cid, 22, 'blabla.')
end
return true
end
 
thank you Xikini.
I also need the command.! Name to show me how much I have in my storage
I have
Lua:
function onSay(cid, words, param)
local storage = {10000,10001,10002,10003,10004}
for i = 1, #storage do
    setPlayerStorageValue(cid, storage[i], 1)
doPlayerSendTextMessage(cid, 22, 'blabla.')
end
return true
end
There's about 50 different ways to script what you said there.

Can you explain Exactly what you want to happen, please?
 
npc is ready. Now he needs the to be able to check how many killed demon.
commend !demon and shows the player how much he has killed.
storage is assigned to each monster
getplayerstoragevalue(cid, 5000) >= 1 then
this command only says when you can go to npc
Post automatically merged:

example a player will kill 5 demon by typing the command shows him
! demon killed 5/100
 
npc is ready. Now he needs the to be able to check how many killed demon.
commend !demon and shows the player how much he has killed.
storage is assigned to each monster
getplayerstoragevalue(cid, 5000) >= 1 then
this command only says when you can go to npc
Post automatically merged:

example a player will kill 5 demon by typing the command shows him
! demon killed 5/100
Try this out.

!quest demon
!quest list

Lua:
local config = {
    ["demon"] = {storage = 5000, maxKills = 100, finishedValue = 101},
    ["example1"] = {storage = 5001, maxKills = 50, finishedValue = 51},
    ["example2"] = {storage = 5002, maxKills = 50, finishedValue = 51}
}

function onSay(cid, words, param)
    param = param:lower()
    if param == "" then
        doPlayerSendTextMessage(cid, 22, "You must provide the quest you're wanting information about. !quest demon | !quest list")
        return true
    end
    if param == "list" then
        local text = ""
        local storageValue
        for v, k in pairs(config) do
            storageValue = getPlayerStorageValue(cid, k.storage)
            if storageValue ~= 1 and storageValue < k.finishedValue then
                if text ~= "" then
                    text = text .. ", "
                end
                text = text .. v
            end
        end
        if text ~= "" then
            text = "Active Quests: " .. text .. "."
        else
            text = "You do not currently have any active quests."
        end
        doPlayerSendTextMessage(cid, 22, text)
        return true
    end
  
    local index = config[param]
    if not index then
        doPlayerSendTextMessage(cid, 22, "Unknown quest (" .. param .. "). Find your active quests by using: !quest list")
        return true
    end
  
    local storageValue = getPlayerStorageValue(cid, index.storage)
    if storageValue == -1 or storageValue >= index.finishedValue then
        doPlayerSendTextMessage(cid, 22, "The quest (" .. param .. ") is not an active quest. Find your active quests by using: !quest list")
        return true
    end
  
    doPlayerSendTextMessage(cid, 22, "You have killed " .. storageValue .."/" .. index.maxKills .. " " .. param .. ".")  
    return true
end
 
Unfortunately it doesn't work, but I took your help and it helped me a lot. Now it is like this
Lua:
function onSay(cid, words, param)
local task = {{50000, 'Demon'}}
doPlayerSendTextMessage(cid, 22, 'Twoje zlecenia')
local lp = 1
for d=1, #task do
if(getPlayerStorageValue(cid, task[d][1]) > 101)then
doPlayerSendTextMessage(cid, 19, lp..'. '..task[d][2]..' - Ukonczony!')
else
doPlayerSendTextMessage(cid, 18, lp..'. '..task[d][2]..'.  - Nie ukonczony!')
end
lp = lp+1
end
end
QrjFLA.jpg

Maybe you have an idea for the quantity
 
Back
Top