You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the last character in the text is a space (" "), the text will all be blank.
It also happens for gametexts. Not sure if it happens in TextDrawSetString too (probably does).
Possible solution/implementation:
Hook TextDrawCreate/TextDrawSetString/GameTextForPlayer/GameTextForAll and let them look like
stockALS_HookedFunction( [..,] text[ ] [, ..] )
{
if( text[ 0 ] != EOS && text[ 1 ] != EOS )
{
new lLastPos =0;
for( new i =1; text[ i ] != EOS; i ++ )
{
if( text[ i ] !='' )
lLastPos = i;
}
text[ lLastPos +1 ] = EOS;
}
returnHookedFunction( [..,] text [, ..] );
}
I think that I also managed to allow " " as a valid text. Maybe someone can come with a better/shorter alternative, if possible. I didn't use strlen because the code would be slower. Here are the tests:
'' -> ''
' ' -> ' '
'a' -> 'a'
'a ' -> 'a'
'ab' -> 'ab'
'ab ' -> 'ab'
'a b' -> 'a b'
'a b ' -> 'a b'
'a b ' -> 'a b'
The text was updated successfully, but these errors were encountered:
I'm not concinced strlen would be slower - use it to find the end and work backwards. You are already going through the whole string, why not do it in C instead?
From the TextDrawCreate wiki page:
It also happens for gametexts. Not sure if it happens in TextDrawSetString too (probably does).
Hook TextDrawCreate/TextDrawSetString/GameTextForPlayer/GameTextForAll and let them look like
I think that I also managed to allow " " as a valid text. Maybe someone can come with a better/shorter alternative, if possible. I didn't use
strlen
because the code would be slower. Here are the tests:The text was updated successfully, but these errors were encountered: