SA-MP Forums Archive
Variable getting a weird value - 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: Variable getting a weird value (/showthread.php?tid=424612)



Variable getting a weird value - Maxips2 - 23.03.2013

For some reason, a variable I am using to store interior ID gets a weird value (not what it should get).
I have no idea what could cause that, I checked it hundred of times and it seems okay.

Code:

pawn Код:
// Enumerator in some part of the script.
enum E_INTERIOR_INFO
{
    interiorInterior,
    Float:interiorPosX,
    Float:interiorPosY,
    Float:interiorPosZ,
    Float:interiorRot,
    interiorName[128],
}
pawn Код:
// This array in another part of the script, I only show a small part of it, but it continues to about 100 lines.
new
    g_aInteriorInfo[][E_INTERIOR_INFO] =
    {
        { 11, 2003.1178, 1015.1948, 33.008, 351.5789, "Four Dragons' Managerial Suite" },
        { 5, 770.8033, -0.7033, 1000.7267, 22.8599, "Ganton Gym" }
                // ...
    };
pawn Код:
// The problematic code:
gHotelInfo[id][hotelExInterior] = g_aInteriorInfo[listitem][interiorInterior];
printf("%d, %d", gHotelInfo[id][hotelExInterior], g_aInteriorInfo[listitem][interiorInterior]);
I printed both variables (I chose the second interior) and this is the result:

Quote:

1084227584, 5

Any ideas?


Re: Variable getting a weird value - PaulDinam - 23.03.2013

Something wrong with
gHotelInfo[id][hotelExInterior]

show me the enum of gHotelInfo