ATM Mysql ID problem
#1

Ok , hello so , look how is it in MY DB



how it looks in game..

I want the ID to be like in game !


The code which one load ATM's


Код:
stock IncarcaBancomatele()
{
	new Cache: Result = mysql_query( SQL, "SELECT * FROM `atms`" ), Get[ 2 ];
	cache_get_data( Get[ 0 ], Get[ 1 ], SQL ); // Get[ 0 ] - Rows || Get[ 1 ] - Fields || SQL - connectionHandle
	new string[256];
    for(new i = 0; i < Get[ 0 ]; i++)
    {
    	new ATM_ID = cache_get_field_content_int( i, "ID", SQL );
        ATMInfo[i][ATMCash] = cache_get_field_content_int( i, "Cash", SQL );
        ATMInfo[i][ATMFee] = cache_get_field_content_int( i, "Cost", SQL );
        ATMInfo[i][ATMLocked] = cache_get_field_content_int( i, "Block", SQL );
        ATMInfo[i][ATMAngle] = cache_get_field_content_float( i, "Angle", SQL );
        ATMInfo[i][ATMX] = cache_get_field_content_float( i, "X", SQL );
        ATMInfo[i][ATMY] = cache_get_field_content_float( i, "Y", SQL );
        ATMInfo[i][ATMZ] = cache_get_field_content_float( i, "Z", SQL );
        ATMInfo[i][ATMObjectID] = CreateDynamicObject(2942, ATMInfo[i][ATMX], ATMInfo[i][ATMY], ATMInfo[i][ATMZ]-0.5, 0, 0, ATMInfo[i][ATMAngle],0,0,-1,250);
		format(string, sizeof(string), "{C3C3C3}[ ATM %d ]{FFF1AF}\nTotal Cash: %d$\nPercent Fee: %d\nAvailable: %s\n{C3C3C3}( Tasteaza /withdraw )", ATM_ID ,ATMInfo[i][ATMCash], ATMInfo[i][ATMFee], ( ATMInfo[i][ATMLocked] == 1 ) ? ( "Yes" ) : ( "No" ) );
		atm[i] = CreateDynamic3DTextLabel(string, COLOR_DCHAT, ATMInfo[i][ATMX], ATMInfo[i][ATMY], ATMInfo[i][ATMZ]+0.75,10.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,0,-1,-1, 100.0);
		sATM++;
		
	}
    cache_delete( Result );
	printf("[*] Bancomate incarcate : %d",sATM);
	return 1;
}
On the top of scripts is
new sATM = 0;
I tried to load the id from the DB , but no works... i'm still beginner with this MYSQL , so what's the problem and how i fix it please?
Reply
#2

sATM = 1; ??
Reply
#3

I tried , still looks id 0 and 1 .. other fixes?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)