how it looks in game..
Код:
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;
}
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?
I tried , still looks id 0 and 1 .. other fixes?