20.01.2014, 10:14
Код HTML:
public OnPlayerLogin(playerid,password[]) { if(GetPVarInt(playerid, "PlayerLogged") != 0) return true; new string[128]; format(string, sizeof(string), "users/%s.ini", PlayerName(playerid)); Hash(password); if(strcmp(DOF2_GetString(string, "Key"), password, true) == 0) { if(DOF2_GetInt(string, "Convert") != 5) return Kick(playerid); // Load Ints // SetPVarInt(playerid, "PlayerCash", DOF2_GetInt(string, "Cash")); SetPVarInt(playerid, "Model", DOF2_GetInt(string, "Model")); SetPVarInt(playerid, "Crash", DOF2_GetInt(string, "Crash")); SetPVarInt(playerid, "Age", DOF2_GetInt(string, "Age")); SetPVarInt(playerid, "Int", DOF2_GetInt(string, "Int")); SetPVarInt(playerid, "World", DOF2_GetInt(string, "World")); SetPVarInt(playerid, "PayDay", DOF2_GetInt(string, "PayDay")); SetPVarInt(playerid, "PayCheck", DOF2_GetInt(string, "PayCheck")); SetPVarInt(playerid, "Bank", DOF2_GetInt(string, "Bank")); SetPVarInt(playerid, "ConnectTime", DOF2_GetInt(string, "ConnectTime")); SetPVarInt(playerid, "Member", DOF2_GetInt(string, "Member")); SetPVarInt(playerid, "Rank", DOF2_GetInt(string, "Rank")); SetPVarInt(playerid, "Weed", DOF2_GetInt(string, "Weed")); SetPVarInt(playerid, "Crack", DOF2_GetInt(string, "Crack")); SetPVarInt(playerid, "Cocaine", DOF2_GetInt(string, "Cocaine")); SetPVarInt(playerid, "HouseKey", DOF2_GetInt(string, "HouseKey")); SetPVarInt(playerid, "BizzKey", DOF2_GetInt(string, "BizzKey")); SetPVarInt(playerid, "CarKey1", DOF2_GetInt(string, "CarKey1")); SetPVarInt(playerid, "CarKey2", DOF2_GetInt(string, "CarKey2")); SetPVarInt(playerid, "CarKey3", DOF2_GetInt(string, "CarKey3")); SetPVarInt(playerid, "Admin", DOF2_GetInt(string, "Admin")); SetPVarInt(playerid, "Helper", DOF2_GetInt(string, "Helper")); SetPVarInt(playerid, "Banned", DOF2_GetInt(string, "Banned")); SetPVarInt(playerid, "RegTeam", DOF2_GetInt(string, "RegTeam")); SetPVarInt(playerid, "Approve", DOF2_GetInt(string, "Approve")); SetPVarInt(playerid, "DrugTime", DOF2_GetInt(string, "DrugTime")); SetPVarInt(playerid, "HouseEnter", DOF2_GetInt(string, "HouseEnter")); SetPVarInt(playerid, "BizzEnter", DOF2_GetInt(string, "BizzEnter")); SetPVarInt(playerid, "GunLic", DOF2_GetInt(string, "GunLic")); SetPVarInt(playerid, "DriveLic", DOF2_GetInt(string, "DriveLic")); SetPVarInt(playerid, "PhoneNum", DOF2_GetInt(string, "PhoneNum")); SetPVarInt(playerid, "Job", DOF2_GetInt(string, "Job")); SetPVarInt(playerid, "Jailed", DOF2_GetInt(string, "Jailed")); SetPVarInt(playerid, "JailTime", DOF2_GetInt(string, "JailTime")); PlayerInfo[playerid][pWeapon][0] = DOF2_GetInt(string, "Weapon0"); PlayerInfo[playerid][pWeapon][1] = DOF2_GetInt(string, "Weapon1"); PlayerInfo[playerid][pWeapon][2] = DOF2_GetInt(string, "Weapon2"); PlayerInfo[playerid][pWeapon][3] = DOF2_GetInt(string, "Weapon3"); PlayerInfo[playerid][pWeapon][4] = DOF2_GetInt(string, "Weapon4"); PlayerInfo[playerid][pWeapon][5] = DOF2_GetInt(string, "Weapon5"); PlayerInfo[playerid][pWeapon][6] = DOF2_GetInt(string, "Weapon6"); PlayerInfo[playerid][pWeapon][7] = DOF2_GetInt(string, "Weapon7"); PlayerInfo[playerid][pWeapon][8] = DOF2_GetInt(string, "Weapon8"); PlayerInfo[playerid][pWeapon][9] = DOF2_GetInt(string, "Weapon9"); PlayerInfo[playerid][pWeapon][10] = DOF2_GetInt(string, "Weapon10"); PlayerInfo[playerid][pWeapon][11] = DOF2_GetInt(string, "Weapon11"); PlayerInfo[playerid][pWeapon][12] = DOF2_GetInt(string, "Weapon12"); PlayerInfo[playerid][pAmmo][0] = DOF2_GetInt(string, "Ammo0"); PlayerInfo[playerid][pAmmo][1] = DOF2_GetInt(string, "Ammo1"); PlayerInfo[playerid][pAmmo][2] = DOF2_GetInt(string, "Ammo2"); PlayerInfo[playerid][pAmmo][3] = DOF2_GetInt(string, "Ammo3"); PlayerInfo[playerid][pAmmo][4] = DOF2_GetInt(string, "Ammo4"); PlayerInfo[playerid][pAmmo][5] = DOF2_GetInt(string, "Ammo5"); PlayerInfo[playerid][pAmmo][6] = DOF2_GetInt(string, "Ammo6"); PlayerInfo[playerid][pAmmo][7] = DOF2_GetInt(string, "Ammo7"); PlayerInfo[playerid][pAmmo][8] = DOF2_GetInt(string, "Ammo8"); PlayerInfo[playerid][pAmmo][9] = DOF2_GetInt(string, "Ammo9"); PlayerInfo[playerid][pAmmo][10] = DOF2_GetInt(string, "Ammo10"); PlayerInfo[playerid][pAmmo][11] = DOF2_GetInt(string, "Ammo11"); PlayerInfo[playerid][pAmmo][12] = DOF2_GetInt(string, "Ammo12"); SetPVarInt(playerid, "WantedLevel", DOF2_GetInt(string, "WantedLevel")); SetPVarInt(playerid, "DonateRank", DOF2_GetInt(string, "DonateRank")); SetPVarInt(playerid, "Mask", DOF2_GetInt(string, "Mask")); SetPVarInt(playerid, "MaskID", DOF2_GetInt(string, "MaskID")); SetPVarInt(playerid, "Cellphone", DOF2_GetInt(string, "Cellphone")); SetPVarInt(playerid, "Crimes", DOF2_GetInt(string, "Crimes")); SetPVarInt(playerid, "Arrest", DOF2_GetInt(string, "Arrest")); SetPVarInt(playerid, "Changes", DOF2_GetInt(string, "Changes")); SetPVarInt(playerid, "Sex", DOF2_GetInt(string, "Sex")); SetPVarInt(playerid, "Tut", DOF2_GetInt(string, "Tutorial")); SetPVarInt(playerid, "CarTicket", DOF2_GetInt(string, "CarTicket")); SetPVarInt(playerid, "FightStyle", DOF2_GetInt(string, "Fightstyle")); SetPVarInt(playerid, "WalkieTalkie", DOF2_GetInt(string, "WalkieTalkie")); SetPVarInt(playerid, "WalkieFreq", DOF2_GetInt(string, "WalkieFreq")); PlayerInfo[playerid][pTicket][0] = DOF2_GetInt(string, "Ticket1"); PlayerInfo[playerid][pTicket][1] = DOF2_GetInt(string, "Ticket2"); PlayerInfo[playerid][pTicket][2] = DOF2_GetInt(string, "Ticket3"); PlayerInfo[playerid][pTicket][3] = DOF2_GetInt(string, "Ticket4"); PlayerInfo[playerid][pTicket][4] = DOF2_GetInt(string, "Ticket5"); SetPVarInt(playerid, "Bans", DOF2_GetInt(string, "Bans")); SetPVarInt(playerid, "Kicks", DOF2_GetInt(string, "Kicks")); SetPVarInt(playerid, "Jails", DOF2_GetInt(string, "Jails")); SetPVarInt(playerid, "CheckEarn", DOF2_GetInt(string, "CheckEarn")); SetPVarInt(playerid, "CarTicket", DOF2_GetInt(string, "CarTicket")); SetPVarInt(playerid, "Changes", DOF2_GetInt(string, "Changes")); SetPVarInt(playerid, "Cigs", DOF2_GetInt(string, "Cigs")); SetPVarInt(playerid, "Lighter", DOF2_GetInt(string, "Lighter")); SetPVarInt(playerid, "Dead", DOF2_GetInt(string, "Dead")); SetPVarInt(playerid, "WalkStyle", DOF2_GetInt(string, "WalkStyle")); SetPVarInt(playerid, "ChatStyle", DOF2_GetInt(string, "Chatstyle")); SetPVarInt(playerid, "Bag", DOF2_GetInt(string, "Bag")); SetPVarInt(playerid, "CellID", DOF2_GetInt(string, "CellID")); SetPVarInt(playerid, "GasCan", DOF2_GetInt(string, "GasCan")); SetPVarInt(playerid, "App", DOF2_GetInt(string, "App")); SetPVarInt(playerid, "InvWeapon", DOF2_GetInt(string, "InvWeapon")); SetPVarInt(playerid, "InvAmmo", DOF2_GetInt(string, "InvAmmo")); SetPVarInt(playerid, "Clothes1", DOF2_GetInt(string, "Clothes1")); SetPVarInt(playerid, "Clothes2", DOF2_GetInt(string, "Clothes2")); SetPVarInt(playerid, "Clothes3", DOF2_GetInt(string, "Clothes3")); SetPVarInt(playerid, "Clothes4", DOF2_GetInt(string, "Clothes4")); SetPVarInt(playerid, "Clothes5", DOF2_GetInt(string, "Clothes5")); SetPVarInt(playerid, "Bait", DOF2_GetInt(string, "Bait")); SetPVarInt(playerid, "FishingRod", DOF2_GetInt(string, "FishingRod")); SetPVarInt(playerid, "FishLine", DOF2_GetInt(string, "FishLine")); SetPVarInt(playerid, "Lazer", DOF2_GetInt(string, "Lazer")); SetPVarInt(playerid, "Duty", DOF2_GetInt(string, "Duty")); SetPVarInt(playerid, "Ciggy", DOF2_GetInt(string, "Ciggy")); SetPVarInt(playerid, "Beer", DOF2_GetInt(string, "Beer")); SetPVarInt(playerid, "Wine", DOF2_GetInt(string, "Wine")); SetPVarInt(playerid, "Motel", DOF2_GetInt(string, "Motel")); SetPVarInt(playerid, "Contract", DOF2_GetInt(string, "Contract")); SetPVarInt(playerid, "HighType", DOF2_GetInt(string, "HighType")); SetPVarInt(playerid, "HiddenNum", DOF2_GetInt(string, "HiddenNum")); SetPVarInt(playerid, "Watch", DOF2_GetInt(string, "Watch")); SetPVarInt(playerid, "Crashes", DOF2_GetInt(string, "Crashes")); SetPVarInt(playerid, "BreakKit", DOF2_GetInt(string, "BreakKit")); SetPVarInt(playerid, "RentCar", DOF2_GetInt(string, "RentCar")); SetPVarInt(playerid, "JobCar", DOF2_GetInt(string, "JobCar")); PlayerInfo[playerid][pdSuspensionDay]=DOF2_GetInt(string, "PdSuspensionDay"); PlayerInfo[playerid][pdSuspensionMonth]=DOF2_GetInt(string, "PdSuspensionMonth"); PlayerInfo[playerid][pdSuspensionYear]=DOF2_GetInt(string, "PdSuspensionYear"); SetPVarInt(playerid, "IntEnter", DOF2_GetInt(string, "IntEnter")); SetPVarInt(playerid, "Logs", DOF2_GetInt(string, "Logs")); SetPVarInt(playerid, "Cuffed", DOF2_GetInt(string, "Cuffed")); SetPVarInt(playerid, "CuffedTime", DOF2_GetInt(string, "CuffedTime")); SetPVarInt(playerid, "JobTime", DOF2_GetInt(string, "JobTime")); SetPVarInt(playerid, "Deaths", DOF2_GetInt(string, "Deaths")); SetPVarInt(playerid, "PMMsg", DOF2_GetInt(string, "PMMsg")); SetPVarInt(playerid, "CellCol", DOF2_GetInt(string, "CellCol")); SetPVarInt(playerid, "HudCol", DOF2_GetInt(string, "HudCol")); SetPVarInt(playerid, "HudHide", DOF2_GetInt(string, "HudHide")); SetPVarInt(playerid, "Wound", DOF2_GetInt(string, "Wound")); SetPVarInt(playerid, "Addiction", DOF2_GetInt(string, "Addiction")); SetPVarInt(playerid, "Bail", DOF2_GetInt(string, "Bail")); SetPVarInt(playerid, "LicGuns", DOF2_GetInt(string, "LicGuns")); SetPVarInt(playerid, "LicTime", DOF2_GetInt(string, "LicTime")); SetPVarInt(playerid, "Strikes", DOF2_GetInt(string, "Strikes")); SetPVarInt(playerid, "OOCStats", DOF2_GetInt(string, "OOCStats")); SetPVarInt(playerid, "FactPerm", DOF2_GetInt(string, "FactPerm")); SetPVarInt(playerid, "DuffleBag", DOF2_GetInt(string, "DuffleBag")); SetPVarInt(playerid, "DufMoney", DOF2_GetInt(string, "DufMoney")); SetPVarInt(playerid, "DufWeed", DOF2_GetInt(string, "DufWeed")); SetPVarInt(playerid, "DufCrack", DOF2_GetInt(string, "DufCrack")); SetPVarInt(playerid, "DufCocaine", DOF2_GetInt(string, "DufCocaine")); SetPVarInt(playerid, "DufGun1", DOF2_GetInt(string, "DufGun1")); SetPVarInt(playerid, "DufGun2", DOF2_GetInt(string, "DufGun2")); SetPVarInt(playerid, "DufGun3", DOF2_GetInt(string, "DufGun3")); SetPVarInt(playerid, "DufGun4", DOF2_GetInt(string, "DufGun4")); SetPVarInt(playerid, "DufGunA1", DOF2_GetInt(string, "DufGunA1")); SetPVarInt(playerid, "DufGunA2", DOF2_GetInt(string, "DufGunA2")); SetPVarInt(playerid, "DufGunA3", DOF2_GetInt(string, "DufGunA3")); SetPVarInt(playerid, "DufGunA4", DOF2_GetInt(string, "DufGunA4")); SetPVarInt(playerid, "GunLaw", DOF2_GetInt(string, "GunLaw")); SetPVarInt(playerid, "GunLawT", DOF2_GetInt(string, "GunLawT")); SetPVarInt(playerid, "Bomb", DOF2_GetInt(string, "Bomb")); SetPVarInt(playerid, "DrugUsage", DOF2_GetInt(string, "DrugUsage")); SetPVarInt(playerid, "DrugDay", DOF2_GetInt(string, "DrugDay")); SetPVarInt(playerid, "RingNum", DOF2_GetInt(string, "RingNum")); SetPVarInt(playerid, "Raise", DOF2_GetInt(string, "Raise")); //SetPVarInt(playerid, "SpouseKey", DOF2_GetInt(string, "SpouseKey")); //SetPVarInt(playerid, "HouseKey2", DOF2_GetInt(string, "HouseKey2")); //SetPVarInt(playerid, "SpouseKeyOwn", DOF2_GetInt(string, "SpouseKeyOwn")); SetPVarInt(playerid, "Gunrack", DOF2_GetInt(string, "Gunrack")); // Load Floats // SetPVarFloat(playerid, "PosX", DOF2_GetFloat(string, "PosX")); SetPVarFloat(playerid, "PosY", DOF2_GetFloat(string, "PosY")); SetPVarFloat(playerid, "PosZ", DOF2_GetFloat(string, "PosZ")); SetPVarFloat(playerid, "Health", DOF2_GetFloat(string, "Health")); SetPVarFloat(playerid, "Armour", DOF2_GetFloat(string, "Armour")); // Load Strings // strmid(PlayerInfo[playerid][pAdmName], DOF2_GetString(string, "AdmName"), 0, strlen(DOF2_GetString(string, "AdmName")), 255); strmid(PlayerInfo[playerid][pAccent], DOF2_GetString(string, "Accent"), 0, strlen(DOF2_GetString(string, "Accent")), 255); strmid(PlayerInfo[playerid][pDescribe], DOF2_GetString(string, "Describe"), 0, strlen(DOF2_GetString(string, "Describe")), 255); strmid(PlayerInfo[playerid][pDescribe2], DOF2_GetString(string, "Describe2"), 0, strlen(DOF2_GetString(string, "Describe2")), 255); strmid(PlayerInfo[playerid][pBanReason], DOF2_GetString(string, "BanReason"), 0, strlen(DOF2_GetString(string, "BanReason")), 255); strmid(TicketReason[playerid][0], DOF2_GetString(string, "TicketReason1"), 0, strlen(DOF2_GetString(string, "TicketReason1")), 255); strmid(TicketReason[playerid][1], DOF2_GetString(string, "TicketReason2"), 0, strlen(DOF2_GetString(string, "TicketReason2")), 255); strmid(TicketReason[playerid][2], DOF2_GetString(string, "TicketReason3"), 0, strlen(DOF2_GetString(string, "TicketReason3")), 255); strmid(TicketReason[playerid][3], DOF2_GetString(string, "TicketReason4"), 0, strlen(DOF2_GetString(string, "TicketReason4")), 255); strmid(TicketReason[playerid][4], DOF2_GetString(string, "TicketReason5"), 0, strlen(DOF2_GetString(string, "TicketReason5")), 255); strmid(PlayerInfo[playerid][pNote1], DOF2_GetString(string, "Note1"), 0, strlen(DOF2_GetString(string, "Note1")), 255); strmid(PlayerInfo[playerid][pNote2], DOF2_GetString(string, "Note2"), 0, strlen(DOF2_GetString(string, "Note2")), 255); strmid(PlayerInfo[playerid][pNote3], DOF2_GetString(string, "Note3"), 0, strlen(DOF2_GetString(string, "Note3")), 255); strmid(PlayerInfo[playerid][pNote4], DOF2_GetString(string, "Note4"), 0, strlen(DOF2_GetString(string, "Note4")), 255); strmid(PlayerInfo[playerid][pNote5], DOF2_GetString(string, "Note5"), 0, strlen(DOF2_GetString(string, "Note5")), 255); strmid(PlayerInfo[playerid][pJailReason], DOF2_GetString(string, "JailReason"), 0, strlen(DOF2_GetString(string, "JailReason")), 255); strmid(PlayerInfo[playerid][pTaunt], DOF2_GetString(string, "Taunt"), 0, strlen(DOF2_GetString(string, "Taunt")), 255); strmid(PlayerInfo[playerid][pWarning], DOF2_GetString(string, "Warning"), 0, strlen(DOF2_GetString(string, "Warning")), 255); strmid(PlayerInfo[playerid][pMarriedTo], DOF2_GetString(string, "MarriedTo"), 0, strlen(DOF2_GetString(string, "MarriedTo")), 255); strmid(PlayerInfo[playerid][pWarrant], DOF2_GetString(string, "Warrant"), 0, strlen(DOF2_GetString(string, "Warrant")), 255); strmid(PlayerInfo[playerid][pParole], DOF2_GetString(string,"Parole"), 0, strlen(DOF2_GetString(string, "Parole")), 255); strmid(PlayerInfo[playerid][pMaskT], DOF2_GetString(string,"MaskT"), 0, strlen(DOF2_GetString(string, "MaskT")), 255); strmid(PlayerInfo[playerid][pLBannedBy], DOF2_GetString(string, "LBannedBy"), 0, strlen(DOF2_GetString(string, "LBannedBy")), 255); DeletePVar(playerid,"CameraPos"); DeletePVar(playerid,"CameraDelay"); FadeTime[playerid]=0; FadeScreen(playerid, 1); ClearChatbox(playerid,50); SetPVarInt(playerid,"PlayerLogged",2); SetPVarInt(playerid, "AfkMark", 0); //if(GetPVarInt(playerid, "HouseKey2") > 1000 || GetPVarInt(playerid, "HouseKey2") < 1) SetPVarInt(playerid, "HouseKey2", 1000); //if(GetPVarInt(playerid, "SpouseKey") > 1 || GetPVarInt(playerid, "SpouseKey") < 0) SetPVarInt(playerid, "SpouseKey", 0); // Admin Login // if(DOF2_GetInt(string, "Admin") >= 1 && AdminUser(playerid)) ShowPlayerDialog(playerid,140,DIALOG_STYLE_PASSWORD,"Admin Login","Please login to your admin account.","Login", ""); } else { if(GetPVarInt(playerid, "WrongPassword") >= 5) { SendClientMessage(playerid,COLOR_LIGHTRED,"You have been banned for entering the wrong password in five times."); BanExtra(playerid,"Wrong Password","Project-Bot"); format(string, sizeof(string), "%s was banned for Wrong Password by Project-Bot System.", PlayerName(playerid)); BanLog(string); } else { SetPVarInt(playerid, "WrongPassword", 1+GetPVarInt(playerid, "WrongPassword")); new amount = 5 - GetPVarInt(playerid, "WrongPassword"); format(string, sizeof(string),"Invalid password (%d tries left).", amount); SendClientMessage(playerid,COLOR_LIGHTRED,string); ShowPlayerDialog(playerid,36,DIALOG_STYLE_PASSWORD,"Server Account","An existing account is using your playername, please login to the account.\nIf you can't support this dialog select the (next) option.","Login", "Next"); } } return 1; }