+REP How to get the string of a textdraw?
#4

1) use YSF - it adds a lot of "missing" natives - including TextDrawGetString()
2) hook TextDrawSetString and store text in a variable, eg:

Code:
#define MAX_TEXTDRAW_STRING_LEN 128

static g_TextDrawText[MAX_TEXT_DRAWS][MAX_TEXTDRAW_STRING_LEN];

stock TextDrawGetString(Text:textid, string[], size = sizeof(string))
{
	string[0] = '\0';
	strcat(string, g_TextDrawText[_:textid], size);
	return 1;
}

stock TDGS_TextDrawSetString(Text:textid, string[])
{
	g_TextDrawText[_:textid][0] = '\0';
	strcat(g_TextDrawText[_:textid], string, MAX_TEXTDRAW_STRING_LEN);
	return TextDrawSetString(textid, string);
}

#if defined _ALS_TextDrawSetString
    #undef TextDrawSetString
#else
    #define _ALS_TextDrawSetString
#endif
#define TextDrawSetString TDGS_TextDrawSetString
Reply


Messages In This Thread
+REP How to get the string of a textdraw? - by Lirbo - 22.12.2016, 10:35
Re: +REP How to get the string of a textdraw? - by Bolex_ - 22.12.2016, 10:50
Re: +REP How to get the string of a textdraw? - by Battlezone - 22.12.2016, 11:02
Re: +REP How to get the string of a textdraw? - by Spmn - 22.12.2016, 11:10
Re: +REP How to get the string of a textdraw? - by Konstantinos - 22.12.2016, 11:42

Forum Jump:


Users browsing this thread: 1 Guest(s)