Y_Ini file isn't saving right - 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: Y_Ini file isn't saving right (
/showthread.php?tid=417610)
Y_Ini file isn't saving right -
Noles2197 - 21.02.2013
My files that are made are saving as, "%i" in my 'Houses' folder. I'm not sure if this is the solution, but when I try to turn..
pawn Код:
new INI:file = INI_Open(HousePath),str[128];
to
new INI:file = INI_Open(HousePath(id)),str[128];
I get..
pawn Код:
C:\Users\Redcorn\Desktop\Your Life\gamemodes\sanfierro.pwn(113) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Users\Redcorn\Desktop\Your Life\gamemodes\sanfierro.pwn(113) : warning 215: expression has no effect
C:\Users\Redcorn\Desktop\Your Life\gamemodes\sanfierro.pwn(113) : error 001: expected token: ";", but found ")"
C:\Users\Redcorn\Desktop\Your Life\gamemodes\sanfierro.pwn(113) : error 029: invalid expression, assumed zero
C:\Users\Redcorn\Desktop\Your Life\gamemodes\sanfierro.pwn(113) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
Original:
pawn Код:
#define HousePath "Houses/%i.ini"
CMD:create(playerid,params[])
{
if(pInfo[playerid][Admin]==3)
{
new model,Float:x,Float:y,Float:z,interior,id;
if(sscanf(params,"i",model,interior)) return SendClientMessage(playerid,COLOR_GRAY,"USAGE: /create [model] [interior]");
id = hcount;
hInfo[id][Xpos] = x;
hInfo[id][Ypos] = y;
hInfo[id][Zpos] = z;
hInfo[id][World] = GetPlayerVirtualWorld(playerid);
hInfo[id][Interior] = GetPlayerInterior(playerid);
GetPlayerPos(playerid,x,y,z);
new INI:file = INI_Open(HousePath),str[128]; // here
format(str,sizeof(str),"%f,%f,%f",x,y,z);
INI_WriteString(file,"%f,%f,%f",str);
INI_Close(file);
CreateDynamicPickup(model,1,x,y,z,GetPlayerVirtualWorld(playerid));
}
return 1;
}
Re: Y_Ini file isn't saving right -
JJB562 - 22.02.2013
Hm.. Try moving down "str[128]" to a new line. So instead of:
pawn Код:
new INI:file = INI_Open(HousePath),str[128];
Do:
pawn Код:
new INI:file = INI_Open(HousePath);
new str[128];
EDIT: Now that I looked at the code again.
You did:
pawn Код:
if(sscanf(params,"i",model,interior)) return SendClientMessage(playerid,COLOR_GRAY,"USAGE: /create [model] [interior]");
Instead of:
pawn Код:
if(sscanf(params,"ii",model,interior)) return SendClientMessage(playerid,COLOR_GRAY,"USAGE: /create [model] [interior]");