30.07.2012, 03:40
This may or may not work so don't blame me if it doesn't.
Possible Example:
Possible Output:
Welcome to my server! $cnNoob!
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;
}
Код:
printf("%s", CheckTD("~r~Welcome to~n~ $crmy server! $cg$cnNoob!"));
Welcome to my server! $cnNoob!