25.07.2018, 18:04
I've got another problem. Basically on my load player, it doesn't load the players position properly. It always spawns them at the blueberry farm instead of their most recent position before leaving. Here are the codes that could be affecting this:
PHP код:
Of course on the dialog login it allows them to access the request class, and with or without the logged in statement on requestclass does not affect results
public OnPlayerRequestClass(playerid, classid)
{
if(playerInfo[playerid][LoggedIn] == true)
{
new Float:posX, Float:posY, Float:posZ;
cache_get_value_name_float(0, "playerX", posX);
cache_get_value_name_float(0, "playerY", posY);
cache_get_value_name_float(0, "playerZ",posZ);
SetSpawnInfo( playerid, 0, 0, posX, posY, posZ, 0, 0, 0, 0, 0, 0, 0 );
SpawnPlayer(playerid);
}
return 1;
}
stock LoadPlayerStats(playerid)
{
if(playerInfo[playerid][LoggedIn] == true)
{
new query[200], name[24];
GetPlayerName(playerid, name, 24);
format(query, sizeof(query), "SELECT * FROM `accounts` WHERE `playerName` = '%s'", name);
mysql_tquery(Database, query);
playerInfo[playerid][playerAdmin] = cache_get_value_int(0, "playerAdmin", playerInfo[playerid][playerAdmin]);
playerInfo[playerid][playerMod] = cache_get_value_int(0, "playerMod", playerInfo[playerid][playerMod]);
playerInfo[playerid][playerHelper] = cache_get_value_int(0, "playerHelper", playerInfo[playerid][playerHelper]);
playerInfo[playerid][playerLevel] = cache_get_value_int(0, "playerLevel", playerInfo[playerid][playerLevel]);
playerInfo[playerid][playerCash] = cache_get_value_int(0, "playerCash", playerInfo[playerid][playerCash]);
SetPlayerScore(playerid, playerInfo[playerid][playerLevel]);
GivePlayerMoney(playerid, playerInfo[playerid][playerCash]);
printf("player loaded.");
}
}