20.06.2012, 05:53
Код:
stock Seperate(Source[], Destination[][], Seperater) {
new DestinationNum = 0,
DestinationPos = 0;
for(new SourcePos = 0; Source[SourcePos]; SourcePos++) {
if(Source[SourcePos] != Seperater) {
Destination[DestinationNum][DestinationPos] = Source[SourcePos];
DestinationPos++;
} else {
if(strlen(Destination[DestinationNum]) > 0) {
DestinationNum++;
DestinationPos = 0;
}
}
}
return true;
}
But there's a feature I want added to it.
Код:
public OnGameModeInit() {
new Result[5][100];
Seperate("23 Hello World! 54.5 How ya doing?", Result, ' ');
printf("%s %s %s", Result[1], Result[2], Result[4]);
return true;
}
Quote:
|
Hello World! How |
I want it to display,
Quote:
|
Hello World! How ya doing? |
I want it so if the person new Result[2][100]; it will ignore the Seperater after it is done creating Result[1].
I want it so if the person new Result[5][100]; it will ignore the Seperater after it is done creating Result[4].

