pawn Код:
public OnPlayerRegister(playerid, password[])
{
if(IsPlayerConnected(playerid))
{
new string[128];
format(string, sizeof(string), "users/%s.ini", PlayerName(playerid));
if(!dini_Exists(string))
{
dini_Create(string);
dini_Set(string, "Key", password);
dini_IntSet(string, "Cash", PlayerInfo[playerid][pCash]);
dini_IntSet(string, "Account", PlayerInfo[playerid][pAccount]);
dini_IntSet(string, "AdminLevel", PlayerInfo[playerid][pAdmin]);
dini_IntSet(string, "Respect", PlayerInfo[playerid][pExp]);
dini_IntSet(string, "UpgradePoints", PlayerInfo[playerid][gPupgrade]);
dini_IntSet(string, "Kills", PlayerInfo[playerid][pKills]);
dini_IntSet(string, "Gun1", PlayerInfo[playerid][pGun1]);
dini_IntSet(string, "Gun2", PlayerInfo[playerid][pGun2]);
dini_IntSet(string, "Gun3", PlayerInfo[playerid][pGun3]);
dini_IntSet(string, "Gun4", PlayerInfo[playerid][pGun4]);
dini_IntSet(string, "Gun5", PlayerInfo[playerid][pGun5]);
dini_IntSet(string, "Gun6", PlayerInfo[playerid][pGun6]);
dini_IntSet(string, "Gun7", PlayerInfo[playerid][pGun7]);
dini_IntSet(string, "Gun8", PlayerInfo[playerid][pGun8]);
dini_IntSet(string, "Gun9", PlayerInfo[playerid][pGun9]);
dini_IntSet(string, "Gun10", PlayerInfo[playerid][pGun10]);
dini_IntSet(string, "Gun11", PlayerInfo[playerid][pGun11]);
dini_IntSet(string, "Gun12", PlayerInfo[playerid][pGun12]);
dini_IntSet(string, "Gun13", PlayerInfo[playerid][pGun13]);
dini_IntSet(string, "Ammo1", PlayerInfo[playerid][pAmmo1]);
dini_IntSet(string, "Ammo2", PlayerInfo[playerid][pAmmo2]);
dini_IntSet(string, "Ammo3", PlayerInfo[playerid][pAmmo3]);
dini_IntSet(string, "Ammo4", PlayerInfo[playerid][pAmmo4]);
dini_IntSet(string, "Ammo5", PlayerInfo[playerid][pAmmo5]);
dini_IntSet(string, "Ammo6", PlayerInfo[playerid][pAmmo6]);
dini_IntSet(string, "Ammo7", PlayerInfo[playerid][pAmmo7]);
dini_IntSet(string, "Ammo8", PlayerInfo[playerid][pAmmo8]);
dini_IntSet(string, "Ammo9", PlayerInfo[playerid][pAmmo9]);
dini_IntSet(string, "Ammo10", PlayerInfo[playerid][pAmmo10]);
dini_IntSet(string, "Ammo11", PlayerInfo[playerid][pAmmo11]);
dini_IntSet(string, "Ammo12", PlayerInfo[playerid][pAmmo12]);
dini_IntSet(string, "Ammo13", PlayerInfo[playerid][pAmmo13]);
dini_FloatSet(string, "pSHealth", PlayerInfo[playerid][pSHealth]);
dini_FloatSet(string, "Health", PlayerInfo[playerid][pHealth]);
dini_FloatSet(string, "Pos_x", PlayerInfo[playerid][pPos_x]);
dini_FloatSet(string, "Pos_y", PlayerInfo[playerid][pPos_y]);
dini_FloatSet(string, "Pos_z", PlayerInfo[playerid][pPos_z]);
dini_IntSet(string, "Int", PlayerInfo[playerid][pInt]);
dini_IntSet(string, "Local", PlayerInfo[playerid][pLocal]);
dini_IntSet(string, "Char", PlayerInfo[playerid][pModel]);
dini_IntSet(string, "PhoneNr", PlayerInfo[playerid][pPnumber]);
dini_IntSet(string, "House", PlayerInfo[playerid][pHousekey]);
dini_IntSet(string, "Bizz", PlayerInfo[playerid][pPbiskey]);
dini_IntSet(string, "Banned", PlayerInfo[playerid][pBanned]);
dini_IntSet(string, "FightSkill", PlayerInfo[playerid][pFightSkill]);
dini_IntSet(string, "Sex", PlayerInfo[playerid][pSex]);
dini_IntSet(string, "Age", PlayerInfo[playerid][pAge]);
dini_IntSet(string, "Tutorial", PlayerInfo[playerid][pTut]);
dini_IntSet(string, "Member", PlayerInfo[playerid][pMember]);
dini_IntSet(string, "Rank", PlayerInfo[playerid][pRank]);
dini_IntSet(string, "Crashed", PlayerInfo[playerid][pCrashed]);
dini_IntSet(string, "Job", PlayerInfo[playerid][pJob]);
dini_IntSet(string, "HouseEntered", PlayerInfo2[HouseEntered][playerid]);
dini_IntSet(string, "IntEntered", PlayerInfo2[IntEntered][playerid]);
dini_FloatSet(string, "CrashHealth",PlayerInfo[playerid][pCrashHealth]);
dini_FloatSet(string, "CrashArmour",PlayerInfo[playerid][pCrashArmour]);
dini_IntSet(string, "World", PlayerInfo[playerid][pWorld]);
dini_IntSet(string, "PayCheck", PlayerInfo[playerid][pPayCheck]);
dini_IntSet(string, "PayDay", PlayerInfo[playerid][pPayDay]);
dini_IntSet(string, "DonateRank", PlayerInfo[playerid][pDonateRank]);
dini_IntSet(string, "ConnectTime", PlayerInfo[playerid][pConnectTime]);
dini_IntSet(string, "DonateTime", PlayerInfo[playerid][pDonateTime]);
dini_IntSet(string, "Jailed", PlayerInfo[playerid][pJailed]);
dini_IntSet(string, "JailTime", PlayerInfo[playerid][pJailTime]);
dini_IntSet(string, "Drugs", PlayerInfo[playerid][pDrugs]);
dini_IntSet(string, "Materials", PlayerInfo[playerid][pMats]);
dini_IntSet(string, "VaultOwned", PlayerInfo[playerid][pVaultOwned]);
dini_IntSet(string, "VaultDrugs", PlayerInfo[playerid][pVaultDrugs]);
dini_IntSet(string, "VaultMats", PlayerInfo[playerid][pVaultMats]);
dini_IntSet(string, "Watch", PlayerInfo[playerid][pWatch]);
dini_IntSet(string, "PhoneBook", PlayerInfo[playerid][pPhoneBook]);
dini_IntSet(string, "Mask", PlayerInfo[playerid][pMask]);
dini_IntSet(string, "CarLic", PlayerInfo[playerid][pDrivLic]);
dini_IntSet(string, "Car", PlayerInfo[playerid][pCarkey]);
dini_IntSet(string, "Car2", PlayerInfo[playerid][pCarkey2]);
dini_IntSet(string, "Car3", PlayerInfo[playerid][pCarkey3]);
dini_IntSet(string, "Married", PlayerInfo[playerid][pMarried]);
dini_IntSet(string, "Helper", PlayerInfo[playerid][pHelper]);
dini_IntSet(string, "WantedLevel", PlayerInfo2[WantedLevel][playerid]);
dini_IntSet(string, "GunLic", PlayerInfo[playerid][pGunLic]);
dini_IntSet(string, "Crimes", PlayerInfo[playerid][pCrimes]);
dini_IntSet(string, "Arrested", PlayerInfo[playerid][pArrested]);
dini_Set(string, "MarriedTo", PlayerInfo[playerid][pMarriedTo]);
dini_Set(string, "Taunt", PlayerInfo[playerid][pTaunt]);
dini_IntSet(string, "DonateCarDate", PlayerInfo[playerid][pDonatorCarDate]);
dini_IntSet(string, "Warrant", PlayerInfo[playerid][pWarrant]);
dini_Set(string, "WarrantReason", PlayerInfo[playerid][pWarrantReason]);
dini_IntSet(string, "FactionIdent", PlayerInfo[playerid][pFactionIden]);
dini_IntSet(string, "GunSkill", PlayerInfo[playerid][pGunSkill]);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Unable to register, account exists.");
Kick(playerid);
return 1;
}
}
return 1;
}
pawn Код:
public OnPlayerDataSave(playerid)
{
if(IsPlayerConnected(playerid) == 1 && GetPVarInt(playerid, "PlayerLogged") == 1)
{
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
if(strcmp(PlayerInfo[playerid][pName], sendername, true) == 0)
{
TelePos[playerid][0] = 0.0;
TelePos[playerid][1] = 0.0;
new string[128];
format(string, sizeof(string), "users/%s.ini", PlayerName(playerid));
if(dini_Exists(string))
{
PlayerInfo[playerid][pCash] = GetPlayerPCash(playerid);
new Float:armour;
new Float:health;
GetPlayerArmour(playerid,armour);
PlayerInfo[playerid][pCrashArmour] = armour;
GetPlayerHealth(playerid,health);
PlayerInfo[playerid][pCrashHealth] = health;
dini_IntSet(string, "Cash", PlayerInfo[playerid][pCash]);
dini_IntSet(string, "Level", PlayerInfo[playerid][pLevel]);
dini_IntSet(string, "Account", PlayerInfo[playerid][pAccount]);
dini_IntSet(string, "AdminLevel", PlayerInfo[playerid][pAdmin]);
dini_IntSet(string, "Respect", PlayerInfo[playerid][pExp]);
dini_IntSet(string, "UpgradePoints", PlayerInfo[playerid][gPupgrade]);
dini_IntSet(string, "Kills", PlayerInfo[playerid][pKills]);
dini_IntSet(string, "Gun1", PlayerInfo[playerid][pGun1]);
dini_IntSet(string, "Gun2", PlayerInfo[playerid][pGun2]);
dini_IntSet(string, "Gun3", PlayerInfo[playerid][pGun3]);
dini_IntSet(string, "Gun4", PlayerInfo[playerid][pGun4]);
dini_IntSet(string, "Gun5", PlayerInfo[playerid][pGun5]);
dini_IntSet(string, "Gun6", PlayerInfo[playerid][pGun6]);
dini_IntSet(string, "Ammo1", PlayerInfo[playerid][pAmmo1]);
dini_IntSet(string, "Ammo2", PlayerInfo[playerid][pAmmo2]);
dini_IntSet(string, "Ammo3", PlayerInfo[playerid][pAmmo3]);
dini_IntSet(string, "Ammo4", PlayerInfo[playerid][pAmmo4]);
dini_IntSet(string, "Ammo5", PlayerInfo[playerid][pAmmo5]);
dini_IntSet(string, "Ammo6", PlayerInfo[playerid][pAmmo6]);
dini_FloatSet(string, "pSHealth", PlayerInfo[playerid][pSHealth]);
GetPlayerHealth(playerid,PlayerInfo[playerid][pHealth]);
dini_FloatSet(string, "Health", PlayerInfo[playerid][pHealth]);
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid,x,y,z);
PlayerInfo[playerid][pPos_x] = x;
PlayerInfo[playerid][pPos_y] = y;
PlayerInfo[playerid][pPos_z] = z;
dini_FloatSet(string, "Pos_x", PlayerInfo[playerid][pPos_x]);
dini_FloatSet(string, "Pos_y", PlayerInfo[playerid][pPos_y]);
dini_FloatSet(string, "Pos_z", PlayerInfo[playerid][pPos_z]);
dini_IntSet(string, "Int", PlayerInfo[playerid][pInt]);
dini_IntSet(string, "Local", PlayerInfo[playerid][pLocal]);
dini_IntSet(string, "Char", PlayerInfo[playerid][pModel]);
dini_IntSet(string, "PhoneNr", PlayerInfo[playerid][pPnumber]);
dini_IntSet(string, "pHouseKey", PlayerInfo[playerid][pHousekey]);
dini_IntSet(string, "Bizz", PlayerInfo[playerid][pPbiskey]);
dini_IntSet(string, "Banned", PlayerInfo[playerid][pBanned]);
dini_IntSet(string, "FightSkill", PlayerInfo[playerid][pFightSkill]);
dini_IntSet(string, "Sex", PlayerInfo[playerid][pSex]);
dini_IntSet(string, "Age", PlayerInfo[playerid][pAge]);
dini_IntSet(string, "Tutorial", PlayerInfo[playerid][pTut]);
dini_IntSet(string, "Member", PlayerInfo[playerid][pMember]);
dini_IntSet(string, "Rank", PlayerInfo[playerid][pRank]);
dini_IntSet(string, "Crashed", PlayerInfo[playerid][pCrashed]);
dini_IntSet(string, "Job", PlayerInfo[playerid][pJob]);
dini_IntSet(string, "HouseEntered", PlayerInfo2[HouseEntered][playerid]);
dini_IntSet(string, "IntEntered", PlayerInfo2[IntEntered][playerid]);
dini_FloatSet(string, "CrashHealth",PlayerInfo[playerid][pCrashHealth]);
dini_FloatSet(string, "CrashArmour",PlayerInfo[playerid][pCrashArmour]);
dini_IntSet(string, "World", PlayerInfo[playerid][pWorld]);
dini_IntSet(string, "PayCheck", PlayerInfo[playerid][pPayCheck]);
dini_IntSet(string, "PayDay", PlayerInfo[playerid][pPayDay]);
dini_IntSet(string, "DonateRank", PlayerInfo[playerid][pDonateRank]);
dini_IntSet(string, "ConnectTime", PlayerInfo[playerid][pConnectTime]);
dini_IntSet(string, "DonateTime", PlayerInfo[playerid][pDonateTime]);
dini_IntSet(string, "Jailed", PlayerInfo[playerid][pJailed]);
dini_IntSet(string, "JailTime", PlayerInfo[playerid][pJailTime]);
dini_IntSet(string, "Drugs", PlayerInfo[playerid][pDrugs]);
dini_IntSet(string, "Materials", PlayerInfo[playerid][pMats]);
dini_IntSet(string, "VaultOwned", PlayerInfo[playerid][pVaultOwned]);
dini_IntSet(string, "VaultDrugs", PlayerInfo[playerid][pVaultDrugs]);
dini_IntSet(string, "VaultMats", PlayerInfo[playerid][pVaultMats]);
dini_IntSet(string, "Watch", PlayerInfo[playerid][pWatch]);
dini_IntSet(string, "PhoneBook", PlayerInfo[playerid][pPhoneBook]);
dini_IntSet(string, "Mask", PlayerInfo[playerid][pMask]);
dini_IntSet(string, "CarLic", PlayerInfo[playerid][pDrivLic]);
dini_IntSet(string, "Car", PlayerInfo[playerid][pCarkey]);
dini_IntSet(string, "Car2", PlayerInfo[playerid][pCarkey2]);
dini_IntSet(string, "Car3", PlayerInfo[playerid][pCarkey3]);
dini_IntSet(string, "Married", PlayerInfo[playerid][pMarried]);
dini_IntSet(string, "Helper", PlayerInfo[playerid][pHelper]);
dini_IntSet(string, "WantedLevel", PlayerInfo2[WantedLevel][playerid]);
dini_IntSet(string, "GunLic", PlayerInfo[playerid][pGunLic]);
dini_IntSet(string, "Crimes", PlayerInfo[playerid][pCrimes]);
dini_IntSet(string, "Arrested", PlayerInfo[playerid][pArrested]);
dini_Set(string, "MarriedTo", PlayerInfo[playerid][pMarriedTo]);
dini_Set(string, "Taunt", PlayerInfo[playerid][pTaunt]);
dini_IntSet(string, "InvWeapon", PlayerInfo[playerid][pInvWeapon]);
dini_IntSet(string, "InvAmmo", PlayerInfo[playerid][pInvAmmo]);
dini_IntSet(string, "InvBeer", PlayerInfo[playerid][pInvBeer]);
dini_IntSet(string, "InvWine", PlayerInfo[playerid][pInvWine]);
dini_IntSet(string, "InvCiggy", PlayerInfo[playerid][pInvCiggy]);
dini_IntSet(string, "Hidden", PlayerInfo[playerid][pHidden]);
dini_IntSet(string, "Walkie", PlayerInfo[playerid][pWalkie]);
dini_IntSet(string, "WalkieFreq", PlayerInfo[playerid][pWalkieFreq]);
dini_IntSet(string, "Lighter", PlayerInfo[playerid][pLighter]);
dini_IntSet(string, "Cigs", PlayerInfo[playerid][pCigs]);
dini_Set(string, "BanReason", PlayerInfo[playerid][pBanReason]);
dini_Set(string, "Fishes1", PlayerInfo[playerid][pFishes1]);
dini_Set(string, "Fishes2", PlayerInfo[playerid][pFishes2]);
dini_Set(string, "Fishes3", PlayerInfo[playerid][pFishes3]);
dini_Set(string, "Fishes4", PlayerInfo[playerid][pFishes4]);
dini_Set(string, "Fishes5", PlayerInfo[playerid][pFishes5]);
dini_IntSet(string, "Fish1", PlayerInfo[playerid][pFish][0]);
dini_IntSet(string, "Fish2", PlayerInfo[playerid][pFish][1]);
dini_IntSet(string, "Fish3", PlayerInfo[playerid][pFish][2]);
dini_IntSet(string, "Fish4", PlayerInfo[playerid][pFish][3]);
dini_IntSet(string, "Fish5", PlayerInfo[playerid][pFish][4]);
dini_IntSet(string, "Note1s", PlayerInfo[playerid][pNote1s]);
dini_IntSet(string, "Note2s", PlayerInfo[playerid][pNote2s]);
dini_IntSet(string, "Note3s", PlayerInfo[playerid][pNote3s]);
dini_IntSet(string, "Note4s", PlayerInfo[playerid][pNote4s]);
dini_IntSet(string, "Note5s", PlayerInfo[playerid][pNote5s]);
dini_Set(string, "Note1", PlayerInfo[playerid][pNote1]);
dini_Set(string, "Note2", PlayerInfo[playerid][pNote2]);
dini_Set(string, "Note3", PlayerInfo[playerid][pNote3]);
dini_Set(string, "Note4", PlayerInfo[playerid][pNote4]);
dini_Set(string, "Note5", PlayerInfo[playerid][pNote5]);
dini_IntSet(string, "JobDelay", PlayerInfo2[JobDelay][playerid]);
dini_IntSet(string, "Mask", PlayerInfo[playerid][pMask]);
dini_IntSet(string, "MaskUse", PlayerInfo[playerid][pMaskUse]);
dini_Set(string, "Accent", PlayerInfo[playerid][pAccent]);
dini_IntSet(string, "Voted2", PlayerInfo[playerid][pVoted]);
dini_Set(string, "AdmName", PlayerInfo[playerid][pAdmName]);
dini_IntSet(string, "HeadValue", PlayerInfo[playerid][pHeadValue]);
dini_IntSet(string, "HiddenNum", PlayerInfo[playerid][pHiddenNum]);
dini_IntSet(string, "Skate", PlayerInfo[playerid][pSkate]);
dini_IntSet(string, "Radio", PlayerInfo[playerid][pRadio]);
dini_IntSet(string, "Ticket0", PlayerInfo[playerid][pTicket][0]);
dini_IntSet(string, "Ticket1", PlayerInfo[playerid][pTicket][1]);
dini_IntSet(string, "Ticket2", PlayerInfo[playerid][pTicket][2]);
dini_IntSet(string, "Ticket3", PlayerInfo[playerid][pTicket][3]);
dini_IntSet(string, "Ticket4", PlayerInfo[playerid][pTicket][4]);
dini_Set(string, "TicketReason0", PlayerInfo[playerid][pTicketReason0]);
dini_Set(string, "TicketReason1", PlayerInfo[playerid][pTicketReason1]);
dini_Set(string, "TicketReason2", PlayerInfo[playerid][pTicketReason2]);
dini_Set(string, "TicketReason3", PlayerInfo[playerid][pTicketReason3]);
dini_Set(string, "TicketReason4", PlayerInfo[playerid][pTicketReason4]);
dini_Set(string, "JailReason", PlayerInfo[playerid][pJailReason]);
dini_Set(string, "App", PlayerInfo[playerid][pApp]);
dini_IntSet(string, "Changes", PlayerInfo[playerid][pChanges]);
dini_IntSet(string, "FamNum", PlayerInfo[playerid][pFamNum]);
dini_Set(string, "Tattoo", PlayerInfo[playerid][pTattoo]);
dini_IntSet(string, "Cellphone", PlayerInfo[playerid][pCellphone]);
dini_IntSet(string, "Celltime", PlayerInfo[playerid][pCelltime]);
dini_IntSet(string, "Cellplan", PlayerInfo[playerid][pCellplan]);
dini_IntSet(string, "DonerGate1", PlayerInfo[playerid][pDonerGate1]);
dini_IntSet(string, "BreakAllow", PlayerInfo[playerid][pBreakAllow]);
dini_IntSet(string, "DonateCarDate", PlayerInfo[playerid][pDonatorCarDate]);
dini_IntSet(string, "Warrant", PlayerInfo[playerid][pWarrant]);
dini_Set(string, "WarrantReason", PlayerInfo[playerid][pWarrantReason]);
dini_IntSet(string, "FactionIdent", PlayerInfo[playerid][pFactionIden]);
dini_IntSet(string, "GunSkill", PlayerInfo[playerid][pGunSkill]);
dini_IntSet(string, "DriverSus", PlayerInfo[playerid][pDriverSus]);
dini_IntSet(string, "Guide", PlayerInfo[playerid][pGuide]);
dini_IntSet(string, "AJails", PlayerInfo[playerid][pAJails]);
dini_IntSet(string, "Bans", PlayerInfo[playerid][pBans]);
dini_IntSet(string, "Kicks", PlayerInfo[playerid][pKicks]);
dini_IntSet(string, "Water", PlayerInfo[playerid][pWater]);
dini_IntSet(string, "Chem", PlayerInfo[playerid][pChem]);
}
}
}
return 1;
}