Help since const
#1

Hey i want to use the Since Const for coordinates( Dynamic Interiors )...

pawn Код:
enum IntEnt { Float:I_COORDS[ 3 ], INT_ID };

static const
    IntNfo[ 1 ][ IntEnt ] = {

    //-----------------------------[ 24 / 7's ]---------------------------------

    { { -25.884, -35.095, -3.397 },                                         17 }

};
And when i use this it putting me on the 0,0,0 coordinates, i dont know the problem...
pawn Код:
SetPlayerPos( playerid, IntNfo[ 0 ][ I_COORDS ][ 0 ], IntNfo[ 0 ][ I_COORDS ][ 1 ], IntNfo[ 0 ][ I_COORDS ][ 2 ] );
Reply
#2

Your code is correct (assuming it looks exactly like this). No compiler warnings or something? Also some more context around the line with SetPlayerPos would be helpful.
Reply
#3

I'm going to make a suggestion off the top instead of doing this

Float:I_COORDS[ 3 ]

Just declare each coord independently whats the point of using a enum if your not going to use it ?

pawn Код:
enum IntEnt { Float:I_COORDX, Float:I_COORDY, Float:I_COORDZ, INT_ID };
That will simplify your data and looks a lot better.

@Misiur - It is valid but ugly.
Reply
#4

Im going tu use if i have in the Interior "iType" 1, that is 24/7 i put like this
pawn Код:
IntNfo[ InteriorInfo[ i ][ iType ] ][ I_COORDS ][ 0 ]
Reply
#5

@[uL]Pottus: Not ugly by my standards, I group coordinates in arrays as well (easier to loop through when needed).

@OP: Well, first check if the InteriorInfo[ i ][ iType ] value is valid. Then dump values you are going to use (printf to the rescue)
Reply
#6

Fck... it dont printing my anything i putted like this if i put SCM...
It is not sending my anthing....

pawn Код:
if( newkeys & KEY_SECONDARY_ATTACK ) {

            for( new i = 0; i < MAX_INTERIORS; i++ ) {

                if( IsPlayerInRangeOfPoint( playerid, 3.0, InteriorInfo[ i ][ iX ], InteriorInfo[ i ][ iY ], InteriorInfo[ i ][ iZ ] ) ) {

                    FadeFromBlack( playerid );

                    SetPlayerInterior( playerid, IntNfo[ InteriorInfo[ i ][ iType ] ][ INT_ID ] );
                    SetPlayerVirtualWorld( playerid, InteriorInfo[ i ][ iVirtualWorld ] );
                   
                    printf("ID:%d", InteriorInfo[ i ][ iType ]);

                    SetPlayerPos( playerid, IntNfo[ 0 ][ I_COORDS ][ 0 ], IntNfo[ 0 ][ I_COORDS ][ 1 ], IntNfo[ 0 ][ I_COORDS ][ 2 ] );
                    return true;
                }
            }
Reply
#7

[QUOTE=Misiur;2945528]@[uL]Pottus: Not ugly by my standards, I group coordinates in arrays as well (easier to loop through when needed).

You wouldn't need to loop through that so why bother making your code look like dog shit when you don't have to? if it's something say materials on a object that would be a lot different.
Reply
#8

Dont discuss, i really need a help and i want to use like this...
Reply
#9

Solved
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)