Brackets error (Pawno.exe has stopped responding)
#1

This isn't the first time I've had this issue. Last time I was able to fix it, but this time I know exactly what part of the script is doing it.
Код:
stock LoadHouse(houseid)
{
    new INI:File = INI_Open(HousePath(playerid));
    INI_SetTag(File,"data");
	format(File, 10, "/houses/%d.ini", houseid);
	if(!INI_Exists(File)) return 0;
	HouseInfo[houseid][hEnterX] = INI_Float(File, "EnterX");
	HouseInfo[houseid][hEnterY] = INI_Float(File, "EnterY");
	HouseInfo[houseid][hEnterZ] = INI_Float(File, "EnterZ");
	HouseInfo[houseid][hExitX] = INI_Float(File, "ExitX");
	HouseInfo[houseid][hExitY] = INI_Float(File, "ExitY");
	HouseInfo[houseid][hExitZ] = INI_Float(File, "ExitZ");
	HouseInfo[houseid][hInsideInt] = INI_Int(File, "InsideInt");
	HouseInfo[houseid][hInsideVir] = INI_Int(File, "InsideVir");
	HouseInfo[houseid][hOutsideInt] = INI_Int(File, "OutsideInt");
	HouseInfo[houseid][hOutsideVir] = INI_Int(File, "OutsideVir");
	HouseInfo[houseid][hOwned] = INI_Bool(File, "Owned");
	HouseInfo[houseid][hPrice] = INI_Int(File, "Price");
	INI_Close(File);
	return 1;
}
Код:
stock HousePath(playerid)
{
    new string[128],playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid,playername,sizeof(playername));
    format(string,sizeof(string),HOUSE_PATH,playername);
    return string;
}
Код:
enum hInfo
{
	Float:hEnterX,
    Float:hEnterY,
    Float:hEnterZ,
    Float:hExitX,
    Float:hExitY,
    Float:hExitZ,
    hInsideInt,
    hInsideVir,
    hOutsideInt,
    hOutsideVir,
    bool:hOwned,
    hOwner[MAX_PLAYER_NAME],
    hPrice,
    hIcon
}
Код:
#define HOUSE_PATH "/houses/%d.ini"
Код:
new HouseInfo[MAX_HOUSES][hInfo];
#define MAX_HOUSES 250
The first piece of code is the problem, if I comment that out, I can compile without a problem, but if I uncomment it then Pawno stops responding. I included everything related to the first piece of code to help you help me (lol :P)
Any help (even if it's just advice) will be much appreciated.
Reply
#2

Код:
HouseInfo[houseid][hOwner] = INI_Bool(File, "Owner");
and in the enum:

Код:
hOwner[MAX_PLAYER_NAME],
EDIT: it should be in the stock

Код:
HouseInfo[houseid][hOwned] = INI_Bool(File, "Owned");
or something like that,
Reply
#3

That didn't work. Thanks anyways
Reply
#4

Aha, found the problem.
I needed to put them like this
Код:
stock LoadHouse(houseid)
{
	new string[10];
	format(string, 10, HousePath(houseid);
	if(!INI_Exists(string)) return 0;
	INI_Float(string, "EnterX",HouseInfo[houseid][pEnterX]);
	INI_Float(string, "EnterY",HouseInfo[houseid][pEnterY]);
	INI_Float(string, "EnterZ",HouseInfo[houseid][pEnterZ]);
	INI_Float(string, "ExitX",HouseInfo[houseid][pExitX]);
	INI_Float(string, "ExitY",HouseInfo[houseid][pExitY]);
	INI_Float(string, "ExitZ",HouseInfo[houseid][pExitZ]);
	INI_Int(string, "Inside Interior",HouseInfo[houseid][pInsideInt]);
	INI_Int(string, "Inside Virtual World",HouseInfo[houseid][pInsideVir]);
	INI_Int(string, "Outside Interor",HouseInfo[houseid][hOutsideInt]);
	INI_Int(string, "Outside Virtual World",HouseInfo[houseid][hOutsideVir]);
	INI_Bool(string, "Owned",HouseInfo[houseid][hOwned]);
	INI_Int(string, "Price",HouseInfo[houseid][hPrice]);
	INI_Int(string, "Locked",HouseInfo[houseid][hLocked]);
	INI_Int(string, "Owner",HouseInfo[houseid][hOwner]);
	return 1;
}
instead of the way it was with the = inbetween
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)