10.03.2013, 16:46
pawn Код:
stock LoadAccount(playerid, Password[])
{
new Query[150], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
format(Query, sizeof(Query), "SELECT * FROM `players` WHERE `Name`='%s' AND `Password`='%s' LIMIT 0,1", PlayerName, Password);
mysql_function_query(MySQLConnection, Query, true, "OnLoadAccount", "ds", playerid, PlayerName);
return 1;
}
public OnLoadAccount(playerid, PlayerName)
{
new Rows, Fields, String[100];
cache_get_data(Rows, Fields, MySQLConnection);
if(Rows)
{
// Floats
PlayerInfo[playerid][pPos_x] = cache_get_field_float(0, "Pos_x", MySQLConnection);
PlayerInfo[playerid][pPos_y] = cache_get_field_float(0, "Pos_y", MySQLConnection);
PlayerInfo[playerid][pPos_z] = cache_get_field_float(0, "Pos_z", MySQLConnection);
PlayerInfo[playerid][pPos_a] = cache_get_field_float(0, "Pos_a", MySQLConnection);
printf("%f - %f - %f", PlayerInfo[playerid][pPos_x], PlayerInfo[playerid][pPos_y], PlayerInfo[playerid][pPos_z]);
}
I've double checked the coords in the database, and they are different than the ones being loaded.
Thanks for any suggestions on what may be wrong.