08.01.2016, 15:45
si no te funciona me avisas, no lo he testeado.
PHP код:
//Agrega esto en tu tabla:
ALTER TABLE `cuentas` ADD `WPS` VARCHAR(45) NOT 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], MySQL, 45);
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 i = 0; i < 12; i++)
{
format(str, sizeof(str), "%d,", PlayerInfo[playerid][pWP][i]);
strcat(result, str);
}
format(str, sizeof(str), "%d", PlayerInfo[playerid][pWP][12]);
strcat(result, str);
mysql_format(MySQL, queryx, sizeof(queryx), "UPDATE `usuarios` SET `WPS` = '%s' WHERE `Nombre`='%s'", result, NombreJugador(playerid));
mysql_tquery(MySQL, queryx, "", "");