21.01.2016, 03:49
pawn Код:
CMD:actualizar(playerid, params[])
{
mysql_tquery(Conecction, "SELECT `nombre`, `password` FROM `players`", "Transformar");
return 1;
}
public Transformar()
{
for(new i = 0, j = cache_get_row_count(); i < j; i ++)
{
new name[MAX_PLAYER_NAME], password[21], hash[129];
cache_get_field_content(i, "nombre", name, Conecction, MAX_PLAYER_NAME);
cache_get_field_content(i, "password", password, Conecction, 21);
WP_Hash(hash, sizeof(hash), password);
new Query[400];
format(Query, sizeof(Query), "UPDATE `players` SET `password` = '%q' WHERE `nombre` = '%q'", hash, name);
mysql_query(Conecction, Query, false);
}
return 1;
}