Fyske
04-10-2008, 11:13
Hello everyone,
I'm wondering if anyone know how to deal with this? I'm doing okay, but I have a huge problem to let this happen. I can't seems to be able to return a string properly, I tried to do this:
new g_myString[33];
public myFunction(id) {
new string[35];
getDaString(id, string, 34);
g_myString[id] = string;
/* only ever reports blank stuff */
client_print(id, print_console, "string is set as `%s`.^ng_myString[%d] is set as `%s`.", string, id, g_myString[id]);
}
getDaString(id, string[], len) {
/*
* do the necessary stuff, such as parse etc
*/
/* will properly report the string I'm trying to return */
client_print(id, print_console, "localvar is set as `%s`.", localvar);
formatex(string, len, localvar);
}but it doesn't seem to work.
Whenever I try to print out the string inside getDaString function, it obviously work.
When I try to print either string from myFunction it will just appear blank.
Any suggestions, please?
I'm wondering if anyone know how to deal with this? I'm doing okay, but I have a huge problem to let this happen. I can't seems to be able to return a string properly, I tried to do this:
new g_myString[33];
public myFunction(id) {
new string[35];
getDaString(id, string, 34);
g_myString[id] = string;
/* only ever reports blank stuff */
client_print(id, print_console, "string is set as `%s`.^ng_myString[%d] is set as `%s`.", string, id, g_myString[id]);
}
getDaString(id, string[], len) {
/*
* do the necessary stuff, such as parse etc
*/
/* will properly report the string I'm trying to return */
client_print(id, print_console, "localvar is set as `%s`.", localvar);
formatex(string, len, localvar);
}but it doesn't seem to work.
Whenever I try to print out the string inside getDaString function, it obviously work.
When I try to print either string from myFunction it will just appear blank.
Any suggestions, please?