I'm trying to set sizes for entities more dynamically, by using messagemode, but EngFunc_SetSize keeps throwing errors.
In messagemode you just gotta enter the positive value, example 5.0 5.0 5.0 and then it automatically does the rest, as shown in this code
PHP Code:
new Float:fSize[ 3 ];
engfunc( EngFunc_SetSize, iEnt, { -fSize[ 0 ], -fSize[ 1 ], -fSize[ 2 ] }, { fSize[ 0 ], fSize[ 1 ], fSize[ 2 ] } );
Code:
error 008: must be a constant expression; assumed zero
If I do this
PHP Code:
new Float:fSize[ 3 ];
engfunc( EngFunc_SetSize, iEnt, -fSize[ 0 ], -fSize[ 1 ], -fSize[ 2 ], fSize[ 0 ], fSize[ 1 ], fSize[ 2 ] );
I get no errors when compiling but in-game it crashes and shows:
Code:
Host_Error: backwards mins/maxs
Fixed:
PHP Code:
new Float:mins[ 3 ], Float:maxs[ 3 ];
mins[ 0 ] = -fSize[ 0 ];
mins[ 1 ] = -fSize[ 1 ];
mins[ 2 ] = -fSize[ 2 ];
maxs[ 0 ] = fSize[ 0 ];
maxs[ 1 ] = fSize[ 1 ];
maxs[ 2 ] = fSize[ 2 ];
engfunc( EngFunc_SetSize, iEnt, mins, maxs );
__________________