GameTextForAll
#1

I have create my command:ann(announce)
like this

Code:
format(string,sizeof(string),"%s",text);
GameTextForAll(string, 5000, 3);
but if my entered "text" contains a "~" server crashes
Reply
#2

Yes. And your question is?
Reply
#3

How to fix, ofc
Reply
#4

Bump
Reply
#5

here it is more simple more easy
Code:
CMD:announce(playerid, params[])
{
	GameTextForAll(params, 4000, 3);
	return 1;
}
Reply
#6

Crash and server OFF
Reply
#7

Than remove / replace all ~

PHP Code:
CMD:announce(playeridparams[]) {
    for(new 
strlen(params); -->= 0; ) {
        if(
params[i] == '~') {
            
params[i] = ' ';
        }
    }
    return 
GameTextForAll(params40003);

Reply
#8

Quote:
Originally Posted by Nero_3D
View Post
Than remove / replace all ~

PHP Code:
CMD:announce(playeridparams[]) {
    for(new 
strlen(params); -->= 0; ) {
        if(
params[i] == '~') {
            
params[i] = ' ';
        }
    }
    return 
GameTextForAll(params40003);

So colors and line breaks can't be used?
Reply
#9

Code:
 This Is What is wrong i think ( its from wiki-sa-mp )
Be careful, using too many text colors or special characters in one gametext may crash every player the gametext is shown to. Additionally, avoid using an uneven usage of the ~ character.

Example: ~~r~Hello, ~g~how are ~y~~you?~
Reply
#10

Quote:
Originally Posted by Nero_3D
View Post
Than remove / replace all ~

PHP Code:
CMD:announce(playeridparams[]) {
    for(new 
strlen(params); -->= 0; ) {
        if(
params[i] == '~') {
            
params[i] = ' ';
        }
    }
    return 
GameTextForAll(params40003);

Color wont be used then?
I need colors
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)