Stopping a string - 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: Stopping a string (
/showthread.php?tid=455486)
Stopping a string -
Luis- - 01.08.2013
Right fellas! I making a code which uses a "next page" & "previous page" function, but I can't figure out how to stop a string from processing, i've tried using EOS but, had no luck. Here's an example;
- Item 1.
- Item 2.
- Item 3.
- Next Page.
AW: Stopping a string -
BigETI - 02.08.2013
Please show us some code.
Re: Stopping a string -
Luis- - 02.08.2013
Why would I need to show code? I just asked for an example. I'd rather not give part of my code.
Re: Stopping a string -
park4bmx - 02.08.2013
I don't get what exactly ur Tring to do!
Explain more ?
What u mean stop a string from processing ? What/how is it processing ?
Edit
Inserting
\0 end of string wouldn't really stop it as that is to indicate the end of it for functions to know when to finish checking etc.
Re: Stopping a string -
Luis- - 02.08.2013
Here's the code.
pawn Код:
new String[950], String1[155];
switch(dealerid) {
case 3: {
for(new i = pageNum; i != sizeof medClass; i++) {
format(String1, sizeof String1, "{FFFFFF}%d\t{BE69FF}%s {21DB00}$%s", i, VehicleNames[medClass[i][dModel] - 400], number_format(medClass[i][dPrice]));
strcat(String, "\n");
if(i >= 10) {
strcat(String, "\n\n");
strcat(String, "Next Page >>");
}
strcat(String, String1);
String[0] = EOS;
}
ShowPlayerDialog(playerid, DIALOG_LOW_DEALER, DIALOG_STYLE_LIST, "Low Class Dealership", String, "Purchase", "Cancel");
}
}
AW: Stopping a string -
BigETI - 02.08.2013
You are actually NULL terminating the "String" string at it's first character. And I don't see a point using "\n\n" in a list dialog.
Re: Stopping a string -
park4bmx - 02.08.2013
There is a better way in doing this but I can't show u now.
pawn Код:
new String[950], String1[155];
switch(dealerid) {
case 3: {
for(new i = pageNum; i != sizeof medClass; i++) {
format(String1, sizeof String1, "{FFFFFF}%d\t{BE69FF}%s {21DB00}$%s/n", i, VehicleNames[medClass[i][dModel] - 400], number_format(medClass[i][dPrice]));
strins(String,String1,0);
if(i >= 9) {
strins(String, "Next Page >>",strlen(String));
break;
}
}
ShowPlayerDialog(playerid, DIALOG_LOW_DEALER, DIALOG_STYLE_LIST, "Low Class Dealership", String, "Purchase", "Cancel");
}
}
then u need to figure out how ur data is stored some showe the next page,
I migh done so mistakes as I'm on the phone