Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerLogin(playerid,password[])
- {
- new playername2[MAX_PLAYER_NAME];
- GetPlayerName(playerid, playername2, sizeof(playername2));
- GameTextForPlayer(playerid, "~w~LOADING...~n~~y~CHECKING THE PASSWORD", 700, 3);
- new qstr[256];
- format(qstr,100,"SELECT * FROM users WHERE `name`='%s' AND `password`='%s'",playername2,password);
- new Cache: pass = mysql_query(SQL,qstr);
- if(cache_get_row_count() > 0)
- {
- cache_get_field_content(0, "password", PlayerInfo[playerid][pKey], SQL, 130);
- cache_get_field_content(0, "name", PlayerInfo[playerid][pNormalName], SQL, 130);
- PlayerInfo[playerid][pLevel] = cache_get_field_content_int(0, "Level");
- PlayerInfo[playerid][pAdmin] = cache_get_field_content_int(0, "Admin");
- PlayerInfo[playerid][pHelper] = cache_get_field_content_int(0, "Helper");
- PlayerInfo[playerid][pPremiumAccount] = cache_get_field_content_int(0, "Premium");
- PlayerInfo[playerid][pPremiumPoints] = cache_get_field_content_int(0, "PremiumPoints");
- PlayerInfo[playerid][pConnectTime] = cache_get_field_content_int(0, "ConnectedTime");
- PlayerInfo[playerid][pReg] = cache_get_field_content_int(0, "Registered");
- PlayerInfo[playerid][pSex] = cache_get_field_content_int(0, "Sex");
- PlayerInfo[playerid][pAge] = cache_get_field_content_int(0, "Age");
- PlayerInfo[playerid][pOrigin] = cache_get_field_content_int(0, "Origin");
- PlayerInfo[playerid][pMuted] = cache_get_field_content_int(0, "Muted");
- PlayerInfo[playerid][pMuteTime] = cache_get_field_content_int(0, "MuteTime");
- PlayerInfo[playerid][pExp] = cache_get_field_content_int(0, "Respect");
- PlayerInfo[playerid][pCash] = cache_get_field_content_int(0, "Money");
- PlayerInfo[playerid][pAccount] = cache_get_field_content_int(0, "Bank");
- PlayerInfo[playerid][pCrimes] = cache_get_field_content_int(0, "Crimes");
- PlayerInfo[playerid][pKills] = cache_get_field_content_int(0, "Kills");
- PlayerInfo[playerid][pDeaths] = cache_get_field_content_int(0, "Deaths");
- PlayerInfo[playerid][pArrested] = cache_get_field_content_int(0, "Arrested");
- PlayerInfo[playerid][pWantedDeaths] = cache_get_field_content_int(0, "WantedDeaths");
- PlayerInfo[playerid][pPhoneBook] = cache_get_field_content_int(0, "Phonebook");
- PlayerInfo[playerid][pLottoNr] = cache_get_field_content_int(0, "LottoNr");
- PlayerInfo[playerid][pWantedLevel] = cache_get_field_content_int(0, "WantedLevel");
- PlayerInfo[playerid][pFishes] = cache_get_field_content_int(0, "Fishes");
- PlayerInfo[playerid][pJob] = cache_get_field_content_int(0, "Job");
- PlayerInfo[playerid][pPayCheck] = cache_get_field_content_int(0, "Paycheck");
- PlayerInfo[playerid][pHeadValue] = cache_get_field_content_int(0, "HeadValue");
- PlayerInfo[playerid][pJailed] = cache_get_field_content_int(0, "Jailed");
- PlayerInfo[playerid][pJailTime] = cache_get_field_content_int(0, "JailTime");
- PlayerInfo[playerid][pMats] = cache_get_field_content_int(0, "Materials");
- PlayerInfo[playerid][pDrugs] = cache_get_field_content_int(0, "Drugs");
- PlayerInfo[playerid][pLeader] = cache_get_field_content_int(0, "Leader");
- PlayerInfo[playerid][pMember] = cache_get_field_content_int(0, "Member");
- PlayerInfo[playerid][pRank] = cache_get_field_content_int(0, "Rank");
- PlayerInfo[playerid][pFACWarns] = cache_get_field_content_int(0, "FWarn");
- PlayerInfo[playerid][pFpunish] = cache_get_field_content_int(0, "FPunish");
- PlayerInfo[playerid][pLawyer] = cache_get_field_content_int(0, "Acceptpoints");
- PlayerInfo[playerid][pFishSkill] = cache_get_field_content_int(0, "FishSkill");
- PlayerInfo[playerid][pSpawnChange] = cache_get_field_content_int(0, "SpawnChange");
- PlayerInfo[playerid][pRobSkill] = cache_get_field_content_int(0, "RobSkill");
- PlayerInfo[playerid][pTruckSkill] = cache_get_field_content_int(0, "TruckSkill");
- PlayerInfo[playerid][pTruckTimes] = cache_get_field_content_int(0, "TruckTimes");
- PlayerInfo[playerid][pTruckRem] = cache_get_field_content_int(0, "TruckRem");
- PlayerInfo[playerid][pFarmSkill] = cache_get_field_content_int(0, "FarmSkill");
- PlayerInfo[playerid][pFarmTimes] = cache_get_field_content_int(0, "FarmTimes");
- PlayerInfo[playerid][pFarmRem] = cache_get_field_content_int(0, "FarmRem");
- PlayerInfo[playerid][pFishTimes] = cache_get_field_content_int(0, "FishTimes");
- PlayerInfo[playerid][pFishRem] = cache_get_field_content_int(0, "FishRem");
- PlayerInfo[playerid][pRobRem] = cache_get_field_content_int(0, "RobRem");
- PlayerInfo[playerid][pRobTimes] = cache_get_field_content_int(0, "RobTimes");
- PlayerInfo[playerid][pHealth] = cache_get_field_content_float(0, "pHealth");
- PlayerInfo[playerid][pInt] = cache_get_field_content_int(0, "Inter");
- PlayerInfo[playerid][pLocal] = cache_get_field_content_int(0, "Local");
- PlayerInfo[playerid][pTeam] = cache_get_field_content_int(0, "Team");
- PlayerInfo[playerid][pModel] = cache_get_field_content_int(0, "Model");
- PlayerInfo[playerid][pPnumber] = cache_get_field_content_int(0, "PhoneNr");
- PlayerInfo[playerid][pPhousekey] = cache_get_field_content_int(0, "House");
- PlayerInfo[playerid][pPbiskey] = cache_get_field_content_int(0, "Bizz");
- PlayerInfo[playerid][pPos_x] = cache_get_field_content_float(0, "Pos_x");
- PlayerInfo[playerid][pPos_y] = cache_get_field_content_float(0, "Pos_y");
- PlayerInfo[playerid][pPos_z] = cache_get_field_content_float(0, "Pos_z");
- PlayerInfo[playerid][pRob] = cache_get_field_content_int(0, "Rob");
- PlayerInfo[playerid][pCarLicT] = cache_get_field_content_int(0, "CarLicT");
- PlayerInfo[playerid][pCarLic] = cache_get_field_content_int(0, "CarLic");
- PlayerInfo[playerid][pFlyLicT] = cache_get_field_content_int(0, "FlyLicT");
- PlayerInfo[playerid][pFlyLic] = cache_get_field_content_int(0, "FlyLic");
- PlayerInfo[playerid][pBoatLicT] = cache_get_field_content_int(0, "BoatLicT");
- PlayerInfo[playerid][pBoatLic] = cache_get_field_content_int(0, "BoatLic");
- PlayerInfo[playerid][pGunLicT] = cache_get_field_content_int(0, "GunLicT");
- PlayerInfo[playerid][pGunLic] = cache_get_field_content_int(0, "GunLic");
- PlayerInfo[playerid][pPayDay] = cache_get_field_content_int(0, "PayDay");
- PlayerInfo[playerid][pPayDayHad] = cache_get_field_content_int(0, "PayDayHad");
- PlayerInfo[playerid][pTut] = cache_get_field_content_int(0, "Tutorial");
- PlayerInfo[playerid][pWarns] = cache_get_field_content_int(0, "Warnings");
- PlayerInfo[playerid][pRented] = cache_get_field_content_int(0, "Rented");
- PlayerInfo[playerid][pFuel] = cache_get_field_content_int(0, "Fuel");
- PlayerInfo[playerid][pMarried] = cache_get_field_content_int(0, "Married");
- cache_get_field_content(0, "MarriedTo", PlayerInfo[playerid][pMarriedTo], SQL, 130);
- PlayerInfo[playerid][pWTalkie] = cache_get_field_content_int(0, "WTalkie");
- PlayerInfo[playerid][pLighter] = cache_get_field_content_int(0, "Lighter");
- PlayerInfo[playerid][pCigarettes] = cache_get_field_content_int(0, "Cigarettes");
- cache_get_field_content(0, "Email", PlayerInfo[playerid][pEmail], SQL, 255);
- cache_get_field_content(0, "RegisterDate", PlayerInfo[playerid][pRegistredDate], SQL, 255);
- PlayerInfo[playerid][pBanned] = cache_get_field_content_int(0, "Banned");
- PlayerInfo[playerid][pClan] = cache_get_field_content_int(0, "Clan");
- PlayerInfo[playerid][pRadio] = cache_get_field_content_int(0, "Radio2");
- PlayerInfo[playerid][pHitT] = cache_get_field_content_int(0, "HitT");
- PlayerInfo[playerid][pCRank] = cache_get_field_content_int(0, "CRank");
- PlayerInfo[playerid][pPhone] = cache_get_field_content_int(0, "Phone");
- PlayerInfo[playerid][pSQLID] = cache_get_field_content_int(0, "id");
- PlayerInfo[playerid][pPcarkey] = cache_get_field_content_int(0, "Carkey");
- PlayerInfo[playerid][pmotokey] = cache_get_field_content_int(0, "motokey");
- PlayerInfo[playerid][pprcarkey2] = cache_get_field_content_int(0, "prcarkey2");
- PlayerInfo[playerid][pPPluscarkey] = cache_get_field_content_int(0, "pluscarkey");
- PlayerInfo[playerid][pPPluscarkey2] = cache_get_field_content_int(0, "pluscarkey2");
- PlayerInfo[playerid][pPlusSlot1] = cache_get_field_content_int(0, "PlusSlot1");
- PlayerInfo[playerid][pPlusSlot2] = cache_get_field_content_int(0, "PlusSlot2");
- PlayerInfo[playerid][phelikey] = cache_get_field_content_int(0, "helikey");
- PlayerInfo[playerid][pprcarkey] = cache_get_field_content_int(0, "prcarkey");
- cache_get_field_content(0, "Victim", PlayerInfo[playerid][pVictim], SQL, 255);
- cache_get_field_content(0, "Accused", PlayerInfo[playerid][pAccused], SQL, 255);
- cache_get_field_content(0, "Crime1", PlayerInfo[playerid][pCrime1], SQL, 255);
- cache_get_field_content(0, "Crime2", PlayerInfo[playerid][pCrime2], SQL, 255);
- cache_get_field_content(0, "Crime3", PlayerInfo[playerid][pCrime3], SQL, 255);
- PlayerInfo[playerid][pBTemp] = cache_get_field_content_int(0, "BTemp");
- PlayerInfo[playerid][pBYear] = cache_get_field_content_int(0, "BYear");
- PlayerInfo[playerid][pBMonth] = cache_get_field_content_int(0, "BMonth");
- PlayerInfo[playerid][pBDay] = cache_get_field_content_int(0, "BDay");
- cache_get_field_content(0, "BBy", PlayerInfo[playerid][pBBy], SQL, 255);
- cache_get_field_content(0, "BReason", PlayerInfo[playerid][pBReason], SQL, 255);
- PlayerInfo[playerid][pStatus] = cache_get_field_content_int(0, "Status");
- PlayerInfo[playerid][pALeader] = cache_get_field_content_int(0, "ALeader");
- PlayerInfo[playerid][pLanguage] = cache_get_field_content_int(0, "Language");
- PlayerInfo[playerid][pClanTag] = cache_get_field_content_int(0, "ClanTag");
- PlayerInfo[playerid][pFWorks] = cache_get_field_content_int(0, "FWorks");
- PlayerInfo[playerid][pVirtualPD] = cache_get_field_content_int(0, "VirtualPD");
- PlayerInfo[playerid][pGlasses] = cache_get_field_content_int(0, "Glasses");
- PlayerInfo[playerid][pFactionTime] = cache_get_field_content_int(0, "FactionTime");
- PlayerInfo[playerid][pCredits] = cache_get_field_content_int(0, "CreditsF");
- PlayerInfo[playerid][pNMuted] = cache_get_field_content_int(0, "NMuted");
- PlayerInfo[playerid][pHelpedPlayers] = cache_get_field_content_int(0, "HelpedPlayers");
- }
- else
- {
- new loginstring[128],
- loginname[64],
- stringyy[128];
- GetPlayerName(playerid,loginname,sizeof(loginname));
- if(gPlayerLogTries[playerid] == 2 || gPlayerLogTries[playerid] == 1)
- {
- format(stringyy,sizeof(stringyy),"{FF0000}Incorrect password. You have %d remaining login attempts left.", gPlayerLogTries[playerid]);
- }
- SendClientMessage(playerid, COLOR_RED, stringyy);
- format(loginstring,sizeof(loginstring),"Welcome to the RULEPLAY RPG Server.\nPlease enter your password below!",loginname);
- ShowPlayerDialog(playerid,DIALOG_LOGIN3,DIALOG_STYLE_PASSWORD,"SERVER: Login",loginstring,"Login","Cancel");
- gPlayerLogTries[playerid] -= 1;
- if(gPlayerLogTries[playerid] == 0)
- {
- new stringkick[256],playip[180];
- GetPlayerIp(playerid, playip, sizeof(playip));
- format(stringkick,sizeof(stringkick),"AdmWarn:{FFFFFF} %s has been kicked for entering the wrong password 2 times. IP:%s",loginname,playip);
- ABroadCast(COLOR_RED,stringkick,1);
- KickEx(playerid);
- }
- return 1;
- }
- cache_delete(pass);
- ResetPlayerCash(playerid);
- GivePlayerCash(playerid,PlayerInfo[playerid][pCash]);
- CurrentMoney[playerid] = PlayerInfo[playerid][pCash];
- KillTimer(login[playerid]);
- TempBanCheck(playerid);
- if(PlayerInfo[playerid][pReg] == 0)
- {
- PlayerInfo[playerid][pLevel] = 1;
- PlayerInfo[playerid][pHealth] = 100.0;
- PlayerInfo[playerid][pPos_x] = 2246.6;
- PlayerInfo[playerid][pPos_y] = -1161.9;
- PlayerInfo[playerid][pPos_z] = 1029.7;
- PlayerInfo[playerid][pInt] = 0;
- PlayerInfo[playerid][pLocal] = 255;
- PlayerInfo[playerid][pTeam] = 3;
- PlayerInfo[playerid][pModel] = 250;
- PlayerInfo[playerid][pPnumber] = 0;
- PlayerInfo[playerid][pPhousekey] = 999;
- PlayerInfo[playerid][pPbiskey] = 255;
- PlayerInfo[playerid][pAccount] = 1000;
- PlayerInfo[playerid][pPcarkey] = 0;
- PlayerInfo[playerid][pmotokey] = 0;
- PlayerInfo[playerid][pprcarkey2] = 0;
- PlayerInfo[playerid][pPPluscarkey] = 0;
- PlayerInfo[playerid][pPPluscarkey2] = 0;
- PlayerInfo[playerid][phelikey] = 0;
- PlayerInfo[playerid][pprcarkey] = 0;
- PlayerInfo[playerid][pReg] = 1;
- SetPlayerInterior(playerid,0);
- new string[300],
- str[256],
- d,
- m,
- y,
- h,
- mine,
- s;
- getdate(y,m,d);
- gettime(h,mine,s);
- format(string,sizeof(string), "%d/%d/%d %d:%d:%d",d,m,y,h,mine,s);
- strmid(PlayerInfo[playerid][pRegistredDate], string, 0, strlen(string), 255);
- mysql_format(SQL,str,sizeof(str),"UPDATE users SET `pHealth`='100.0',`Team`='3',`Model`='250' WHERE `name`='%s'",PlayerInfo[playerid][pNormalName]);
- mysql_tquery(SQL,str,"","");
- Update(playerid,pCashx);
- Update(playerid,pLevelx);
- Update(playerid,pPhousekeyx);
- Update(playerid,pPbiskeyx);
- Update(playerid,pPnumberx);
- Update(playerid,pRegx);
- Update(playerid,pRegistredDatex);
- Update(playerid,pPcarkeyx);
- Update(playerid,pmotokeyx);
- Update(playerid,pprcarkey2x);
- Update(playerid,pPPluscarkeyx);
- Update(playerid,pPPluscarkey2x);
- Update(playerid,phelikeyx);
- Update(playerid,pprcarkeyx);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement