SA-MP Forums Archive
[Question] String lenght - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [Question] String lenght (/showthread.php?tid=314292)



[Question] String lenght - Universal - 29.01.2012

Hey everyone, I got this little question which is important, I think. So, let me explain you.

When you are formatting the string, do you need to add color code lenght to the string lenght?
Example:

Код:
{FF6666}has been banned for
With the embed color lenght is 27, without its 19. SA-MP has chat string lenght limit which is 128, so using embed colors in the string makes it really hard to fit in 128 cells.

Thanks for your reply,
Universal.


Re: [Question] String lenght - Vince - 29.01.2012

Yes, you need to account for these colors too. IMO, they're over used already.


Re: [Question] String lenght - Universal - 29.01.2012

Oh, dang! What you mean?


Re: [Question] String lenght - speed258 - 29.01.2012

use this page: www.string.ql.lt <<< this is string counter where was writed "Simboliai:" thats mean how much is string. i always use this page


Re: [Question] String lenght - Konstantinos - 29.01.2012

Quote:
Originally Posted by speed258
Посмотреть сообщение
use this page: www.string.ql.lt <<< this is string counter where was writed "Simboliai:" thats mean how much is string. i always use this page
This is wrong.
Write
pawn Код:
test
it said 5 Chars. it 's 4 xD
Use Cut & Paste Character count


Re: [Question] String lenght - speed258 - 29.01.2012

they always add +1 to be garanted


Re: [Question] String lenght - Vince - 29.01.2012

It's not wrong, because it takes the NULL character (string terminator) into account.


Re: [Question] String lenght - Konstantinos - 29.01.2012

Yes, I know that it counts +1 for the string terminator, but this is only for Programming Languages.
When we want to count normally..

Between, I always count normally and then add +1.


Re: [Question] String lenght - Universal - 29.01.2012

Alright guys, thanks for help. I see I now must work my ass as hard as I can to fit the sentences into the chat string...