String/File Help - 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: String/File Help (
/showthread.php?tid=336369)
String/File Help -
Deduction - 22.04.2012
Alright, so I am trying to figure out how to remove a word or something from a string.
I thought strdel may help, but what if I don't know the length of the string say if I had a list say,
1|2|3|4|5| and I wanted to delete both the 3|, how could I go around with doing it?
Searching the script only searches but how would I search where in the string it is.
So we have string which has been formatted with "1|2|3|4|5|"
I know from looking at that you would probably say Use strdel(string, 5, 6);
But no, im not just using 1|2|3|4|5|
I have it for weapon ids so it saves the weapon ids to a file, such as:
27|29|31|38|
And when I add a weapon it adds to the list, what I wanna do is when I remove the weapon id with a command, it removes it from the file.
How would I go about with this?
Since the contents of the file load into string.
Not using ini system.
Using Default file system.
Re: String/File Help -
IceCube! - 22.04.2012
Just use SSACNF I ccnat remember the old way
pawn Код:
sscanf(string, "p<|>iiiii", one, two, three, four, five);
If you'd like to do it the other way your going to have to wait for somone who remembers how.