SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 09/06/2014, 10:49 AM   #1
Runn3R
Huge Clucker
 
Runn3R's Avatar
 
Join Date: Dec 2013
Location: Croatia, Split
Posts: 396
Reputation: 35
Default Y_INI House Load

Solved.

Last edited by Runn3R; 11/03/2016 at 01:11 PM.
Runn3R is offline   Reply With Quote
Old 10/06/2014, 06:43 AM   #2
Runn3R
Huge Clucker
 
Runn3R's Avatar
 
Join Date: Dec 2013
Location: Croatia, Split
Posts: 396
Reputation: 35
Default Re: Y_INI House Load

bump nobody knows?
Runn3R is offline   Reply With Quote
Old 10/06/2014, 06:56 AM   #3
Laure
Gangsta
 
Laure's Avatar
 
Join Date: Apr 2012
Location: Blaine County
Posts: 624
Reputation: 33
Default Re: Y_INI House Load

Is it saving houses correctly so it loads it? Its a custom saving or is saved in Players char?
Laure is offline   Reply With Quote
Old 10/06/2014, 12:34 PM   #4
Runn3R
Huge Clucker
 
Runn3R's Avatar
 
Join Date: Dec 2013
Location: Croatia, Split
Posts: 396
Reputation: 35
Default Re: Y_INI House Load

Yes everything saves correctly but it doesn't load correctly.

Code:
[house]
Price = 20000
Owned = 1
VirtualWorld = 0
XPos = 2270.474853
YPos = -7.504103
ZPos = 28.153547
Owner = Kevin_Crawford
Runn3R is offline   Reply With Quote
Old 10/06/2014, 02:03 PM   #5
DrakeX
Banned
 
Join Date: Dec 2011
Posts: 73
Reputation: 49
Default Re: Y_INI House Load

pawn Code:
stock LoadHouses()//Creating the stock function
{
    new string[100];
    for(new i = 0; i < MAX_HOUSES; i ++)//Creates a loop, that goes through all of the HOUSES.
    {
        format(string, sizeof(string), "/Houses/HouseID%i.ini", i);//formats the file path, with the biz ID
        INI_ParseFile(string, "housedata", .bExtra = true, .extra = i );//This is very hard to explain, but it basically loads the info from the file(More in ****** y_ini tutorial.)
        HouseEnter[i] = CreateDynamicCP(HInfo[i][XPos], HInfo[i][YPos], HInfo[i][ZPos], 1.5, HInfo[i][VirtualWorld], -1, -1, 2);//Creating the checkpoint and storing it in the HouseEnter value.
        HouseExit[i] = CreateDynamicCP(443.9237, 509.4609, 1001.4195, 1.5, HInfo[i][VirtualWorld], -1, -1, 2);//Creating the house exit checkpoint and storing it in the HouseExit value.
        switch(HInfo[i][Owned])//Using the "switch" method to check if the house is owned
        {
            case 0: format(string, sizeof(string), "Owned: No\nPrice: %i", HInfo[i][Price]);//If it isnt...
            case 1: format(string, sizeof(string), "Owned: Yes\nPrice: %i\nOwner: %s", HInfo[i][Price], HInfo[i][Owner]);//If it is...
        }
        HInfo[i][HouseLabel] = Create3DTextLabel(string, 0xFF0000FF, HInfo[i][XPos], HInfo[i][YPos], HInfo[i][ZPos], 25.0, HInfo[i][VirtualWorld]);//Creating the label with the formatted string.
        HouseCount ++;//+ counting the HouseCount var.
    }
    return 1;
}


forward housedata(id, name[], value[]);
public housedata(id, name[], value[])
{
    INI_Int("Owned", HInfo[id][Owned]);
    INI_Float("XPos", HInfo[id][XPos]);
    INI_Float("YPos", HInfo[id][YPos]);
    INI_Float("ZPos", HInfo[id][ZPos]);
    INI_Int("VirtualWorld", HInfo[id][VirtualWorld]);
    INI_String("Owner", HInfo[id][Owner], 24);
    return 1;
}
DrakeX is offline   Reply With Quote
Old 10/06/2014, 08:45 PM   #6
Runn3R
Huge Clucker
 
Runn3R's Avatar
 
Join Date: Dec 2013
Location: Croatia, Split
Posts: 396
Reputation: 35
Default Re: Y_INI House Load

Still not working. I have done printf("Loading house id%d", id); and it doesn't even print it at all i don't think the function is called right but ongamemodeinit i have LoadHouses();
Runn3R is offline   Reply With Quote
Old 10/06/2014, 09:10 PM   #7
ReD_HunTeR
Gangsta
 
ReD_HunTeR's Avatar
 
Join Date: Nov 2012
Posts: 574
Reputation: 54
Default Re: Y_INI House Load

Runn3R ? YINI Close slowly so it cant be saved while typing in OnGameModeExit or OnFilterScriptExit
Put
pawn Code:
SaveHouse();
in all house commands then it will work for sure
ReD_HunTeR is offline   Reply With Quote
Old 10/06/2014, 09:29 PM   #8
Runn3R
Huge Clucker
 
Runn3R's Avatar
 
Join Date: Dec 2013
Location: Croatia, Split
Posts: 396
Reputation: 35
Default Re: Y_INI House Load

Yeah it's already like that on every command like (createhouse, buyhouse, sellhouse).

But the loading only seems to be an issue.
Runn3R is offline   Reply With Quote
Old 15/06/2014, 03:25 PM   #9
Runn3R
Huge Clucker
 
Runn3R's Avatar
 
Join Date: Dec 2013
Location: Croatia, Split
Posts: 396
Reputation: 35
Default Re: Y_INI House Load

Bump
Runn3R is offline   Reply With Quote
Old 15/06/2014, 03:32 PM   #10
RenovanZ
Gangsta
 
RenovanZ's Avatar
 
Join Date: Jul 2012
Location: Jogjakarta, Indonesia
Posts: 598
Reputation: 32
Default Re: Y_INI House Load

Change this:
pawn Code:
forward housedata_id(i, name[], value[]);
public housedata_id(i, name[], value[])
To this:
pawn Code:
forward housedata_data(i, name[], value[]);
public housedata_data(i, name[], value[])
Its should be data, not id.
__________________
__________________________________________________
My Work(s)
__________________________________________________

RenovanZ is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Y_INI not load cuchipkg Scripting Help 0 19/04/2014 02:32 PM
Y_Ini won't Load Player / House data.. (suddenly) erminpr0 Scripting Help 0 16/11/2013 10:56 PM
y_ini load Vegas. Scripting Help 3 16/09/2013 06:10 PM
y_ini load. Vegas. Scripting Help 2 06/03/2013 09:38 AM
y_ini load Rock_Ro Help Archive 4 09/04/2011 08:10 PM


All times are GMT. The time now is 07:53 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.