Maximum of global strings?
Hey is there a maximum of global strings?
when I store a global variable, it's empty when I use the variable in another function. Basicly I only have to pass a string on to another function using set_task, but the params argument also fails. example: Code:
|
Re: Maximum of global strings?
Or, what is the best way to pass on strings with set_task ?
|
Re: Maximum of global strings?
Why would you do this ?
PHP Code:
Going further with this... you passed string[id] (id meaning the player index), but you did this first PHP Code:
string[0] = 'D' string[1] = 'E' string[2] = 'B' string[3] = 'U' string[4] = 'G' string[5] = '/0' if "id" is, lets say 7, then it WILL show an empty string (because when doing "new string[33]" all positions will be set to '/0'). Also: be mindfull of "Index out of bounds" !!! :) |
Re: Maximum of global strings?
but why do I see 'DEBUG' in function1, but not in function2 ?
|
Re: Maximum of global strings?
Code:
Should be: Code:
|
Re: Maximum of global strings?
Also.. you see "DEBUG" in function1 because of copy(string[id],29,"DEBUG") - this could lead to bugs.
In my prevoius post I've made a mistake.... Quote:
Code:
string[id] = 'D' |
Re: Maximum of global strings?
'taskid' isn't necessary, i am only using 1111+id to stop the task if I need to(using multiple tasks at once).
So, how can I forward a string in the params variable to function2 ? |
Re: Maximum of global strings?
IMO, it's generally a good idea to only pass integers via the params variable. I would store your string globally and then, if your string is in a 2 or 3D array, since the index into that array via the params variable.
|
Re: Maximum of global strings?
Yes, that's what i'm trying to do here, how do I store a string in a global variable ?
The variable must be like this: new sound[playerindex][number][string] |
Re: Maximum of global strings?
That's a 3D array, which is rarely ever needed. What does the 2nd dimension represent, the "number"?
Are you just trying to store a single sound for each player? |
| All times are GMT -4. The time now is 06:35. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.