I believe Database NPCs are a bit unsafe for information thats not set in the script since if its in flags only it could be cleared on reset.
For things like that I use TStaticVars that save to file.
By the way, there is a serveroption that limits you to only changing existing server flags rather than being able to create new ones, make sure thats not enabled?
Quote:
Originally Posted by coreys
...I am using a database npc. I'm trying to set serverr flags so that my event tool doesn't have to do 436263 triggers.
|
Like Ziro said, the array has to be existing before you can edit an index of it, though it is possible to add to non-existant arrays since it will just create one if there isn't one existing.
PHP Code:
serverr.events.(@ temp.testtype[0]) = new [2];
serverr.events.(@ temp.testtype[0])[0] = temp.elist.(@ temp.testtype[0])[0][0];
serverr.events.(@ temp.testtype[0])[1] = temp.elist.(@ temp.testtype[0])[1][0];
//OR
serverr.events.(@ temp.testtype[0]) = {
temp.elist.(@ temp.testtype[0])[0][0],
temp.elist.(@ temp.testtype[0])[1][0]
};
Use the second one
Quote:
Originally Posted by Chompy
I think you need to initialize the array first, for example with {} or new[1]
|
You still can't edit index 1 as you did in your code because it doesn't exist, only index 0.