FileManager 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: FileManager help (
/showthread.php?tid=330073)
FileManager help -
TheLazySloth - 31.03.2012
I need help with
FileManager 1.2
What am I doing wrong?
pawn Код:
stock SaveServer(Stat[], format[], {Float,_}) {
if(!dir_exists("Saved/")) dir_create("Saved/");
if(!dir_exists("Saved/Server/")) dir_create("Saved/Server/");
new File[100],
String[100];
format(File, 100, ServerFile, Stat); // #define ServerFile "Saved/Server/Saved_%s.ini"
if(file_exists(File)) file_delete(File);
switch(format[0]) {
case 's', 'z': {
new Result[100];
for(new ResultPos = 0; getarg(3, ResultPos) != 0; ResultPos++) {
Result[ResultPos] = getarg(3, ResultPos);
}
format(String, 100, "%s", Result);
}
case 'd', 'i': {
new Result = getarg(3);
format(String, 100, "%d", Result);
}
case 'f', : {
new Float: Result = Float: getarg(3);
format(String, 100, "%f", Result);
}
}
file_create(File);
file_write(File, String);
printf("%s", String);
return true;
}
When it saves, it doesn't save the correct value.
Edit:
I've noticed:
- All strings save as
0€
- All values save as
35120
- Floats are at random.
Re: FileManager help -
TheLazySloth - 06.04.2012
Still need help, please and thank you.
Re: FileManager help -
Harish - 06.04.2012
pawn Код:
//this is for string to add
new result[128];
for(new ResultPos = 0; getarg(3, ResultPos) != 0; ResultPos++) {
Result[ResultPos] = getarg(3, ResultPos);
StrCat(result,Result,sizeof(result));//or try this StrCat(result,Result[ResultPos],sizeof(result));
}
format(String, 100, "%s", result);
and make sure this for float
{Float,_}:...
and here is the tutorial
https://sampforum.blast.hk/showthread.php?tid=77000
Re: FileManager help -
TheLazySloth - 18.04.2012
No this did not help. I just made my own file saving system, so this is no longer needed.