SA-MP Forums Archive
Change SQL - 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: Change SQL (/showthread.php?tid=632067)



Change SQL - CusturA - 08.04.2017

How i can change mysql variable?
need to have public LoadTurfs like public Detector_Load

This is from my GM
PHP код:
public Detector_Load()
{
    static
        
rows,
        
fields;
 
    
cache_get_data(rowsfieldsg_iHandle);
 
    for (new 
0rows++) if (MAX_METAL_DETECTORS)
    {
        
MetalDetectors[i][detectorExists] = 1;
        
MetalDetectors[i][detectorID] = cache_get_field_int(i"detectorID");
        
MetalDetectors[i][detectorPos][0] = cache_get_field_float(i"detectorX");
        
MetalDetectors[i][detectorPos][1] = cache_get_field_float(i"detectorY");
        
MetalDetectors[i][detectorPos][2] = cache_get_field_float(i"detectorZ");
        
MetalDetectors[i][detectorPos][3] = cache_get_field_float(i"detectorAngle");
        
MetalDetectors[i][detectorInterior] = cache_get_field_int(i"detectorInterior");
        
MetalDetectors[i][detectorWorld] = cache_get_field_int(i"detectorWorld");
 
        
Detector_Refresh(i);
    }
    return 
1;

This is imported
PHP код:
public LoadTurfs()
{
    new 
result[100],index 0;
    
mysql_query(SQL,"SELECT * FROM `turfs` ORDER BY `turfs`.`ID` ASC");
    
mysql_store_result();
    while(
mysql_retrieve_row())
    {
        
index++;
        new 
index;
        
mysql_get_field("ID"result);              TurfInfo[i][zID] = strval(result);
        
mysql_get_field("Owned"result);           TurfInfo[i][zOwned] = strval(result);
        
mysql_get_field("Time"result);            TurfInfo[i][zTime] = strval(result);
        
mysql_get_field("MinX"result);            TurfInfo[i][zMinX] = floatstr(result);
        
mysql_get_field("MinY"result);            TurfInfo[i][zMinY] = floatstr(result);
        
mysql_get_field("MaxX"result);            TurfInfo[i][zMaxX] = floatstr(result);
        
mysql_get_field("MaxY"result);            TurfInfo[i][zMaxY] = floatstr(result);
    }
    
mysql_free_result();
    
printf("[MySQL Turfs]: %d"index);
    return 
1;




Re: Change SQL - CusturA - 09.04.2017

Can someone help?


Re: Change SQL - CusturA - 09.04.2017

Bump


Re: Change SQL - CusturA - 09.04.2017

Bump


Re: Change SQL - denNorske - 09.04.2017

You're Bumping way too often, please read the forum rules.

Specify what you want, I did not understand quite what you meant.


Re: Change SQL - CusturA - 10.04.2017

Quote:
Originally Posted by denNorske
Посмотреть сообщение
You're Bumping way too often, please read the forum rules.

Specify what you want, I did not understand quite what you meant.
Need to change from MySQL plugin R34 to MySQL plugin R39-3