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