13.01.2017, 10:41
Hello there friends.
I made my Gang Gates object to load from the database, but the positions are not
the same, because positions are rounded when i insert them in the table `GangGates`.
Well on server, the gates are not in the right position, but a little further than it should be.
So that's my script for gates:
And here in database are like this:
--------------------------------------------------------------------------------------------------------
[ATTENTION]
- I don't know if this help but, when i inserted by myself the position the zero's were like: 0.0000, or that 90
was not that simple was like: 90.0000 etc, where was a simple number was zero's after him.
- Also, the gateXog, gateYog, gateZog = the position when gate is opened.
- For other details, if you guys need, just reply.
If u can help me with this i'll be very grateful. And to say to me why the positions become rounded.
I made my Gang Gates object to load from the database, but the positions are not
the same, because positions are rounded when i insert them in the table `GangGates`.
Well on server, the gates are not in the right position, but a little further than it should be.
So that's my script for gates:
PHP Code:
function LoadGangGates( )
{
new Rows, Fields, X;
cache_get_data( Rows, Fields, DB_Connect );
for( new i = 0; i < Rows; i ++ )
{
X = cache_get_field_content_int( i, "ID", DB_Connect );
GateInfo[ X ][ gateX ] = cache_get_field_content_int( i, "gateX", DB_Connect );
GateInfo[ X ][ gateY ] = cache_get_field_content_int( i, "gateY", DB_Connect );
GateInfo[ X ][ gateZ ] = cache_get_field_content_int( i, "gateZ", DB_Connect );
GateInfo[ X ][ gateAX ] = cache_get_field_content_int( i, "gateAX", DB_Connect );
GateInfo[ X ][ gateAY ] = cache_get_field_content_int( i, "gateAY", DB_Connect );
GateInfo[ X ][ gateAZ ] = cache_get_field_content_int( i, "gateAZ", DB_Connect );
GateInfo[ X ][ gateXog ] = cache_get_field_content_int( i, "gateXog", DB_Connect );
GateInfo[ X ][ gateYog ] = cache_get_field_content_int( i, "gateYog", DB_Connect );
GateInfo[ X ][ gateZog ] = cache_get_field_content_int( i, "gateZog", DB_Connect );
Gate[ X ] = CreateDynamicObject( 971, GateInfo[ X ][ gateX ], GateInfo[ X ][ gateY ], GateInfo[ X ][ gateZ ], GateInfo[ X ][ gateAX ], GateInfo[ X ][ gateAY ], GateInfo[ X ][ gateAZ ] );
}
printf( "Loaded %d Gang Gates.", Rows );
return 1;
}
--------------------------------------------------------------------------------------------------------
[ATTENTION]
- I don't know if this help but, when i inserted by myself the position the zero's were like: 0.0000, or that 90
was not that simple was like: 90.0000 etc, where was a simple number was zero's after him.
- Also, the gateXog, gateYog, gateZog = the position when gate is opened.
- For other details, if you guys need, just reply.
If u can help me with this i'll be very grateful. And to say to me why the positions become rounded.