what's wrong -.-
#1

pawn Код:
public AddBuilding(Float:x, Float:y, Float:z, interior, Float:x2, Float:y2, Float:z2, interior2, name[])
{
    new file[128];
    for(new i=0;i<MAX_BS;i++)
    {
        format(file, sizeof(file), "Budynki/%d.ini", i);
        if(!fexist(file))
        {
            dini_Create(file);
            dini_FloatSet(file, "ExX", x);
            dini_FloatSet(file, "ExY", y);
            dini_FloatSet(file, "ExZ", z);
            dini_IntSet(file, "ExInt", interior);
            dini_FloatSet(file, "InX", x2);
            dini_FloatSet(file, "InY", y2);
            dini_FloatSet(file, "InZ", z2);
            dini_IntSet(file, "InInt", interior2);
            dini_Set(file, "Name", name);
            dini_IntSet(file, "Faction", 0);
            LoadBuilding(i);
            break;
        }
    }
    return 1;
}
public LoadBuilding(id)
{
    new file[128], name[128];
    format(file, sizeof(file), "Budynki/%d.ini", id);
    BuildingInfo[id][bExteriorX] = dini_Float(file, "ExX");
    BuildingInfo[id][bExteriorY] = dini_Float(file, "ExY");
    BuildingInfo[id][bExteriorZ] = dini_Float(file, "ExZ");
    BuildingInfo[id][bExteriorIntID] = dini_Int(file, "ExInt");
    BuildingInfo[id][bInteriorX] = dini_Float(file, "InX");
    BuildingInfo[id][bInteriorY] = dini_Float(file, "InY");
    BuildingInfo[id][bInteriorZ] = dini_Float(file, "InZ");
    BuildingInfo[id][bInteriorIntID] = dini_Int(file, "InInt");
    format(name, sizeof(name), "%s", dini_Get(file, "Name"));
    BuildingInfo[id][bName] = name;
    BuildingInfo[id][bFaction] = dini_Int(file, "Faction");
    return 1;
}
COMMAND:enter(playerid, params[])
{
    for(new i=0;i<MAX_BS;i++)
    {
        if(PlayerToPoint(3.0, playerid, BuildingInfo[i][bExteriorX], BuildingInfo[i][bExteriorY], BuildingInfo[i][bExteriorZ]))
        {
            SetPlayerPos(playerid, BuildingInfo[i][bInteriorX], BuildingInfo[i][bInteriorY], BuildingInfo[i][bInteriorZ]);
        }
    }
    return 1;
}
Okey, so this code creates a building, then loads it. When i type /enter in the place where it was created nothing happens What's wrong?
Reply
#2

are you sure the parameters of "PlayerToPoint" are in the right order?
not seeing anything else atm..
Reply
#3

Yeah its X, Y ,Z. I'm encountering this thing very often. I have done something like 5 dynamic entrances systems and all failed at /enter -.-
Reply
#4

Use prints
Reply
#5

it looks like
pawn Код:
if(PlayerToPoint(3.0, playerid, BuildingInfo[i][bExteriorX], BuildingInfo[i][bExteriorY], BuildingInfo[i][bExteriorZ]))
doesnt read coordinates correctly.
Reply
#6

Are bInteriorX, bInteriorY and bInteriorZ floats ?
Also are the coords being saved correctly in the files ?
Reply
#7

Are you even setting the interior and virtual world? Uh no...why not try setting that and then magically the command may work.
Reply
#8

BIn(Ex)teriorX etc are floats. Man i even set entrance at cj house doors and interior few steps back... And it still fails so virtual world and interior don't matter. And yes, the files are being saved correctly to files, because i can check them within scriptfiles.
Reply
#9

I think i can bump now
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)