23.10.2014, 19:18
Alright. I've decided to come back to SA-MP scripting..
Anyways, This query should work but it is not returning any rows:
Here's the query:
Anyways, This query should work but it is not returning any rows:
pawn Код:
Function:OnAccountLoad(playerid)
{
new
rows,
fields;
cache_get_data(rows, fields);
if(rows == 1)
{
for(new i = 0; i != rows; i++)
{
// Load Strings ----------------------------------------------------
cache_get_field_content(i, "Password", Account[playerid][Password]);
// -----------------------------------------------------------------
// Load Integers ------------------------------------------------------------
Account[playerid][AdminLevel] = cache_get_field_content_int(i, "AdminLevel");
Account[playerid][Money] = cache_get_field_content_int(i, "money");
Account[playerid][Faction] = cache_get_field_content_int(i, "faction");
Account[playerid][pSkin] = cache_get_field_content_int(i, "skin");
Account[playerid][pGender] = cache_get_field_content_int(i, "gender");
// --------------------------------------------------------------------------
// Set Money ----------------------------------------
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, Account[playerid][Money]);
// --------------------------------------------------
// Set Clothes -----------------------------------
SetPlayerSkin(playerid, Account[playerid][pSkin]);
// -----------------------------------------------
}
}
else
{
SCM(playerid, -1, "Failed to load user data... [FTL ERR #1]");
KickDelay(playerid);
}
return 1;
}
pawn Код:
mysql_format(sqlHandle, gVar3000, sizeof(gVar3000), "SELECT * FROM `samp_users` WHERE 'Username' = '%e' AND Password = '%e'", Name[playerid], Account[playerid][Password]);
mysql_tquery(sqlHandle, gVar3000, "OnAccountLoad", "d", playerid);