![]() |
"in" operator on returned array.
The error I've found is that if you want to use the var in array, the array needs to be a variable defined in the function itself; not a returned value from a function. ( I also highly suspect that someArray()[2] doesn't work. )
PHP Code:
|
I've also noticed this. I tried something along these lines not so long ago and I had to migrate the array to the function it was being used in or it would not work at all, which is really quite annoying, inconvenient and can be generally unclean if you want to group some different arrays in a single function to avoid having them scattered throughout the different functions they're used for.
|
I've also noticed this. However, someArray()[2] will work.
|
May be you need to do "var in (someArray())" or so, the in-operator accepts several different formats so it might stumble if you just do "in func()"
|
var in {someArray()}?
|
Quote:
|
Quote:
edit: I just copied and pasted your script, Novo, and it worked fine for me... at least on the serverside. Weapon/GUI-script Personal/DustyPorViva/Test added/updated by DustyPorViva Works! edit2: works on the clientside too... |
Hmmm I remember there was some bug in older versions of the npcserver and clients where functions couldn't correctly return arrays.
|
Ah. Alright. I had the problem on a Mac Intel version... I might have an outdated copy.
|
All times are GMT +2. The time now is 07:31 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.