[SOLVED!] Strings as reference parameters...
#3

My bad, lmao... It's always the simplest things.

Here's the working code for those who may need it:

Code:
// native Test(string[],size);
static cell AMX_NATIVE_CALL n_Test( AMX* amx, cell* params )
{
	char * string = new char[params[2]];
	sprintf(string,"test: %d", 1234);
	cell *buf = NULL;
	amx_GetAddr(amx, params[1], &buf);
	amx_SetString(buf, string, 0, 0, params[2]);
	delete [] string;
	return 1;
}
Thanks a billion ssǝן‾ʎ!

CodeMatrix
Reply


Messages In This Thread
[SOLVED!] Strings as reference parameters... - by XPlatform - 23.08.2009, 06:29
Re: Strings as reference parameters... - by XPlatform - 23.08.2009, 11:29
Re: Strings as reference parameters... - by XPlatform - 23.08.2009, 22:40

Forum Jump:


Users browsing this thread: 1 Guest(s)