hali.
drake nagyszerüen segitett a multkor, csak az a gáz, hogy nem ment el
semmit sem aa mysql em -.-
néhány info:
enum PA {
IP[30],
Money,
AdminLevel,
Float: pHealth,
Float: pArmour,
Float: posx,
Float: posy,
Float: posz,
Bank
}
new PlayerAccount[MAX_PLAYERS][PA];
function SavePlayerAccount(playerid) {
GetPlayerName(playerid, pname, sizeof(pname));
GetPlayerHealth(playerid, PlayerAccount[playerid][pHealth]);
GetPlayerArmour(playerid, PlayerAccount[playerid][pArmour]);
GetPlayerPos(playerid, PlayerAccount[playerid][posx],PlayerAccount[playerid][posy],PlayerAccount[playerid][posz]);
format(stringsize, sizeof(stringsize), \"UPDATE \"SQL_TABLE\" SET Money = %d, AdminLevel = %d, Health = %f, Armour = %f, Bank = %d, X = %0.3f, Y = %0.3f, Z = %0.3f, WHERE Name = \'%s\'\",
GetPlayerMoney(playerid),
PlayerAccount[playerid][AdminLevel],
PlayerAccount[playerid][pHealth],
PlayerAccount[playerid][pArmour],
PlayerAccount[playerid][bank],
PlayerAccount[playerid][posx],
PlayerAccount[playerid][posy],
PlayerAccount[playerid][posz],
pname);
mysql_query(stringsize, SQL_SAVE_ACCOUNT, playerid, RegistrationSystemConnection);
}
function LoginPlayer(playerid, reason) {
GetPlayerName(playerid, pname, sizeof(pname));
format(stringsize, sizeof(stringsize), \"SELECT * FROM \"SQL_TABLE\"\", pname);
mysql_query(stringsize, -1, -1, RegistrationSystemConnection);
mysql_store_result();
new playerfilesplit[11][128], playerloadingarray[128];
mysql_fetch_row_format(playerloadingarray,\"|\", RegistrationSystemConnection);
split(playerloadingarray, playerfilesplit, \'|\');
PlayerAccount[playerid][Money] = strval(playerfilesplit[3]);
PlayerAccount[playerid][AdminLevel] = strval(playerfilesplit[4]);
PlayerAccount[playerid][pHealth] = floatstr(playerfilesplit[5]);
PlayerAccount[playerid][pArmour] = floatstr(playerfilesplit[6]);
PlayerAccount[playerid][posx] = floatstr(playerfilesplit[7]);
PlayerAccount[playerid][posy] = floatstr(playerfilesplit[8]);
PlayerAccount[playerid][posz] = floatstr(playerfilesplit[9]);
PlayerAccount[playerid][bank] = strval(playerfilesplit[10]);
mysql_free_result(RegistrationSystemConnection);
switch(reason)
{
case 1:
{
SendClientMessage(playerid, KEK, LOGINMSSG1);
}
case 2:
{
SendClientMessage(playerid, KEK, LOGINMSSG2);
}
}
OnPlayerLogin(playerid);
}
function OnPlayerLogin(playerid) {
// In this function you can make a user forcespawn. This is called after someone logged in..
SpawnPlayer(playerid);
//SetPlayerPos(playerid, 1529.6,-1691.2,13.3);
GivePlayerMoney(playerid, PlayerAccount[playerid][Money]);
SetPlayerHealth(playerid, PlayerAccount[playerid][pHealth]);
SetPlayerArmour(playerid, PlayerAccount[playerid][pArmour]);
SetPlayerPos(playerid, PlayerAccount[playerid][posx],PlayerAccount[playerid][posy],PlayerAccount[playerid][posz]);
AccountData[playerid][Logged] = true;
}
és semmit nem ment el. mi lehet a problem?
SZERK.: pl az életet beállítja -.- meg a poziciot is , ami ugyebár nulla mivel nem menti el.
szoval betöltés vmennyire sikeres de pl a pénzt SEM tölti be. bár lehet hogy betölti de
mivel 0 igy azt tölti be :DDDszoval a mentésssel lehet gond? !
zsomaa