07.10.2011, 14:19
This code aint getting my health or armour thats set in the user file but then again it dont save either
This In a New Forward function i created... Witch I have the Function In OnPlayerRequestClass
Then My Others Aint Saving The save player Position Works but not everything else I think i done confused my self here this code
Please Ignore the other ones I havent got anything for them as of yet...
If Any Could help Me I'd Would be Greatly appreciated I would loved to be able to work on another script within my Gamemode with out having to worry about my save and Login stats not working right....
This In a New Forward function i created... Witch I have the Function In OnPlayerRequestClass
pawn Код:
forward OnPlayerLogged(playerid);
public OnPlayerLogged(playerid)
{
new name[MAX_PLAYER_NAME], file[256], string[128];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), ARS_SERVERFILES, name);
PlayerInfo[playerid][pAdminLevel] = dini_Int(file, "AdminLevel");
PlayerInfo[playerid][pJob] = dini_Int(file, "Job");
PlayerInfo[playerid][pCash] = dini_Int(file,"Money");
PlayerInfo[playerid][pAccount] = dini_Int(file,"Bank");
PlayerInfo[playerid][pHealth] = dini_Int(file,"Health");
PlayerInfo[playerid][pArmour] = dini_Int(file,"Armour");
PlayerInfo[playerid][pCharacter] = dini_Int(file,"Character");
format(string, 128, "You have succesfully logged into your account. Welcome back. %s ", name);
SendClientMessage(playerid, DARKBLUE, string);
SpawnLastSaved(playerid);
PlayerOnline[playerid] = 1;
return 1;
}
pawn Код:
public SaveUserAccounts(playerid)
{
if(IsPlayerConnected(playerid))
{
if(PlayerOnline[playerid] == 1)
{
SaveStats(playerid);
new file[24];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), ARS_SERVERFILES, name);
dini_IntSet(file, "Account",PlayerInfo[playerid][pAccount]);
dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel]);
dini_IntSet(file, "Money",PlayerInfo[playerid][pCash]);
dini_IntSet(file, "Level",PlayerInfo[playerid][pScore]);
dini_IntSet(file, "Firstname",PlayerInfo[playerid][pFirstname]);
dini_IntSet(file, "Lastname",PlayerInfo[playerid][pLastname]);
dini_IntSet(file, "Age",PlayerInfo[playerid][pAge]);
dini_IntSet(file, "Gender",PlayerInfo[playerid][pGender]);
dini_IntSet(file, "Registration",PlayerInfo[playerid][pReg]);
dini_IntSet(file, "Vehicle",PlayerInfo[playerid][pVeh]);
dini_IntSet(file, "House",PlayerInfo[playerid][pHouse]);
dini_IntSet(file, "SSN",PlayerInfo[playerid][pId]);
dini_IntSet(file, "FireRank",PlayerInfo[playerid][pFrank]);
dini_IntSet(file, "PoliceRank",PlayerInfo[playerid][pPrank]);
dini_IntSet(file, "Job",PlayerInfo[playerid][pJob]);
dini_IntSet(file, "Health",PlayerInfo[playerid][pHealth]);
dini_IntSet(file, "Armour",PlayerInfo[playerid][pArmour]);
dini_IntSet(file, "Character", GetPlayerSkin(playerid));
dini_IntSet(file, "LocX",PlayerInfo[playerid][pLocX]);
dini_IntSet(file, "LocY",PlayerInfo[playerid][pLocY]);
dini_IntSet(file, "LocZ",PlayerInfo[playerid][pLocZ]);
dini_IntSet(file, "LocA",PlayerInfo[playerid][pLocA]);
dini_IntSet(file, "LocI",PlayerInfo[playerid][pLocI]);
}
}
}
If Any Could help Me I'd Would be Greatly appreciated I would loved to be able to work on another script within my Gamemode with out having to worry about my save and Login stats not working right....