Housing system help..?
#1

I'm new to using Dini, so I'm wondering, what's wrong with this? I've looked everything up I possibly can, and can't figure out why it's not working.

pawn Код:
stock SaveHouse(houseid)
{
    new fstring[10];
    format(fstring, 10, "Houses/%d", houseid);
    if(!dini_Exists(fstring)) return 0;
   
    dini_FloatSet(fstring, "EnterX", HouseInfo[houseid][hEnterX]);
    dini_FloatSet(fstring, "EnterY", HouseInfo[houseid][hEnterY]);
    dini_FloatSet(fstring, "EnterZ", HouseInfo[houseid][hEnterZ]);
    dini_FloatSet(fstring, "ExitX", HouseInfo[houseid][hExitX]);
    dini_FloatSet(fstring, "ExitY", HouseInfo[houseid][hExitY]);
    dini_FloatSet(fstring, "ExitZ", HouseInfo[houseid][hExitZ]);
    dini_IntSet(fstring, "InsideInt", HouseInfo[houseid][hInsideInt]);
    dini_IntSet(fstring, "InsideVir", HouseInfo[houseid][hInsideVir]);
    dini_IntSet(fstring, "OutsideInt", HouseInfo[houseid][hOutsideInt]);
    dini_IntSet(fstring, "OutsideVir", HouseInfo[houseid][hOutsideVir]);
    dini_BoolSet(fstring, "Owned", HouseInfo[houseid][hOwned]);
    dini_Get(fstring, "Owner", HouseInfo[houseid][hOwner]);
    dini_IntSet(fstring, "Price", HouseInfo[houseid][hPrice]);
    dini_IntSet(fstring, "HV_Model", HouseInfo[houseid][hVecModel]);
    dini_FloatSet(fstring, "HV_PosX", HouseInfo[houseid][hVecX]);
    dini_FloatSet(fstring, "HV_PosZ", HouseInfo[houseid][hVecY]);
    dini_Float(fstring, "HV_PosZ", HouseInfo[houseid][hVecZ]);
    dini_Float(fstring, "HV_PosA", HouseInfo[houseid][hVecA]);
    return 1;
}
Enum:

pawn Код:
enum hInfo
{
    Float:hEnterX,
    Float:hEnterY,
    Float:hEnterZ,
    Float:hExitX,
    Float:hExitY,
    Float:hExitZ,
    hOutsideInt,
    hOutsideVir,
    hInsideInt,
    hInsideVir,
    InsideInt,
    InsideVir,
    OutsideInt,
    OutsideVir,
    bool:hOwned,
    hOwner[MAX_PLAYER_NAME],
    hPrice,
    hPickup,
    hVecModel,
    Float:hVecX,
    Float:hVecY,
    Float:hVecZ,
    Float:hVecA
};
new HouseInfo[MAX_HOUSES][hInfo];
Errors:

(1692) : warning 202: number of arguments does not match definition ( dini_Get(fstring, "Owner", HouseInfo[houseid][hOwner]); )
(1697) : warning 202: number of arguments does not match definition ( dini_Float(fstring, "HV_PosZ", HouseInfo[houseid][hVecZ]); )
(169 : warning 202: number of arguments does not match definition ( dini_Float(fstring, "HV_PosA", HouseInfo[houseid][hVecA]); )
Reply
#2

First of all

Код:
format(fstring, 10, "Houses/%d", houseid);
%d is not a file, use "%d.ini"

and dini_Get, dini_Float and dini_Int use these parameters:

dini_Get(file,name);

So do it like this:

Код:
strmid(HouseInfo[houseid][hOwner],dini_Get(fstring,"Owner"),0,255,255);
HouseInfo[houseid][hVecZ] = dini_Float(fstring,"HV_PosZ");
HouseInfo[houseid][hVecA] = dini_Float(fstring,"HV_PosA");
rep me if it helped
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)