27.02.2011, 20:23
Ok, I'm making a GM but when I load data I got something strange...
Here's my code:
Now, I made a command to check my data values:
In my database the values are correct, but when I type the command I get this results:
The database values are the follows:
Help me please!
Here's my code:
pawn Код:
if(dialogid == LOG_DIALOG)
{
if(response)
{
format(Query, sizeof(Query), "SELECT * FROM `Utenti` WHERE `Nome` = '%s' AND `Password` = '%s'", Nome(playerid), inputtext);
result = db_query(database, Query);
if(db_num_rows(result) != 0) //Password corretta
{
db_get_field_assoc(result, "Password", Utente[playerid][Password], 16);
db_get_field_assoc(result, "Livello", Utente[playerid][Livello], 6);
db_get_field_assoc(result, "Soldi", Utente[playerid][Soldi], 16);
db_get_field_assoc(result, "Banca", Utente[playerid][Banca], 16);
db_get_field_assoc(result, "Skin", Utente[playerid][Skin], 6);
db_get_field_assoc(result, "Bannato", Utente[playerid][Bannato], 3);
db_free_result(result);
SendClientMessage(playerid, 0x0000D9AA, "Hai eseguito l'accesso!");
Loggato[playerid] = true;
SpawnPlayer(playerid);
}
//etc...
pawn Код:
CMD:mystats(playerid, params[])
{
#pragma unused params
new tmpstr[100];
format(tmpstr,sizeof(tmpstr), "Pass: %s | Livello: %d | Soldi: %d", Utente[playerid][Password], Utente[playerid][Livello], Utente[playerid][Soldi]);
SendClientMessage(playerid, 0xF60000AA, tmpstr);
return 1;
}
Код:
Pass: o1100 | Livello: 49 | Soldi: 49
Код:
Pass: ok | Livello: 1 | Soldi: 100
