Textdraw Question
#2

This may or may not work so don't blame me if it doesn't.

pawn Код:
stock CheckTD(String[]) {
    for(new StringPos = 0; StringPos < strlen(String); StringPos++) {
        if(String[StringPos] == '~' && String[(StringPos + 2)] == '~') {
            switch(String[(StringPos + 1)]) {
                case 'n', 'r', 'g', 'b': {
                    strdel(String, StringPos, (StringPos + 2));
                    StringPos--;
                }
            }
        }
        else if(String[StringPos] == '$' && String[(StringPos + 1)] == 'c') {
            switch(String[(StringPos + 2)]) {
                case 'r', 'g', 'b': {
                    String[StringPos] = '~';
                    String[(StringPos + 1)] = String[(StringPos + 2)];
                    String[(StringPos + 2)] = '~';
                }
            }
        }
    }
    return String;
}
Possible Example:
Код:
printf("%s", CheckTD("~r~Welcome to~n~ $crmy server! $cg$cnNoob!"));
Possible Output:
Welcome to my server! $cnNoob!
Reply


Messages In This Thread
Textdraw Question - by andrew2695 - 29.07.2012, 23:40
Re: Textdraw Question - by Sniper Kitty - 30.07.2012, 03:40
Re : Textdraw Question - by andrew2695 - 30.07.2012, 06:34

Forum Jump:


Users browsing this thread: 2 Guest(s)