GameTextForAll - 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: GameTextForAll (
/showthread.php?tid=610826)
GameTextForAll -
Shinja - 28.06.2016
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
Re: GameTextForAll -
Vince - 28.06.2016
Yes. And your question is?
Re: GameTextForAll -
Shinja - 28.06.2016
How to fix, ofc
Re: GameTextForAll -
Shinja - 29.06.2016
Bump
Re: GameTextForAll -
FuNkYTheGreat - 29.06.2016
here it is more simple more easy
Code:
CMD:announce(playerid, params[])
{
GameTextForAll(params, 4000, 3);
return 1;
}
Re: GameTextForAll -
Shinja - 29.06.2016
Crash and server OFF
Re: GameTextForAll -
Nero_3D - 29.06.2016
Than remove / replace all ~
PHP Code:
CMD:announce(playerid, params[]) {
for(new i = strlen(params); --i >= 0; ) {
if(params[i] == '~') {
params[i] = ' ';
}
}
return GameTextForAll(params, 4000, 3);
}
Re: GameTextForAll -
SickAttack - 29.06.2016
Quote:
Originally Posted by Nero_3D
Than remove / replace all ~
PHP Code:
CMD:announce(playerid, params[]) {
for(new i = strlen(params); --i >= 0; ) {
if(params[i] == '~') {
params[i] = ' ';
}
}
return GameTextForAll(params, 4000, 3);
}
|
So colors and line breaks can't be used?
Re: GameTextForAll -
FuNkYTheGreat - 29.06.2016
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?~
Re: GameTextForAll -
Shinja - 29.06.2016
Quote:
Originally Posted by Nero_3D
Than remove / replace all ~
PHP Code:
CMD:announce(playerid, params[]) {
for(new i = strlen(params); --i >= 0; ) {
if(params[i] == '~') {
params[i] = ' ';
}
}
return GameTextForAll(params, 4000, 3);
}
|
Color wont be used then?
I need colors