sscanf special characters
#9

Perhaps go through the ZCMD topic to see if the issue about special characters has been gone over before.

If not, I could suggest another method: automatic parsing of command input so you don't need to run string comparisons for each of your commands.

1. Use the callback which is fired after the server tries to execute, but does not succeed. I think the callback should be OnPlayerCommandPerformed(playerid, cmdtext[], success).
2. See if the command was not performed successfully. If it wasn't, continue.
3. Replace all "х"-s with 8 for example using a loop.
pawn Код:
if(!success)
{
    for(new i = 0, j = strlen(cmdtext); i != j; i++)
    {
        if(cmdtext[i] == 'х') cmdtext[i] = '8';
        else if(cmdtext[i] == 'ь') cmdtext[i] = 'y';
    }
}
4. Re-run the command using CallLocalFunction similarly to the way zcmd does it.

Perhaps this would be a way to solve it in a bit better fashion rather than comparing for each command. This would probably be better at a large amount of commands performance-wise as well.

Maybe I'm overcomplicating this, though.
Reply


Messages In This Thread
sscanf special characters - by King Ace - 26.12.2012, 17:03
Re: sscanf special characters - by Strier - 26.12.2012, 18:16
Re: sscanf special characters - by King Ace - 26.12.2012, 18:24
Re: sscanf special characters - by Devilxz97 - 26.12.2012, 18:28
Re: sscanf special characters - by Konstantinos - 26.12.2012, 18:28
Re: sscanf special characters - by King Ace - 26.12.2012, 18:32
Re: sscanf special characters - by AndreT - 26.12.2012, 18:46
Re: sscanf special characters - by King Ace - 26.12.2012, 18:56
Re: sscanf special characters - by AndreT - 26.12.2012, 19:02

Forum Jump:


Users browsing this thread: 1 Guest(s)