SA-MP Forums Archive
GarHouse HouseCars not Loading? - 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: GarHouse HouseCars not Loading? (/showthread.php?tid=370567)



GarHouse HouseCars not Loading? - Admigo - 20.08.2012

Heey all,
I am using GarHouse filterscript for making house and saving house cars.
But when i saved a housecar somewhere and i do server restart it dont even load the car only the house.
I already allowed housecars.
pawn Код:
//command to save the vehicles.
CMD:addhcar(playerid, params[])
{
    new h;
    if(!IsPlayerAdmin(playerid)) return 0;
    if(!IsPlayerInAnyVehicle(playerid)) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_HCAR_NOT_IN_VEH);
    if(sscanf(params, "d", h)) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_CMD_USAGE_ADDHCAR);
    if(!fexist(HouseFile(h))) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_INVALID_HID);
    else
    {
        if(hInfo[h][HouseCar] == 1) { ShowInfoBox(playerid, I_HCAR_EXIST_ALREADY, h); }
        if(hInfo[h][HouseCar] == 0) { ShowInfoBox(playerid, I_HCAR_CREATED, h); }
        GetVehiclePos(GetPlayerVehicleID(playerid), X, Y, Z);
        GetVehicleZAngle(GetPlayerVehicleID(playerid), Angle);
        new world = GetPlayerVirtualWorld(playerid), interior = GetPlayerInterior(playerid);
        hInfo[h][HouseCar] = 1, hInfo[h][HouseCarPosX] = X, hInfo[h][HouseCarPosY] = Y, hInfo[h][HouseCarPosZ] = Z, hInfo[h][HouseCarAngle] = Angle;
        hInfo[h][HouseCarModel] = GetVehicleModel(GetPlayerVehicleID(playerid)), hInfo[h][HouseCarInterior] = interior, hInfo[h][HouseCarWorld] = world;
        new INI:file = INI_Open(HouseFile(h));
        INI_WriteFloat(file, "HCarPosX", X);
        INI_WriteFloat(file, "HCarPosY", Y);
        INI_WriteFloat(file, "HCarPosZ", Z);
        INI_WriteFloat(file, "HCarAngle", Angle);
        INI_WriteInt(file, "HCar", 1);
        INI_WriteInt(file, "HCarWorld", world);
        INI_WriteInt(file, "HCarInt", interior);
        INI_WriteInt(file, "HCarModel", hInfo[h][HouseCarModel]);
        INI_Close(file);
    }
    return 1;
}
//for loading the stats
pawn Код:
function LoadHouseData(h, name[], value[])
{
    if(!strcmp(name, "HouseName", true)) { format(hInfo[h][HouseName], MAX_HOUSE_NAME, "%s", value); }
    if(!strcmp(name, "HouseOwner", true)) { format(hInfo[h][HouseOwner], MAX_PLAYER_NAME, "%s", value); }
    if(!strcmp(name, "HouseLocation", true)) { format(hInfo[h][HouseLocation], MAX_ZONE_NAME, "%s", GetHouseLocation(h)); }
    if(!strcmp(name, "HousePassword", true))
    {
        switch(strcmp(value, "INVALID_HOUSE_PASSWORD", true))
        {
            case 0: hInfo[h][HousePassword] = udb_hash(value);
            case 1: hInfo[h][HousePassword] = strval(value);
        }
    }
    if(!strcmp(name, "SpawnOutX", true)) { hInfo[h][SpawnOutX] = floatstr(value); }
    if(!strcmp(name, "SpawnOutY", true)) { hInfo[h][SpawnOutY] = floatstr(value); }
    if(!strcmp(name, "SpawnOutZ", true)) { hInfo[h][SpawnOutZ] = floatstr(value); }
    if(!strcmp(name, "SpawnOutAngle", true)) { hInfo[h][SpawnOutAngle] = floatstr(value); }
    if(!strcmp(name, "SpawnInterior", true)) { hInfo[h][SpawnInterior] = strval(value); }
    if(!strcmp(name, "SpawnWorld", true)) { hInfo[h][SpawnWorld] = strval(value); }
    if(!strcmp(name, "CPOutX", true)) { hInfo[h][CPOutX] = floatstr(value); }
    if(!strcmp(name, "CPOutY", true)) { hInfo[h][CPOutY] = floatstr(value); }
    if(!strcmp(name, "CPOutZ", true)) { hInfo[h][CPOutZ] = floatstr(value); }
    if(!strcmp(name, "HouseValue", true)) { hInfo[h][HouseValue] = strval(value); }
    if(!strcmp(name, "HouseStorage", true)) { hInfo[h][HouseStorage] = strval(value); }
    if(!strcmp(name, "HouseInterior", true)) { hInfo[h][HouseInterior] = strval(value); }
    if(!strcmp(name, "HouseWorld", true)) { hInfo[h][SpawnWorld] = strval(value); }
    if(!strcmp(name, "HouseCar", true)) { hInfo[h][HouseCar] = strval(value); }
    if(!strcmp(name, "HCarPosX", true)) { hInfo[h][HouseCarPosX] = floatstr(value); }
    if(!strcmp(name, "HCarPosY", true)) { hInfo[h][HouseCarPosY] = floatstr(value); }
    if(!strcmp(name, "HCarPosZ", true)) { hInfo[h][HouseCarPosZ] = floatstr(value); }
    if(!strcmp(name, "HCarAngle", true)) { hInfo[h][HouseCarAngle] = floatstr(value); }
    if(!strcmp(name, "HCarModel", true)) { hInfo[h][HouseCarModel] = strval(value); }
    if(!strcmp(name, "HCarWorld", true)) { hInfo[h][HouseCarWorld] = strval(value); }
    if(!strcmp(name, "HCarInt", true)) { hInfo[h][HouseCarInterior] = strval(value); }
    if(!strcmp(name, "QuitInHouse", true)) { hInfo[h][QuitInHouse] = strval(value); }
    if(!strcmp(name, "ForSale", true)) { hInfo[h][ForSale] = strval(value); }
    if(!strcmp(name, "ForSalePrice", true)) { hInfo[h][ForSalePrice] = strval(value); }
    if(!strcmp(name, "HousePrivacy", true)) { hInfo[h][HousePrivacy] = strval(value); }
    if(!strcmp(name, "HouseAlarm", true)) { hInfo[h][HouseAlarm] = strval(value); }
    if(!strcmp(name, "HouseCamera", true)) { hInfo[h][HouseCamera] = strval(value); }
    if(!strcmp(name, "HouseDog", true)) { hInfo[h][HouseDog] = strval(value); }
    if(!strcmp(name, "HouseUpgradedLock", true)) { hInfo[h][UpgradedLock] = strval(value); }
    return 0;
}
//for loading the vehicles
pawn Код:
stock LoadHouseCar(houseid)
{
    if(fexist(HouseFile(houseid)) && hInfo[houseid][HouseCar] == 1)
    {
        HCar[houseid] = CreateVehicle(hInfo[houseid][HouseCarModel], hInfo[houseid][HouseCarPosX], hInfo[houseid][HouseCarPosY], hInfo[houseid][HouseCarPosZ], hInfo[houseid][HouseCarAngle], HCAR_COLOUR1, HCAR_COLOUR2, HCAR_RESPAWN);
        SetVehicleVirtualWorld(HCar[houseid], hInfo[houseid][HouseCarWorld]);
        LinkVehicleToInterior(HCar[houseid], hInfo[houseid][HouseCarInterior]);
    }
    return 1;
}
How can i fix this?

Thanks Admigo


Re: GarHouse HouseCars not Loading? - edzuss99 - 20.08.2012

Do you have newest includes ?


Re: GarHouse HouseCars not Loading? - Admigo - 20.08.2012

Yes i have,if i look in the scriptfiles i see its saving but not loading.


Re: GarHouse HouseCars not Loading? - Admigo - 24.08.2012

Anyone? I really need this!


Re: GarHouse HouseCars not Loading? - Jstylezzz - 24.08.2012

there should be a define at the beginning, that says,#define USE_HOUSECARS false
if you change false into true, it will load them
not sure if this is exact as what i said above, but search for something like that


Re: GarHouse HouseCars not Loading? - Admigo - 25.08.2012

Quote:
Originally Posted by Jari_Johnson*
Посмотреть сообщение
there should be a define at the beginning, that says,#define USE_HOUSECARS false
if you change false into true, it will load them
not sure if this is exact as what i said above, but search for something like that
Thats already True. I still got the problem. Can you test if it works at u?