INI_ParseFIle not working? [Rep+4]
#9

Okay guys, well I have managed to fix the login system etc., but I am still confused about why my houses aren't loading properly. The labels and pickups are being created, but for some reason it's not reading the X, Y and Z positions of the house. Does this have any relevance to using INI_Float? The /addhouse command works fine, but when the server is restarted, all pickups and labels are spawning at 0, 0, 0. Which I am guessing, means that it isn't loading the PosX, PosY and PosZ variables with INI_ParseFile.

Addhouse command:
pawn Код:
CMD:addhouse(playerid,params[])
{
    if(!IsPlayerAdmin(playerid) || Player[playerid][Admin] < 10) return SendClientMessage(playerid, red, "ERROR: {FFFFFF}You Have Entered An Invalid Command. Please Read {00FF00}/CMDS{FFFFFF}.");
    for(new i = 0; i < MAX_HOUSES; i++)
    {
        new string[50];
        format(string,sizeof(string),HOUSEPATH,i);
        if(!fexist(string))
        {
            new Float:X, Float:Y, Float:Z;
            GetPlayerPos(playerid, X, Y, Z);
            INI_ParseFile(string, "LoadHouse_%i", .bExtra = true, .extra = i);
            House[i][Pickup] = CreateDynamicPickup(1272, 1, X, Y, Z);
            House[i][PosX] = X;
            House[i][PosY] = Y;
            House[i][PosZ] = Z;
            House[i][Owned] = 0;
            format(string,sizeof(string),"For Sale");
            House[i][OwnerName] = string;
            format(string,sizeof(string),"House ID %d", i);
            House[i][Name] = string;
            format(string,sizeof(string),"No Key Holder");
            House[i][Key1] = string;
            House[i][Key2] = string;
            House[i][Key3] = string;
            format(string,sizeof(string),"House: %s\nOwner: %s\nID: %d",House[i][Name],House[i][OwnerName],i);
            House[i][Label] = CreateDynamic3DTextLabel(string, green, House[i][PosX], House[i][PosY], House[i][PosZ], 100.00);
            format(string,sizeof(string),"You Have Successfully Created House ID %d", i);
            SendClientMessage(playerid, green, string);
            SaveHouse(i);
            break;
        }
        continue;
    }
    return 1;
}
Reply


Messages In This Thread
INI_ParseFIle not working? - by clarencecuzz - 24.09.2012, 06:26
Re: INI_ParseFIle not working? [Rep+4] - by Jarnu - 24.09.2012, 08:51
Re: INI_ParseFIle not working? [Rep+4] - by Jarnu - 24.09.2012, 09:03
Re: INI_ParseFIle not working? [Rep+4] - by antonio112 - 24.09.2012, 09:13
Re: INI_ParseFIle not working? [Rep+4] - by clarencecuzz - 24.09.2012, 09:54
Re: INI_ParseFIle not working? [Rep+4] - by antonio112 - 24.09.2012, 11:10
Re: INI_ParseFIle not working? [Rep+4] - by clarencecuzz - 24.09.2012, 11:23
Re: INI_ParseFIle not working? [Rep+4] - by antonio112 - 24.09.2012, 20:42
Re: INI_ParseFIle not working? [Rep+4] - by clarencecuzz - 25.09.2012, 06:54
Re: INI_ParseFIle not working? [Rep+4] - by clarencecuzz - 25.09.2012, 07:32

Forum Jump:


Users browsing this thread: 2 Guest(s)