enum bInfo
{
bType,
bName[58],
bOwner[MAX_PLAYER_NAME],
bCreated,
bLocked,
bWorld,
bOwned,
bPrice,
bTill,
bAddress,
Float:bExtX,
Float:bExtY,
Float:bExtZ,
Float:bExtA,
Float:bIntX,
Float:bIntY,
Float:bIntZ,
Float:bIntA,
};
new str[40];
for(new bizid = 1; bizid < sizeof(BizInfo); bizid++)
{
new bstr[100];
format(str, sizeof(str), BPATH, bizid);
format(bstr, sizeof(bstr), "%s\nAddress:%d\nPrice:%d", BizInfo[bizid][bName], BizInfo[bizid][bAddress], BizInfo[bizid][bPrice]);
INI_ParseFile(str, "loadbiz_%d", .bExtra = true, .extra = bizid );
Create3DTextLabel(bstr, COLBLUE, BizInfo[bizid][bExtX], BizInfo[bizid][bExtY], BizInfo[bizid][bExtZ], 5, 0, true);
}
SetTimer("updatebiz", 500, true);
SetTimer("savebiz", 600000, true);
public OnGameModeExit()
{
new str[40];
for(new bizid = 1; bizid < sizeof(BizInfo); bizid++)
{
format(str, sizeof(str), BPATH, bizid);
SaveBusiness(bizid);
return 1;
}
printf("All businesses saved!");
return 1;
}
forward savebiz();
public savebiz()
{
new str[40];
for(new bizid = 1; bizid < sizeof(BizInfo); bizid++)
{
format(str, sizeof(str), BPATH, bizid);
SaveBusiness(bizid);
return 1;
}
printf("All businesses saved!");
return 1;
}
forward loadbiz_data(bizid, name[], value[]);
public loadbiz_data(bizid, name[], value[])
{
INI_Int("Type", BizInfo[bizid][bType]);
INI_ParseFile("Name", BizInfo[bizid][bName]);
INI_ParseFile("Owner", BizInfo[bizid][bOwner]);
INI_Int("Created", BizInfo[bizid][bCreated]);
INI_Int("Locked", BizInfo[bizid][bLocked]);
INI_Int("World", BizInfo[bizid][bWorld]);
INI_Int("Owned", BizInfo[bizid][bOwned]);
INI_Int("Price", BizInfo[bizid][bPrice]);
INI_Int("Till", BizInfo[bizid][bTill]);
INI_Int("Address", BizInfo[bizid][bAddress]);
INI_Float("Ext: X", BizInfo[bizid][bExtX]);
INI_Float("Ext: Y", BizInfo[bizid][bExtY]);
INI_Float("Ext: Z", BizInfo[bizid][bExtZ]);
INI_Float("Ext: A", BizInfo[bizid][bExtA]);
INI_Float("Int: X", BizInfo[bizid][bIntX]);
INI_Float("Int: Y", BizInfo[bizid][bIntY]);
INI_Float("Int: Z", BizInfo[bizid][bIntZ]);
INI_Float("Int: A", BizInfo[bizid][bIntA]);
return 1;
}
stock SaveBusiness(bizid)
{
new file1[40];
format(file1, sizeof(file1), BPATH, bizid);
new INI:File = INI_Open(file1);
INI_WriteInt(File, "Type", BizInfo[bizid][bType]);
INI_WriteString(File, "Name", BizInfo[bizid][bName]);
INI_WriteString(File, "Owner", BizInfo[bizid][bOwner]);
INI_WriteInt(File, "Created", BizInfo[bizid][bCreated]);
INI_WriteInt(File, "Locked", BizInfo[bizid][bLocked]);
INI_WriteInt(File, "World", BizInfo[bizid][bWorld]);
INI_WriteInt(File, "Owned", BizInfo[bizid][bOwned]);
INI_WriteInt(File, "Price", BizInfo[bizid][bPrice]);
INI_WriteInt(File, "Till", BizInfo[bizid][bTill]);
INI_WriteInt(File, "Address", BizInfo[bizid][bAddress]);
INI_WriteFloat(File, "Ext: X", BizInfo[bizid][bExtX]);
INI_WriteFloat(File, "Ext: Y", BizInfo[bizid][bExtY]);
INI_WriteFloat(File, "Ext: Z", BizInfo[bizid][bExtZ]);
INI_WriteFloat(File, "Ext: A", BizInfo[bizid][bExtA]);
INI_WriteFloat(File, "Int: X", BizInfo[bizid][bIntX]);
INI_WriteFloat(File, "Int: Y", BizInfo[bizid][bIntY]);
INI_WriteFloat(File, "Int: Z", BizInfo[bizid][bIntZ]);
INI_WriteFloat(File, "Int: A", BizInfo[bizid][bIntA]);
INI_Close(File);
return 1;
}
CMD:createbiz(playerid, params[])
{
new bizid;
for(new h = 1;h < sizeof(BizInfo);h++)
{
bizid = h;
break;
}
new Float:X, Float:Y, Float:Z;
GetPlayerPos(pid, X, Y, Z);
new string[255];
format(string, sizeof(string), "None");
BizInfo[bizid][bType] = 1;
strmid(BizInfo[bizid][bName], string, 0, strlen(string), 255);
strmid(BizInfo[bizid][bOwner], string, 0, strlen(string), 255);
BizInfo[bizid][bCreated] = 1;
BizInfo[bizid][bLocked] = 0;
BizInfo[bizid][bWorld] = 0;
BizInfo[bizid][bOwned] = 0;
BizInfo[bizid][bPrice] = 0;
BizInfo[bizid][bTill] = 0;
BizInfo[bizid][bAddress] = bizid;
BizInfo[bizid][bExtX] = X;
BizInfo[bizid][bExtY] = Y;
BizInfo[bizid][bExtZ] = Z;
BizInfo[bizid][bExtA] = 0;
BizInfo[bizid][bIntX] = 0;
BizInfo[bizid][bIntY] = 0;
BizInfo[bizid][bIntZ] = 0;
BizInfo[bizid][bIntA] = 0;
new file1[40];
format(file1, sizeof(file1), BPATH, bizid);
new INI:File = INI_Open(file1);
INI_SetTag(File, "Business Info");
INI_WriteInt(File, "Type", BizInfo[bizid][bType]);
INI_WriteString(File, "Name", BizInfo[bizid][bName]);
INI_WriteString(File, "Owner", BizInfo[bizid][bOwner]);
INI_WriteInt(File, "Locked", BizInfo[bizid][bLocked]);
INI_WriteInt(File, "World", BizInfo[bizid][bWorld]);
INI_WriteInt(File, "Owned", BizInfo[bizid][bOwned]);
INI_WriteInt(File, "Price", BizInfo[bizid][bPrice]);
INI_WriteInt(File, "Till", BizInfo[bizid][bTill]);
INI_WriteInt(File, "Address", BizInfo[bizid][bAddress]);
INI_WriteFloat(File, "Ext: X", BizInfo[bizid][bExtX]);
INI_WriteFloat(File, "Ext: Y", BizInfo[bizid][bExtY]);
INI_WriteFloat(File, "Ext: Z", BizInfo[bizid][bExtZ]);
INI_WriteFloat(File, "Ext: A", BizInfo[bizid][bExtA]);
INI_WriteFloat(File, "Int: X", BizInfo[bizid][bIntX]);
INI_WriteFloat(File, "Int: Y", BizInfo[bizid][bIntY]);
INI_WriteFloat(File, "Int: Z", BizInfo[bizid][bIntZ]);
INI_WriteFloat(File, "Int: A", BizInfo[bizid][bIntA]);
INI_Close(File);
SCM(pid, COLGREEN, "Server: {F0F0F0}Biz created.");
return 1;
}
That is because when you are loading the name and address you are using INI_Int instead of INI_String.
Edit: Also noticed some other mistakes. When you are formatting the 3d text label, you are using %d specifier for strings, when you mist use %d. The address seems to be string type, but at your enum it is integer. |
Ok I see you got another error, but is it the same as the first one?
|