SA-MP Forums Archive
Bad letters like " !?="#" and space etc.. - 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: Bad letters like " !?="#" and space etc.. (/showthread.php?tid=588297)



Bad letters like " !?="#" and space etc.. - Lajko1 - 07.09.2015

So I have this code

pawn Код:
ValidateWord(const string[]) {
    for( ; ; ) {
        switch(string[0]) {
            case 'a'..'z', '0'..'9', 'A'..'Z': {
                #emit load.s.pri string
                #emit add.c 4
                #emit stor.s.pri string
            }
            case EOS: {
                return true;
            }
            default: {
                break;
            }
        }
    }
    return false;
}
DialogResponse..
pawn Код:
else if (ValidateWord(inputtext)) // bad characters
                {
                    // Test text here..
                }
And it's not working.. How come ?
It doesn't send that SendClientMessage with "test" even if I insert any of those letters "#!#%?&$(/& etc


AW: Bad letters like " !?="#" and space etc.. - Kaliber - 07.09.2015

This function do sth different, you should do it like this:

PHP код:
stock ValideWord(const word[])
{
    new 
i;
    for( ; ; 
i++)
    {
        switch(
word[i]) {
            case 
'a'..'z''0'..'9''A'..'Z': continue;
            case 
EOS: return 1;
            default: break; 
        }
    }
    return 
0;




Re: Bad letters like " !?="#" and space etc.. - Lajko1 - 07.09.2015

Thanks