what's wrong -.- - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: what's wrong -.- (
/showthread.php?tid=243362)
what's wrong -.- -
sekol - 22.03.2011
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?
Re: what's wrong -.- -
Sascha - 22.03.2011
are you sure the parameters of "PlayerToPoint" are in the right order?
not seeing anything else atm..
Re: what's wrong -.- -
sekol - 22.03.2011
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 -.-
Re: what's wrong -.- -
Jefff - 22.03.2011
Use prints
Re: what's wrong -.- -
sekol - 22.03.2011
it looks like
pawn Код:
if(PlayerToPoint(3.0, playerid, BuildingInfo[i][bExteriorX], BuildingInfo[i][bExteriorY], BuildingInfo[i][bExteriorZ]))
doesnt read coordinates correctly.
Re: what's wrong -.- -
dice7 - 22.03.2011
Are bInteriorX, bInteriorY and bInteriorZ floats ?
Also are the coords being saved correctly in the files ?
Re: what's wrong -.- -
Steven82 - 22.03.2011
Are you even setting the interior and virtual world? Uh no...why not try setting that and then magically the command may work.
Re: what's wrong -.- -
sekol - 23.03.2011
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.
Re: what's wrong -.- -
sekol - 24.03.2011
I think i can bump now