19.01.2016, 10:32
Could you try:
Btw sorry if a made a typo somewhere, I'm on my tablet lol
PHP код:
stock LoadPlayerData(playerid)
{
if(!IsPlayerConnected(playerid)) return 1;
new Query[200];
mysql_format(DB, Query, sizeof(Query), "SELECT * FROM `players` WHERE `Vardas` = '%s'", GetPlayerNameEx(playerid));
mysql_tquery(DB, Query, "OnPlayerLoad", "i", playerid);
return 1;
}
forward OnPlayerLoad(playerid);
public OnPlayerLoad(playerid){
new
rows,
fields,
Float: P_Pos[3];
cache_get_data(rows, fields, con);
if(rows){
SetPlayerVirtualWorld(playerid, cache_get_field_content_int(0, "World"));
SetPlayerInterior(playerid, cache_get_field_content_int(0, "Interior"));
SetPlayerDrunkLevel(playerid, cache_get_field_content_int(0, "Girtumas"));
SetPlayerMoneyA(playerid, cache_get_field_content_int(0, "MoneyPocket"));
PlayerInfo[playerid][Ieskomas] = cache_get_field_content_int(0, "Wanted");
PlayerInfo[playerid][Experience] = cache_get_field_content_int(0, "Xp");
PlayerInfo[playerid][AdminLevel] = cache_get_field_content_int(0, "Admin");
P_Pos[0] = cache_get_field_content_float(0, "pos_X");
P_Pos[1] = cache_get_field_content_float(0, "pos_Y");
P_Pos[2] = cache_get_field_content_float(0, "pos_Z");
SetPlayerScore(playerid, PlayerInfo[playerid][Experience]);
SetPlayerPos(playerid, P_Pos[0], P_Pos[1], P_Pos[2]);
}
return true;
}