Gang gates [ loaded with mysql ].
#1

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:
PHP Code:
function LoadGangGates( )
{
    new 
RowsFieldsX;
    
cache_get_dataRowsFieldsDB_Connect );
    for( new 
0Rows++ )
    {
        
cache_get_field_content_inti"ID"DB_Connect );
        
GateInfo][ gateX ] = cache_get_field_content_inti"gateX"DB_Connect );
        
GateInfo][ gateY ] = cache_get_field_content_inti"gateY"DB_Connect );
        
GateInfo][ gateZ ] = cache_get_field_content_inti"gateZ"DB_Connect );
        
GateInfo][ gateAX ] = cache_get_field_content_inti"gateAX"DB_Connect );
        
GateInfo][ gateAY ] = cache_get_field_content_inti"gateAY"DB_Connect );
        
GateInfo][ gateAZ ] = cache_get_field_content_inti"gateAZ"DB_Connect );
        
GateInfo][ gateXog ] = cache_get_field_content_inti"gateXog"DB_Connect );
        
GateInfo][ gateYog ] = cache_get_field_content_inti"gateYog"DB_Connect );
        
GateInfo][ gateZog ] = cache_get_field_content_inti"gateZog"DB_Connect );
        
        
Gate] = CreateDynamicObject971GateInfo][ gateX ], GateInfo][ gateY ], GateInfo][ gateZ ], GateInfo][ gateAX ], GateInfo][ gateAY ], GateInfo][ gateAZ ] );
    }
    
printf"Loaded %d Gang Gates."Rows );
    return 
1;

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.
Reply
#2

cache_get_field_content_int.

An integer is a whole number without decimal places. Use the float function. Same for insert, use %f not %d.
Reply
#3

Quote:
Originally Posted by Vince
View Post
cache_get_field_content_int.

An integer is a whole number without decimal places. Use the float function. Same for insert, use %f not %d.
Thanks Vince. Also may i ask you something.
In the database i saw, that if i change from float to double, the numbers are not rounding, remains
the same that i insered, it is ok to use float or double ? ( i used in LoadGangGates: cache_get_field_content_float ).
Reply
#4

Quote:
Originally Posted by FaLLenGirL
View Post
Thanks Vince. Also may i ask you something.
In the database i saw, that if i change from float to double, the numbers are not rounding, remains
the same that i insered, it is ok to use float or double ? ( i used in LoadGangGates: cache_get_field_content_float ).
"float" datatype is all that you require currently. float is used for single-precision where as double for double precision numbers. float has 32-bit (4 bytes) and double has 64-bit (8 bytes). If you want more accuracy, you can use double but it's not required here.
Reply
#5

I really appreciate the way you describe your problems.It's much clearer ,professional and detailed and that's how a question should be asked in a forum.have +3 rep for that(not that it matters but it's the only way i can show the appreciation towards you).Keep it up and it inspired me too.
Reply
#6

Lordzy thanks buddy.

Quote:
Originally Posted by Sreyas
View Post
I really appreciate the way you describe your problems.It's much clearer ,professional and detailed and that's how a question should be asked in a forum.have +3 rep for that(not that it matters but it's the only way i can show the appreciation towards you).Keep it up and it inspired me too.
I appreciate your words. Thanks a lot for all help.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)