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

It stops to add playerstorage

MalyFanek

New Member
Joined
Oct 10, 2019
Messages
37
Reaction score
2
I have no idea whats wrong, i been doing saga system and somehow it stoppd to adding playerstorage, while all is same...
Just look:
Code:
function onKill(cid, target)

if isMonster ( target ) and
getCreatureName ( target ) == 'first saga' and
getPlayerStorageValue ( cid ,stor) == 1 then
setPlayerStorageValue(cid, 8000, 2)

return true
end

if isMonster ( target ) and
getCreatureName ( target ) == 'last saga' and
getPlayerStorageValue ( cid ,stor) == 20 then
setPlayerStorageValue(cid, 8000, 21)
end
return true
end
Gave only 1st and last one as example

somehow its stops on this one
Code:
 if isMonster ( target ) and
getCreatureName ( target ) == 'special saga' and
getPlayerStorageValue ( cid ,stor) == 13 then
setPlayerStorageValue(cid, 8000, 14)
return true
end

So as u see it been working fine till 12th, ( w/o npc storage)

Is it possible NPC breaks somehow the storage or something or maybe intvalue?(but i though lua doesnt do nothing to that) ((it been working fine as i said till 13th saga, but 11 was killing monster, 12 was talk to npc which been setting to 13)) Cuz dont see here nothing wrong:
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}

function onCreatureAppear(cid)                npcHandler:onCreatureAppear(cid)            end
function onCreatureDisappear(cid)             npcHandler:onCreatureDisappear(cid)            end
function onCreatureSay(cid, type, msg)            npcHandler:onCreatureSay(cid, type, msg)        end
function onThink()                    npcHandler:onThink()                    end

function creatureSayCallback(cid, type, msg)
    if(not npcHandler:isFocused(cid)) then
        return false
    end
    local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid

    if(msgcontains(msg, 'saga')) then
        if getPlayerStorageValue(cid, 8000) == 12 then

            selfSay('Go and do ur another saga', cid)
            setPlayerStorageValue(cid, 8000, 13)
            talkState[talkUser] = 1
            return true
        else
            selfSay('You dont have this saga.', cid)
            talkState[talkUser] = 0
        end
    elseif(msgcontains(msg, 'next saga')) then
        if getPlayerStorageValue(cid, 8000) == 14 then
                        selfSay('So ur ready to do next saga!', cid)
            setPlayerStorageValue(cid, 8000, 15)
            talkState[talkUser] = 1
            return true
        else
            selfSay('You dont have this saga.', cid)
            talkState[talkUser] = 0
        end
    elseif(msgcontains(msg, 'no')) then
        selfSay('Bye then', cid)
        talkState[talkUser] = 0
    end

    return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
No errors in console, all works fine, but as i said, it somehow stops to adding storage, tried also to do same script and call it saga2, registered etc, but same..... Storage limit on same ID? i dont think so cuz task/saga systems got much more than only 11.....


TFS 0,4 rev 3777, windows and if its important too source compiled by this guide:




And i forgot to mention, even if i add storage manually as admin, the next ones doesnt adds storage too.


/edit

Im also looking for some help how to make it to be table? not sure how to call it, i mean to do all loads it 1 script than making 50~XD
Im fresh so any guide/tips/help will be awesome, or if someone will do ready table will be sweet if add explain how it works/add etc.

Strange thing it does work till that storage 8000,13
Do i need later to add other ones on login.lua? (no global.lua at this rev) but i dont think so, if earlier works fine....so any ideas/what im doing wrong pls?


Thanks
 
Last edited:
8. Removing Solved Content:
  • If you solved your problem, post the solution, do not remove the content in your posts. Instead write the solution you found. This can help other users with the same problem.
  • Threads with removed content are useless and are seen as spam.
  • If you were able to solve the issue yourself, post the solution and report your own post so a moderator can tag it as the "Best Answer".
 
Uhm sry, I did just shorter saga monster names and it worked (but not exacly :/ ) cuz
it still stops on some saga after NPC talk add storage then again monsters dont want to add storage ;x On freeza sagas i did wrong Cuz i think the problem were too long names like
"Freeza first form saga" now im stuck on C19 etc, too short? no idea, tried to do longer and still doesnt add storage, and ofc again after an NPC adds storage ;/ So i dont think its a solution i just deleted it cuz had no answers anyway so thats why i deleted it
 
Back
Top