![]() |
Multidimensional array problem
I have a class named silent_example which is joined to the player at logon, which is as follows:
PHP Code:
The array is being created fine, I can add to the array fine, both echos are working - I just can't edit the values from inside that public function. Any ideas? Edit: Uh. Okay. That line doesn't work inside the onCreated either. What the hell? |
You can't have a clientr string starting from the player object I guess. o-o Remove the player object and it should work.
|
Quote:
|
Hmm, okay then. Are you doing this inside of a NPCw? Because, for what I know, NPCws cannot read onCreated() serverside.
|
Quote:
PHP Code:
|
Have you tried to do this.clientr.example[1][1] = 5; ? The "player" variable might not exist.
|
Quote:
You can look at the scripts for yourself on ProjectR, if you like |
Does anything else from the class work? It might be that the player itself isn't joining the class or something. I honestly don't know.
Note: I don't know if onCreated() would be called when a player joins a class. o-o How about... join the class and call a public function afterwards? |
Quote:
|
Hmm, we had a similar problem like this. Try putting the echo() AFTER initializing the array etc.
|
yay for quirks! o.o
and yay for my vip running out unexpectedly -.- (see missing sig) |
Quote:
|
If you are joining a class to a player, would you use a different object (thiso. maybe, not sure) to get focus on the player?
Quote:
|
Quote:
Sure, there are other ways to do it, but this would be the most efficient and I see no reason why this way doesn't work. Bleh. |
It does appear to be doing something: assigning the value, at least temporarily.
NPC Code: But when viewing the player attributes it shows as: clientr.example="0,0","0,0" -- that part is unexpected. It also loses the value when the player disconnects (or maybe even sooner), which is almost definitely related to it not setting the attribute variable correctly. As stated already, it doesn't make a difference whether you do or don't use the "player variable", or even the clientr/client ones for that matter. As an extra note, it works fine if you use something like this in a NPC (for example) NPC Code: That shows: example="0,0","0,5" in the flags, as expected. --- Maybe that will help (Stefan?) debug a bit, if nothing else. |
| All times are GMT +2. The time now is 01:19 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.