Hacer este guardado/cargado MYSQL mas ordenado.
#2

si no te funciona me avisas, no lo he testeado.
PHP код:
//Agrega esto en tu tabla:
ALTER TABLE `cuentasADD `WPSVARCHAR(45NOT NULL DEFAULT '0,0,0,0,0,0,0,0,0,0,0,0,0' ;
enum pInfo
{
    
pWP[13],
    
pWPIndex[45]
}
new 
Informacion[MAX_PLAYERS][pInfo];
stock ResetVariables(playerid)
{
    
Informacion[playerid][pWP0] = 0;
    
Informacion[playerid][pWP1] = 0;
    
Informacion[playerid][pWP2] = 0;
    
Informacion[playerid][pWP3] = 0;
    
Informacion[playerid][pWP4] = 0;
    
Informacion[playerid][pWP5] = 0;
    
Informacion[playerid][pWP6] = 0;
    
Informacion[playerid][pWP7] = 0;
    
Informacion[playerid][pWP8] = 0;
    
Informacion[playerid][pWP9] = 0;
    
Informacion[playerid][pWP10] = 0;
    
Informacion[playerid][pWP11] = 0;
    
Informacion[playerid][pWP12] = 0;
}
/* Esto es en el cargado, es MYSQL R39 */
        
cache_get_field_content(0"WPS"PlayerInfo[playerid][pWPIndex], MySQL45);
        
sscanf(PlayerInfo[playerid][pWPIndex], "p<,>iiiiiiiiiiiii",
        
PlayerInfo[playerid][pWP][0], PlayerInfo[playerid][pWP][1], PlayerInfo[playerid][pWP][2], PlayerInfo[playerid][pWP][3], PlayerInfo[playerid][pWP][4],
        
PlayerInfo[playerid][pWP][5], PlayerInfo[playerid][pWP][6], PlayerInfo[playerid][pWP][7], PlayerInfo[playerid][pWP][8], PlayerInfo[playerid][pWP][9],
        
PlayerInfo[playerid][pWP][10], PlayerInfo[playerid][pWP][11], PlayerInfo[playerid][pWP][12]);
/* Esto es el guardado */
    
new str[5], result[5*13], queryx[130];
     for(new 
012i++)
      {
        
format(strsizeof(str), "%d,"PlayerInfo[playerid][pWP][i]);
        
strcat(resultstr);
    }
    
format(strsizeof(str), "%d"PlayerInfo[playerid][pWP][12]);
    
strcat(resultstr);
    
mysql_format(MySQLqueryxsizeof(queryx), "UPDATE `usuarios` SET `WPS` = '%s' WHERE `Nombre`='%s'"resultNombreJugador(playerid));
    
mysql_tquery(MySQLqueryx""""); 
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)