Seperate - 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: Seperate (
/showthread.php?tid=352524)
Seperate -
TheLazySloth - 20.06.2012
Код:
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;
}
This code runs fine, I made and tested it myself.
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;
}
Right now that code will display,
in the server.log.
I want it to display,
Quote:
Hello World! How ya doing?
|
instead.
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].
Re: Seperate -
TheLazySloth - 02.07.2012
Would still love help.