SA-MP Forums Archive
MySQL R40 Ranguri dinamice pentru Org. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Română/Romanian (https://sampforum.blast.hk/forumdisplay.php?fid=40)
+---- Thread: MySQL R40 Ranguri dinamice pentru Org. (/showthread.php?tid=628986)



MySQL R40 Ranguri dinamice pentru Org. - Johhnyllll - 18.02.2017

Salut la toti, am inceput a face un sistem cu ranguri dinamice.
PHP Code:
enum E_PLAYER_RANG_DATA{
    
ORM_r_ormid,
    
// mysql synced
    
id,
    
rang1[32],
    
rang2[32],
    
rang3[32],
    
rang4[32],
    
rang5[32],
    
rang6[32],
    
rang7[32],
    
rang8[32],
    
rang9[32],
    
rang10[32],
}
new 
RG[1][E_PLAYER_RANG_DATA]; 
PHP Code:
mysql_tquery(MySQL:1,"SELECT * FROM `rangs`""OnMySQL_SelectRangs"); 
PHP Code:
public OnMySQL_SelectRangs()
{
    new 
TotalRanks;
    for(new 
x=0sizeof(RG); x++){
        
RG[x][_r_ormid] = orm_create("rangs");
        
orm_addvar_int(RG[x][_r_ormid],RG[x][id],"ID");
        
orm_setkey(RG[x][_r_ormid],"ID");
        
orm_addvar_string(RG[x][_r_ormid],RG[x][rang1], 32"Rang1");
        
orm_addvar_string(RG[x][_r_ormid],RG[x][rang2], 32"Rang2");
        
orm_addvar_string(RG[x][_r_ormid],RG[x][rang3], 32"Rang3");
        
orm_addvar_string(RG[x][_r_ormid],RG[x][rang4], 32"Rang4");
        
orm_addvar_string(RG[x][_r_ormid],RG[x][rang5], 32"Rang5");
        
orm_addvar_string(RG[x][_r_ormid],RG[x][rang6], 32"Rang6");
        
orm_addvar_string(RG[x][_r_ormid],RG[x][rang7], 32"Rang7");
        
orm_addvar_string(RG[x][_r_ormid],RG[x][rang8], 32"Rang8");
        
orm_addvar_string(RG[x][_r_ormid],RG[x][rang9], 32"Rang9");
        
orm_addvar_string(RG[x][_r_ormid],RG[x][rang10], 32"Rang10");
        
TotalRanks++;
    }
    
printf("Ranguri:%i       [Timp: %d ms]",TotalRanks,cache_get_query_exec_time(MILLISECONDS));

MySQL:

Dar, daca facem:
PHP Code:
 printf("%s"RG[0][rang10]; //imi da eruare 
Cine ma poate ajuta?
Va multumesc.



Re: MySQL R40 Ranguri dinamice pentru Org. - Jessyy - 18.02.2017

Code:
printf("%s", RG[0][rang10];
in prima faza inchide si tu paranteza rotunda de la functie... ")" - is missing


Re: MySQL R40 Ranguri dinamice pentru Org. - Johhnyllll - 19.02.2017

Quote:
Originally Posted by Jessyy
View Post
Code:
printf("%s", RG[0][rang10];
in prima faza inchide si tu paranteza rotunda de la functie... ")" - is missing
Am inchis-o, inca ziua trecuta, se compileaza bine, dar in consola apare loc gol..