SA-MP Forums Archive
Question about MySQL - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Question about MySQL (/showthread.php?tid=523676)



Question about MySQL - Eclips - 03.07.2014

Hello friends,
I have a question about MySQL. I made a script which allows to load vehicles from base of datum, but the problem, it is that during the load of vehicles, in the console to samp-server, it indicates me that Number of vehicle models: 0

My question is why ? Is it normal?

I give you my load script :

PHP код:
forward ChargerVehicules();
public 
ChargerVehicules()
{
    new 
rowsfields;
    
cache_get_data(rowsfieldsmysql);
    for(new 
i=0i<cache_get_row_count(rows); i++)
    {
        
InfosVehicules[i][Modele] = cache_get_field_content_int(i"Modele");
        
InfosVehicules[i][SpawnX] = cache_get_field_content_float(i"SpawnX");
        
InfosVehicules[i][SpawnY] = cache_get_field_content_float(i"SpawnY");
        
InfosVehicules[i][SpawnZ] = cache_get_field_content_float(i"SpawnZ");
        
InfosVehicules[i][SpawnAng] = cache_get_field_content_float(i"SpawnAng");
        
InfosVehicules[i][Couleur1] = cache_get_field_content_int(i"Couleur1");
        
InfosVehicules[i][Couleur2] = cache_get_field_content_int(i"Couleur2");
        
AddStaticVehicleEx(InfosVehicules[i][Modele], InfosVehicules[i][SpawnX], InfosVehicules[i][SpawnY], InfosVehicules[i][SpawnZ], InfosVehicules[i][SpawnAng], InfosVehicules[i][Couleur1], InfosVehicules[i][Couleur2], -1);
        
printf("%i modele : %d"iInfosVehicules[i][Modele]);
    }

It can harm GetPlayerVehicleID ?

Oh, and in server log, row is load well, and in server too

Thank in advance for help me, and sorry for my bad english.
++


Re: Question about MySQL - BroZeus - 03.07.2014

ye it is normal
if u add vehicles in OmGameModeinit then it shows in server console automatically


Re: Question about MySQL - SKAzini - 03.07.2014

If ChargerVehicules() is called after gamemode has finished loading, it will not show the vehicle models that are added by your script.


Re : Question about MySQL - Eclips - 03.07.2014

Ok, thans u