Filter signs in textboxes - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Filter signs in textboxes (
/showthread.php?tid=270581)
Filter signs in textboxes -
Killer#Mummy - 20.07.2011
Is there any option to filter out '~' signs of textboxes, but allow colors '~r~,~y~,...'?
AW: Filter signs in textboxes -
Nero_3D - 20.07.2011
just search for them
than check if the cell after the next cell is another '~'
If thats the case it would be a color code
At least we check if the letter between is a valid one
If not you can delete everything
Same goes if there is no second '~'
Re: Filter signs in textboxes -
Daren_Jacobson - 20.07.2011
what about colors like ~triangle~ that isn't a real choice but once upon a time gave fun results.
Re: Filter signs in textboxes -
Killer#Mummy - 21.07.2011
Код:
for(new Position;Position < strlen(Text);Position++)
{
if(Text[Position] == '~')
{
if(Text[Position + 2] != EOS && Text[Position + 2] != '~')
{
Text[Position] = '-';
}
}
}
I made this piece of code, but unfortunately when I enter "~" in textdraw the client game crashes.

BTW: Is there any other signs that makes bug in textdraws or dialogs?
Re: Filter signs in textboxes -
Jay. - 21.07.2011
Quote:
Originally Posted by Killer#Mummy
Код:
for(new Position;Position < strlen(Text);Position++)
{
if(Text[Position] == '~')
{
if(Text[Position + 2] != EOS && Text[Position + 2] != '~')
{
Text[Position] = '-';
}
}
}
I made this piece of code, but unfortunately when I enter "~" in textdraw the client game crashes. 
BTW: Is there any other signs that makes bug in textdraws or dialogs?
|
Here you go , these are some that crash. only some , not all of them.
pawn Код:
if(strfind(params,":")!= -1 || strfind(params,"?")!= -1 || strfind(params,"<")!= -1 ||
strfind(params,"|")!= -1 || strfind(params,"\\")!= -1 || strfind(params,"*") != -1 || strfind(params,"\"")!= -1 ||
strfind(params,">")!= -1)
from my gm.
They have been tested, you can change it however you want like just copying them and not using my check.
I don't mind.