23.04.2013, 07:15
(
Последний раз редактировалось Ryan_Obeles; 23.04.2013 в 11:17.
)
PHP код:
public LoadPlayerData(playerid)
{
if(IsPlayerLoggedIn[playerid] == 1)
{
new File = BUD::GetNameUID(GetName(playerid));
BUD::MultiGet(File, "iiiiiiiiiiiffffiiiii",
"Age", PlayerData[playerid][pAge],
"Vip", PlayerData[playerid][pVip],
"Admin", PlayerData[playerid][pAdmin],
"Money", PlayerData[playerid][pMoney],
"Level", PlayerData[playerid][pLevel],
"Gender", PlayerData[playerid][pGender],
"Accent", PlayerData[playerid][pAccent],
"Skin", PlayerData[playerid][pSkin],
"Carlic", PlayerData[playerid][pCarLic],
"BoatLic", PlayerData[playerid][pBoatLic],
"FlyLic", PlayerData[playerid][pFlyLic],
"PosX", PlayerData[playerid][pPosX],
"PosY", PlayerData[playerid][pPosY],
"PosZ", PlayerData[playerid][pPosZ],
"PosAngle", PlayerData[playerid][pPosAngle],
"Payday", PlayerData[playerid][pPayday],
"HadPayDay", PlayerData[playerid][pHadPayDay],
"Family", PlayerData[playerid][pFamily],
"Faction", PlayerData[playerid][pFaction],
"Tutorial", PlayerData[playerid][pTutorial]
);
BUD::MultiGet(File, "iiffiiiiiiiiiiiiiiii",
"FactionRank", PlayerData[playerid][pFactionRank],
"Injured", PlayerData[playerid][pInjured],
"Health", PlayerData[playerid][pHealth],
"Armour", PlayerData[playerid][pArmour],
"VW", PlayerData[playerid][pVirtualWorld],
"Interior", PlayerData[playerid][pInterior],
"Job", PlayerData[playerid][pJob],
"BankBalance", PlayerData[playerid][pBankBalance],
"Weapon1", PlayerData[playerid][pWeapon][0],
"Weapon1Ammo", PlayerData[playerid][pWeaponAmmo][0],
"Weapon2", PlayerData[playerid][pWeapon][1],
"Weapon2Ammo", PlayerData[playerid][pWeaponAmmo][1],
"Weapon3", PlayerData[playerid][pWeapon][2],
"Weapon3Ammo", PlayerData[playerid][pWeaponAmmo][2],
"Weapon4", PlayerData[playerid][pWeapon][3],
"Weapon4Ammo", PlayerData[playerid][pWeaponAmmo][3],
"Weapon5", PlayerData[playerid][pWeapon][4],
"Weapon5Ammo", PlayerData[playerid][pWeaponAmmo][4],
"Weapon6", PlayerData[playerid][pWeapon][5],
"Weapon6Ammo", PlayerData[playerid][pWeaponAmmo][5]
);
BUD::MultiGet(File, "iiiiiiiiiiiiiiiiii",
"Weapon7", PlayerData[playerid][pWeapon][6],
"Weapon7Ammo", PlayerData[playerid][pWeaponAmmo][6],
"Weapon8", PlayerData[playerid][pWeapon][7],
"Weapon8Ammo", PlayerData[playerid][pWeaponAmmo][7],
"Weapon9", PlayerData[playerid][pWeapon][8],
"Weapon9Ammo", PlayerData[playerid][pWeaponAmmo][8],
"Weapon10", PlayerData[playerid][pWeapon][9],
"Weapon10Ammo", PlayerData[playerid][pWeaponAmmo][9],
"Weapon11", PlayerData[playerid][pWeapon][10],
"Weapon11Ammo", PlayerData[playerid][pWeaponAmmo][10],
"Weapon12", PlayerData[playerid][pWeapon][11],
"Weapon12Ammo", PlayerData[playerid][pWeaponAmmo][11],
"Weapon13", PlayerData[playerid][pWeapon][12],
"Weapon13Ammo", PlayerData[playerid][pWeaponAmmo][12],
"PRadio", PlayerData[playerid][pPRadio],
"PRadioFreq", PlayerData[playerid][pPRadioFreq],
"CigarSticks", PlayerData[playerid][pCigar],
"WineBottles", PlayerData[playerid][pWine]
);
}
return 1;
}
public ResetPlayerData(playerid)
{
PlayerData[playerid][pAge] = 0;
PlayerData[playerid][pVip] = 0;
PlayerData[playerid][pAdmin] = 0;
PlayerData[playerid][pMoney] = 30000;
PlayerData[playerid][pLevel] = 1;
PlayerData[playerid][pGender] = 0;
PlayerData[playerid][pAccent] = 1;
PlayerData[playerid][pSkin] = 0;
PlayerData[playerid][pCarLic] = 1;
PlayerData[playerid][pBoatLic] = 0;
PlayerData[playerid][pFlyLic] = 0;
PlayerData[playerid][pPosX] = 0.0000;
PlayerData[playerid][pPosY] = 0.0000;
PlayerData[playerid][pPosZ] = 0.0000;
PlayerData[playerid][pPosAngle] = 0.0000;
PlayerData[playerid][pPayday] = 0;
PlayerData[playerid][pHadPayDay] = 0;
PlayerData[playerid][pFamily] = 0;
PlayerData[playerid][pFaction] = 0;
PlayerData[playerid][pTutorial] = 0;
PlayerData[playerid][pFactionRank] = 0;
PlayerData[playerid][pInjured] = 0;
PlayerData[playerid][pHealth] = 100.0;
PlayerData[playerid][pArmour] = 0.0;
PlayerData[playerid][pVirtualWorld] = 0;
PlayerData[playerid][pInterior] = 0;
PlayerData[playerid][pJob] = 0;
PlayerData[playerid][pBankBalance] = 0;
PlayerData[playerid][pWeapon][0] = 0;
PlayerData[playerid][pWeaponAmmo][0] = 0;
PlayerData[playerid][pWeapon][1] = 0;
PlayerData[playerid][pWeaponAmmo][1] = 0;
PlayerData[playerid][pWeapon][2] = 0;
PlayerData[playerid][pWeaponAmmo][2] = 0;
PlayerData[playerid][pWeapon][3] = 0;
PlayerData[playerid][pWeaponAmmo][3] = 0;
PlayerData[playerid][pWeapon][4] = 0;
PlayerData[playerid][pWeaponAmmo][4] = 0;
PlayerData[playerid][pWeapon][5] = 0;
PlayerData[playerid][pWeaponAmmo][5] = 0;
PlayerData[playerid][pWeapon][6] = 0;
PlayerData[playerid][pWeaponAmmo][6] = 0;
PlayerData[playerid][pWeapon][7] = 0;
PlayerData[playerid][pWeaponAmmo][7] = 0;
PlayerData[playerid][pWeapon][8] = 0;
PlayerData[playerid][pWeaponAmmo][8] = 0;
PlayerData[playerid][pWeapon][9] = 0;
PlayerData[playerid][pWeaponAmmo][9] = 0;
PlayerData[playerid][pWeapon][10] = 0;
PlayerData[playerid][pWeaponAmmo][10] = 0;
PlayerData[playerid][pWeapon][11] = 0;
PlayerData[playerid][pWeaponAmmo][11] = 0;
PlayerData[playerid][pWeapon][12] = 0;
PlayerData[playerid][pWeaponAmmo][12] = 0;
PlayerData[playerid][pPRadio] = 0;
PlayerData[playerid][pPRadioFreq] = 0;
PlayerData[playerid][pCigar] = 0;
PlayerData[playerid][pWine] = 0;
return 1;
}
public SavePlayerData(playerid)
{
if(IsPlayerLoggedIn[playerid] == 1)
{
new Float:PHealth, Float:PArmour;
new VWorld = GetPlayerVirtualWorld(playerid);
new Interior = GetPlayerInterior(playerid);
new Float:PosX, Float:PosY, Float:PosZ, Float:PosAngle;
new Money = GetPlayerMoney(playerid);
new Level = GetPlayerScore(playerid);
new Skin = GetPlayerSkin(playerid);
GetPlayerHealth(playerid, PHealth);
GetPlayerArmour(playerid, PArmour);
GetPlayerPos(playerid, PosX, PosY, PosZ);
GetPlayerFacingAngle(playerid, PosAngle);
for (new i = 0; i < 13; i++)
{
GetPlayerWeaponData(playerid, i, PlayerData[playerid][pWeapon][i], PlayerData[playerid][pWeaponAmmo][i]);
}
new File = BUD::GetNameUID(GetName(playerid));
BUD::MultiSet(File, "iiiiiiiiiiiffffiiiiii",
"Age", PlayerData[playerid][pAge],
"Vip", PlayerData[playerid][pVip],
"Admin", PlayerData[playerid][pAdmin],
"Money", Money,
"Level", Level,
"Gender", PlayerData[playerid][pGender],
"Accent", PlayerData[playerid][pAccent],
"Skin", Skin,
"Carlic", PlayerData[playerid][pCarLic],
"BoatLic", PlayerData[playerid][pBoatLic],
"FlyLic", PlayerData[playerid][pFlyLic],
"PosX", PosX,
"PosY", PosY,
"PosZ", PosZ,
"PosAngle", PosAngle,
"Payday", PlayerData[playerid][pPayday],
"HadPayDay", PlayerData[playerid][pHadPayDay],
"Family", PlayerData[playerid][pFamily],
"Faction", PlayerData[playerid][pFaction],
"Tutorial", PlayerData[playerid][pTutorial],
"FactionRank", PlayerData[playerid][pFactionRank]
);
BUD::MultiSet(File, "iiffiiiiiiiiiiiiiiiii",
"Injured", PlayerData[playerid][pInjured],
"Health", PHealth,
"Armour", PArmour,
"VW", VWorld,
"Interior", Interior,
"Job", PlayerData[playerid][pJob],
"BankBalance", PlayerData[playerid][pBankBalance],
"Weapon1", PlayerData[playerid][pWeapon][0],
"Weapon1Ammo", PlayerData[playerid][pWeaponAmmo][0],
"Weapon2", PlayerData[playerid][pWeapon][1],
"Weapon2Ammo", PlayerData[playerid][pWeaponAmmo][1],
"Weapon3", PlayerData[playerid][pWeapon][2],
"Weapon3Ammo", PlayerData[playerid][pWeaponAmmo][2],
"Weapon4", PlayerData[playerid][pWeapon][3],
"Weapon4Ammo", PlayerData[playerid][pWeaponAmmo][3],
"Weapon5", PlayerData[playerid][pWeapon][4],
"Weapon5Ammo", PlayerData[playerid][pWeaponAmmo][4],
"Weapon6", PlayerData[playerid][pWeapon][5],
"Weapon6Ammo", PlayerData[playerid][pWeaponAmmo][5],
"Weapon7", PlayerData[playerid][pWeapon][6],
"Weapon7Ammo", PlayerData[playerid][pWeaponAmmo][6]
);
BUD::MultiSet(File, "iiiiiiiiiiiiiiii",
"Weapon8", PlayerData[playerid][pWeapon][7],
"Weapon8Ammo", PlayerData[playerid][pWeaponAmmo][7],
"Weapon9", PlayerData[playerid][pWeapon][8],
"Weapon9Ammo", PlayerData[playerid][pWeaponAmmo][8],
"Weapon10", PlayerData[playerid][pWeapon][9],
"Weapon10Ammo", PlayerData[playerid][pWeaponAmmo][9],
"Weapon11", PlayerData[playerid][pWeapon][10],
"Weapon11Ammo", PlayerData[playerid][pWeaponAmmo][10],
"Weapon12", PlayerData[playerid][pWeapon][11],
"Weapon12Ammo", PlayerData[playerid][pWeaponAmmo][11],
"Weapon13", PlayerData[playerid][pWeapon][12],
"Weapon13Ammo", PlayerData[playerid][pWeaponAmmo][12],
"PRadio", PlayerData[playerid][pPRadio],
"PRadioFreq", PlayerData[playerid][pPRadioFreq],
"CigarSticks", PlayerData[playerid][pCigar],
"WineBottles", PlayerData[playerid][pWine]
);
}
return 1;
}