Guest User

Untitled

a guest
Nov 6th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 31.52 KB | None | 0 0
  1. public OnPlayerLogin(playerid,password[])
  2. {
  3. new playername2[MAX_PLAYER_NAME];
  4. GetPlayerName(playerid, playername2, sizeof(playername2));
  5. GameTextForPlayer(playerid, "~w~LOADING...~n~~y~CHECKING THE PASSWORD", 700, 3);
  6. new playerip[16];
  7. GetPlayerIp(playerid,playerip,sizeof(playerip));
  8. if(NumIp(playerip, playerid) >= 3 && !IsBotOnIP(playerip))
  9. {
  10. SendClientMessage(playerid, COLOR_LIGHTRED, "There are already 2 players connected with same IP.");
  11. Kick(playerid);
  12. return 1;
  13. }
  14. new qstr[256];
  15. format(qstr,100,"SELECT * FROM users WHERE `name`='%s' AND `password`='%s'",playername2,password);
  16. new Cache: pass = mysql_query(SQL,qstr);
  17. if(cache_get_row_count() > 0)
  18. {
  19. cache_get_field_content(0, "password", PlayerInfo[playerid][pKey], SQL, 130);
  20. cache_get_field_content(0, "name", PlayerInfo[playerid][pNormalName], SQL, 130);
  21. PlayerInfo[playerid][pLevel] = cache_get_field_content_int(0, "Level");
  22. PlayerInfo[playerid][pAdmin] = cache_get_field_content_int(0, "Admin");
  23. PlayerInfo[playerid][pHelper] = cache_get_field_content_int(0, "Helper");
  24. PlayerInfo[playerid][pPremiumAccount] = cache_get_field_content_int(0, "Premium");
  25. PlayerInfo[playerid][pPremiumPoints] = cache_get_field_content_int(0, "PremiumPoints");
  26. PlayerInfo[playerid][pConnectTime] = cache_get_field_content_int(0, "ConnectedTime");
  27. PlayerInfo[playerid][pReg] = cache_get_field_content_int(0, "Registered");
  28. PlayerInfo[playerid][pSex] = cache_get_field_content_int(0, "Sex");
  29. PlayerInfo[playerid][pAge] = cache_get_field_content_int(0, "Age");
  30. PlayerInfo[playerid][pGasCan] = cache_get_field_content_int(0, "GasCan");
  31. PlayerInfo[playerid][pOrigin] = cache_get_field_content_int(0, "Origin");
  32. PlayerInfo[playerid][pMuted] = cache_get_field_content_int(0, "Muted");
  33. PlayerInfo[playerid][pMuteTime] = cache_get_field_content_int(0, "MuteTime");
  34. PlayerInfo[playerid][pExp] = cache_get_field_content_int(0, "Respect");
  35. PlayerInfo[playerid][pCash] = cache_get_field_content_int(0, "Money");
  36. PlayerInfo[playerid][pAccount] = cache_get_field_content_int(0, "Bank");
  37. PlayerInfo[playerid][pCrimes] = cache_get_field_content_int(0, "Crimes");
  38. PlayerInfo[playerid][pKills] = cache_get_field_content_int(0, "Kills");
  39. PlayerInfo[playerid][pDeaths] = cache_get_field_content_int(0, "Deaths");
  40. PlayerInfo[playerid][pArrested] = cache_get_field_content_int(0, "Arrested");
  41. PlayerInfo[playerid][pWantedDeaths] = cache_get_field_content_int(0, "WantedDeaths");
  42. PlayerInfo[playerid][pPhoneBook] = cache_get_field_content_int(0, "Phonebook");
  43. PlayerInfo[playerid][pWantedLevel] = cache_get_field_content_int(0, "WantedLevel");
  44. PlayerInfo[playerid][pFishes] = cache_get_field_content_int(0, "Fishes");
  45. PlayerInfo[playerid][pJob] = cache_get_field_content_int(0, "Job");
  46. PlayerInfo[playerid][pPayCheck] = cache_get_field_content_int(0, "Paycheck");
  47. PlayerInfo[playerid][pHeadValue] = cache_get_field_content_int(0, "HeadValue");
  48. PlayerInfo[playerid][pJailed] = cache_get_field_content_int(0, "Jailed");
  49. PlayerInfo[playerid][pJailTime] = cache_get_field_content_int(0, "JailTime");
  50. PlayerInfo[playerid][pMats] = cache_get_field_content_int(0, "Materials");
  51. PlayerInfo[playerid][pDrugs] = cache_get_field_content_int(0, "Drugs");
  52. PlayerInfo[playerid][pLeader] = cache_get_field_content_int(0, "Leader");
  53. PlayerInfo[playerid][pMember] = cache_get_field_content_int(0, "Member");
  54. PlayerInfo[playerid][pRank] = cache_get_field_content_int(0, "Rank");
  55. PlayerInfo[playerid][pFACWarns] = cache_get_field_content_int(0, "FWarn");
  56. PlayerInfo[playerid][pFpunish] = cache_get_field_content_int(0, "FPunish");
  57. PlayerInfo[playerid][pLawyer] = cache_get_field_content_int(0, "Acceptpoints");
  58. PlayerInfo[playerid][pFishSkill] = cache_get_field_content_int(0, "FishSkill");
  59. PlayerInfo[playerid][pSpawnChange] = cache_get_field_content_int(0, "SpawnChange");
  60. PlayerInfo[playerid][pRobSkill] = cache_get_field_content_int(0, "RobSkill");
  61. PlayerInfo[playerid][pTruckSkill] = cache_get_field_content_int(0, "TruckSkill");
  62. PlayerInfo[playerid][pTruckTimes] = cache_get_field_content_int(0, "TruckTimes");
  63. PlayerInfo[playerid][pTruckRem] = cache_get_field_content_int(0, "TruckRem");
  64. PlayerInfo[playerid][pFarmSkill] = cache_get_field_content_int(0, "FarmSkill");
  65. PlayerInfo[playerid][pFarmTimes] = cache_get_field_content_int(0, "FarmTimes");
  66. PlayerInfo[playerid][pFarmRem] = cache_get_field_content_int(0, "FarmRem");
  67. PlayerInfo[playerid][pPizzaSkill] = cache_get_field_content_int(0, "PizzaSkill");
  68. PlayerInfo[playerid][pPizzaTimes] = cache_get_field_content_int(0, "PizzaTimes");
  69. PlayerInfo[playerid][pPizzaRem] = cache_get_field_content_int(0, "PizzaRem");
  70. PlayerInfo[playerid][pArmsSkill] = cache_get_field_content_int(0, "ArmsSkill");
  71. PlayerInfo[playerid][pArmsTimes] = cache_get_field_content_int(0, "ArmsTimes");
  72. PlayerInfo[playerid][pArmsRem] = cache_get_field_content_int(0, "ArmsRem");
  73. PlayerInfo[playerid][pBusSkill] = cache_get_field_content_int(0, "BusSkill");
  74. PlayerInfo[playerid][pBusTimes] = cache_get_field_content_int(0, "BusTimes");
  75. PlayerInfo[playerid][pBusRem] = cache_get_field_content_int(0, "BusRem");
  76. PlayerInfo[playerid][pFishTimes] = cache_get_field_content_int(0, "FishTimes");
  77. PlayerInfo[playerid][pFishRem] = cache_get_field_content_int(0, "FishRem");
  78. PlayerInfo[playerid][pRobRem] = cache_get_field_content_int(0, "RobRem");
  79. PlayerInfo[playerid][pRobTimes] = cache_get_field_content_int(0, "RobTimes");
  80. PlayerInfo[playerid][pHealth] = cache_get_field_content_float(0, "pHealth");
  81. PlayerInfo[playerid][pInt] = cache_get_field_content_int(0, "Inter");
  82. PlayerInfo[playerid][pLocal] = cache_get_field_content_int(0, "Local");
  83. PlayerInfo[playerid][pTeam] = cache_get_field_content_int(0, "Team");
  84. PlayerInfo[playerid][pModel] = cache_get_field_content_int(0, "Model");
  85. PlayerInfo[playerid][pPnumber] = cache_get_field_content_int(0, "PhoneNr");
  86. PlayerInfo[playerid][pPhousekey] = cache_get_field_content_int(0, "House");
  87. PlayerInfo[playerid][pPbiskey] = cache_get_field_content_int(0, "Bizz");
  88. PlayerInfo[playerid][pPos_x] = cache_get_field_content_float(0, "Pos_x");
  89. PlayerInfo[playerid][pPos_y] = cache_get_field_content_float(0, "Pos_y");
  90. PlayerInfo[playerid][pPos_z] = cache_get_field_content_float(0, "Pos_z");
  91. PlayerInfo[playerid][pRob] = cache_get_field_content_int(0, "Rob");
  92. PlayerInfo[playerid][pCarLicT] = cache_get_field_content_int(0, "CarLicT");
  93. PlayerInfo[playerid][pCarLic] = cache_get_field_content_int(0, "CarLic");
  94. PlayerInfo[playerid][pCarLicSuspend] = cache_get_field_content_int(0, "CarLicSuspend");
  95. PlayerInfo[playerid][pGunLicSuspend] = cache_get_field_content_int(0, "GunLicSuspend");
  96. PlayerInfo[playerid][pFlyLicT] = cache_get_field_content_int(0, "FlyLicT");
  97. PlayerInfo[playerid][pFlyLic] = cache_get_field_content_int(0, "FlyLic");
  98. PlayerInfo[playerid][pBoatLicT] = cache_get_field_content_int(0, "BoatLicT");
  99. PlayerInfo[playerid][pBoatLic] = cache_get_field_content_int(0, "BoatLic");
  100. PlayerInfo[playerid][pGunLicT] = cache_get_field_content_int(0, "GunLicT");
  101. PlayerInfo[playerid][pGunLic] = cache_get_field_content_int(0, "GunLic");
  102. PlayerInfo[playerid][pPayDay] = cache_get_field_content_int(0, "PayDay");
  103. PlayerInfo[playerid][pTut] = cache_get_field_content_int(0, "Tutorial");
  104. PlayerInfo[playerid][pWarns] = cache_get_field_content_int(0, "Warnings");
  105. PlayerInfo[playerid][pRented] = cache_get_field_content_int(0, "Rented");
  106. PlayerInfo[playerid][pFuel] = cache_get_field_content_int(0, "Fuel");
  107. PlayerInfo[playerid][pWTalkie] = cache_get_field_content_int(0, "WTalkie");
  108. cache_get_field_content(0, "Email", PlayerInfo[playerid][pEmail], SQL, 255);
  109. cache_get_field_content(0, "RegisterDate", PlayerInfo[playerid][pRegistredDate], SQL, 255);
  110. PlayerInfo[playerid][pClan] = cache_get_field_content_int(0, "Clan");
  111. PlayerInfo[playerid][pHitT] = cache_get_field_content_int(0, "HitT");
  112. PlayerInfo[playerid][pCRank] = cache_get_field_content_int(0, "CRank");
  113. PlayerInfo[playerid][pCWarns] = cache_get_field_content_int(0, "ClanWarns");
  114. PlayerInfo[playerid][pPhone] = cache_get_field_content_int(0, "Phone");
  115. PlayerInfo[playerid][pSQLID] = cache_get_field_content_int(0, "id");
  116. PlayerInfo[playerid][pPcarkey] = cache_get_field_content_int(0, "Carkey");
  117. PlayerInfo[playerid][pmotokey] = cache_get_field_content_int(0, "motokey");
  118. PlayerInfo[playerid][pprcarkey2] = cache_get_field_content_int(0, "prcarkey2");
  119. PlayerInfo[playerid][pPPluscarkey] = cache_get_field_content_int(0, "pluscarkey");
  120. PlayerInfo[playerid][pPPluscarkey2] = cache_get_field_content_int(0, "pluscarkey2");
  121. PlayerInfo[playerid][pPlusSlot1] = cache_get_field_content_int(0, "PlusSlot1");
  122. PlayerInfo[playerid][pPlusSlot2] = cache_get_field_content_int(0, "PlusSlot2");
  123. PlayerInfo[playerid][phelikey] = cache_get_field_content_int(0, "helikey");
  124. PlayerInfo[playerid][pprcarkey] = cache_get_field_content_int(0, "prcarkey");
  125. cache_get_field_content(0, "Victim", PlayerInfo[playerid][pVictim], SQL, 255);
  126. cache_get_field_content(0, "Accused", PlayerInfo[playerid][pAccused], SQL, 255);
  127. cache_get_field_content(0, "Crime1", PlayerInfo[playerid][pCrime1], SQL, 255);
  128. cache_get_field_content(0, "Crime2", PlayerInfo[playerid][pCrime2], SQL, 255);
  129. cache_get_field_content(0, "Crime3", PlayerInfo[playerid][pCrime3], SQL, 255);
  130. PlayerInfo[playerid][pStatus] = cache_get_field_content_int(0, "Status");
  131. PlayerInfo[playerid][pALeader] = cache_get_field_content_int(0, "ALeader");
  132. PlayerInfo[playerid][pLanguage] = cache_get_field_content_int(0, "Language");
  133. PlayerInfo[playerid][pClanTag] = cache_get_field_content_int(0, "ClanTag");
  134. PlayerInfo[playerid][pFWorks] = cache_get_field_content_int(0, "FWorks");
  135. PlayerInfo[playerid][pVirtualPD] = cache_get_field_content_int(0, "VirtualPD");
  136. PlayerInfo[playerid][pGlasses] = cache_get_field_content_int(0, "Glasses");
  137. PlayerInfo[playerid][pFactionTime] = cache_get_field_content_int(0, "FactionTime");
  138. PlayerInfo[playerid][pCredits] = cache_get_field_content_int(0, "CreditsF");
  139. PlayerInfo[playerid][pNMuted] = cache_get_field_content_int(0, "NMuted");
  140. PlayerInfo[playerid][pHelpedPlayers] = cache_get_field_content_int(0, "HelpedPlayers");
  141. PlayerInfo[playerid][pHost] = cache_get_field_content_int(0, "Host");
  142. PlayerInfo[playerid][pPhoneBlock] = cache_get_field_content_int(0, "PhoneBlock");
  143. PlayerInfo[playerid][pHiddenColor] = cache_get_field_content_int(0, "HiddenColor");
  144. PlayerInfo[playerid][pGiftTime] = cache_get_field_content_int(0, "GiftTime");
  145. PlayerInfo[playerid][pQuestMap] = cache_get_field_content_int(0, "QuestMap");
  146. PlayerInfo[playerid][pMP3] = cache_get_field_content_int(0, "MP3");
  147. PlayerInfo[playerid][pHats] = cache_get_field_content_int(0, "Hats");
  148. PlayerInfo[playerid][pFightStyle] = cache_get_field_content_int(0, "FightStyle");
  149. PlayerInfo[playerid][pHUD1] = cache_get_field_content_int(0, "HUD1");
  150. PlayerInfo[playerid][pHUD2] = cache_get_field_content_int(0, "HUD2");
  151. PlayerInfo[playerid][pHUD3] = cache_get_field_content_int(0, "HUD3");
  152. PlayerInfo[playerid][pValoare] = cache_get_field_content_float(0, "Valoare");
  153. PlayerInfo[playerid][pPin] = cache_get_field_content_int(0, "Pin");
  154. PlayerInfo[playerid][pBonus] = cache_get_field_content_int(0, "Bonus");
  155. PlayerInfo[playerid][p1RaportR1] = cache_get_field_content_int(0, "1RaportR1");
  156. PlayerInfo[playerid][p1RaportR2] = cache_get_field_content_int(0, "1RaportR2");
  157. PlayerInfo[playerid][p1RaportR3] = cache_get_field_content_int(0, "1RaportR3");
  158. PlayerInfo[playerid][p1RaportR4] = cache_get_field_content_int(0, "1RaportR4");
  159. PlayerInfo[playerid][p1RaportR5] = cache_get_field_content_int(0, "1RaportR5");
  160. PlayerInfo[playerid][p2RaportR1] = cache_get_field_content_int(0, "2RaportR1");
  161. PlayerInfo[playerid][p2RaportR2] = cache_get_field_content_int(0, "2RaportR2");
  162. PlayerInfo[playerid][p2RaportR3] = cache_get_field_content_int(0, "2RaportR3");
  163. PlayerInfo[playerid][p2RaportR4] = cache_get_field_content_int(0, "2RaportR4");
  164. PlayerInfo[playerid][p2RaportR5] = cache_get_field_content_int(0, "2RaportR5");
  165. PlayerInfo[playerid][pRunners] = cache_get_field_content_int(0, "Runners");
  166. PlayerInfo[playerid][pArrestss] = cache_get_field_content_int(0, "Arrests");
  167. PlayerInfo[playerid][pTickets] = cache_get_field_content_int(0, "Tickets");
  168. PlayerInfo[playerid][pDConfiscate] = cache_get_field_content_int(0, "DConfiscate");
  169. PlayerInfo[playerid][pLConfiscate] = cache_get_field_content_int(0, "DLonfiscate");
  170. PlayerInfo[playerid][pContracts] = cache_get_field_content_int(0, "Contracts");
  171. PlayerInfo[playerid][pNews] = cache_get_field_content_int(0, "News");
  172. PlayerInfo[playerid][pLives] = cache_get_field_content_int(0, "Live");
  173. PlayerInfo[playerid][pOrders] = cache_get_field_content_int(0, "Orders");
  174. PlayerInfo[playerid][pDDeposit] = cache_get_field_content_int(0, "DDeposit");
  175. PlayerInfo[playerid][pMDeposit] = cache_get_field_content_int(0, "MDeposit");
  176. PlayerInfo[playerid][pMUsed] = cache_get_field_content_int(0, "MUsed");
  177. PlayerInfo[playerid][pWKills] = cache_get_field_content_int(0, "WKills");
  178. PlayerInfo[playerid][pWDeaths] = cache_get_field_content_int(0, "WDeaths");
  179. PlayerInfo[playerid][pLGiven] = cache_get_field_content_int(0, "LGiven");
  180. PlayerInfo[playerid][pPHeals] = cache_get_field_content_int(0, "PHeals");
  181. PlayerInfo[playerid][pMoneyD] = cache_get_field_content_int(0, "MoneyD");
  182. cache_get_field_content(0, "lastOn", PlayerInfo[playerid][pLastLogin], SQL, 255);
  183. for(new ev=0; ev<50; ev++)
  184. {
  185. new strb[30];
  186. format(strb, sizeof(strb),"Quest%d",ev);
  187. QEvent[playerid][ev] = cache_get_field_content_int(0, strb);
  188. }
  189. CancelSelectTextDraw(playerid);
  190. PlayerTextDrawHide(playerid, LoginBox0[playerid]);
  191. PlayerTextDrawHide(playerid, LoginBox1[playerid]);
  192. PlayerTextDrawHide(playerid, LoginBox2[playerid]);
  193. PlayerTextDrawHide(playerid, LoginBox3[playerid]);
  194. PlayerTextDrawHide(playerid, LoginBox4[playerid]);
  195. PlayerTextDrawHide(playerid, LoginBox5[playerid]);
  196. PlayerTextDrawHide(playerid, LoginBox6[playerid]);
  197. PlayerTextDrawHide(playerid, LoginName[playerid]);
  198. PlayerTextDrawHide(playerid, LoginMessage[playerid]);
  199. PlayerTextDrawHide(playerid, LoginClick[playerid]);
  200. PlayerTextDrawHide(playerid, LoginEnter[playerid]);
  201. for(new td = 0; td < 17; td++)
  202. {
  203. PlayerTextDrawHide(playerid, LoginShow[playerid][td]);
  204. }
  205. }
  206. else
  207. {
  208. new stringyy[320];
  209. gPlayerLogTries[playerid] -= 1;
  210. if(gPlayerLogTries[playerid] == 1 || gPlayerLogTries[playerid] == 0)
  211. {
  212. format(stringyy,sizeof(stringyy),"Parola incorecta. Incercari ramase: ~r~%d", gPlayerLogTries[playerid]);
  213. PlayerTextDrawSetString(playerid, LoginMessage[playerid], stringyy);
  214. PlayerTextDrawShow(playerid, LoginMessage[playerid]);
  215. }
  216. if(gPlayerLogTries[playerid] == -1)
  217. {
  218. new stringkick[256],loginname[30];
  219. GetPlayerName(playerid, loginname, sizeof(loginname));
  220. format(stringkick, sizeof(stringkick), "AdmWarn: {FFFFFF}%s has been kicked for entering the wrong password 2 times.",loginname);
  221. ABroadCast(COLOR_RED2,stringkick,1);
  222. Kick(playerid);
  223. }
  224. return 1;
  225. }
  226. cache_delete(pass);
  227. ResetPlayerCash(playerid);
  228. GivePlayerCash(playerid,PlayerInfo[playerid][pCash]);
  229. CurrentMoney[playerid] = PlayerInfo[playerid][pCash];
  230. KillTimer(login[playerid]);
  231.  
  232. new name2[MAX_PLAYER_NAME];
  233. GetPlayerName(playerid,name2,sizeof(name2));
  234.  
  235. /*if(PlayerInfo[playerid][pOneHost] == 0)
  236. {
  237. PlayerInfo[playerid][pOneHost] = 1;
  238.  
  239. new var[256];
  240. mysql_format(SQL, var, sizeof(var), "UPDATE `users` SET `Host`='%s' WHERE `name`='%s'",GetPlayerHost(playerid),name2);
  241. mysql_tquery(SQL, var,"","");
  242. }
  243. if(PlayerInfo[playerid][pHost] != GetPlayerHost(playerid)) {
  244. SCM(playerid, COLOR_RED, "TEST: asdasd!");
  245. // Kick(playerid);
  246. }*/
  247.  
  248. if(PlayerInfo[playerid][pReg] == 0)
  249. {
  250. PlayerInfo[playerid][pLevel] = 1;
  251. PlayerInfo[playerid][pHealth] = 100.0;
  252. PlayerInfo[playerid][pValoare] = 1.0;
  253. PlayerInfo[playerid][pPin] = 0;
  254. PlayerInfo[playerid][pBonus] = 0;
  255. PlayerInfo[playerid][pPos_x] = 2246.6;
  256. PlayerInfo[playerid][pPos_y] = -1161.9;
  257. PlayerInfo[playerid][pPos_z] = 1029.7;
  258. PlayerInfo[playerid][pInt] = 0;
  259. PlayerInfo[playerid][pLocal] = 255;
  260. PlayerInfo[playerid][pTeam] = 3;
  261. PlayerInfo[playerid][pModel] = 250;
  262. PlayerInfo[playerid][pPnumber] = 0;
  263. PlayerInfo[playerid][pPhousekey] = 999;
  264. PlayerInfo[playerid][pPbiskey] = 255;
  265. PlayerInfo[playerid][pAccount] = 1000;
  266. PlayerInfo[playerid][pPcarkey] = 0;
  267. PlayerInfo[playerid][pmotokey] = 0;
  268. PlayerInfo[playerid][pprcarkey2] = 0;
  269. PlayerInfo[playerid][pPPluscarkey] = 0;
  270. PlayerInfo[playerid][pPPluscarkey2] = 0;
  271. PlayerInfo[playerid][phelikey] = 0;
  272. PlayerInfo[playerid][pprcarkey] = 0;
  273. PlayerInfo[playerid][pReg] = 1;
  274. PlayerInfo[playerid][pBoatLic] = 1;
  275. PlayerInfo[playerid][pBoatLicT] = 10;
  276. PlayerInfo[playerid][pFlyLic] = 1;
  277. PlayerInfo[playerid][pFlyLicT] = 10;
  278. PlayerInfo[playerid][pCarLic] = 0;
  279. PlayerInfo[playerid][pCarLicT] = 0;
  280. SetPlayerInterior(playerid,0);
  281. PlayerInfo[playerid][pCarLicSuspend] = 0;
  282. Update(playerid, pCarLicSuspendx);
  283. PlayerInfo[playerid][pGunLic] = 1;
  284. PlayerInfo[playerid][pGunLicT] = 10;
  285. PlayerInfo[playerid][pGunLicSuspend] = 0;
  286. Update(playerid, pGunLicSuspendx);
  287. new string[300],
  288. str[256],
  289. d,
  290. m,
  291. y,
  292. h,
  293. mine,
  294. s;
  295. getdate(y,m,d);
  296. gettime(h,mine,s);
  297. format(string,sizeof(string), "%d-%02d-%02d %02d:%02d:%02d",y,m,d,h,mine,s);
  298. strmid(PlayerInfo[playerid][pRegistredDate], string, 0, strlen(string), 255);
  299. mysql_format(SQL,str,sizeof(str),"UPDATE users SET `pHealth`='100.0',`Team`='3',`Valoare`='1.0',`Model`='250', `IP`='%s' WHERE `name`='%s'",playerip,PlayerInfo[playerid][pNormalName]);
  300. mysql_tquery(SQL,str,"","");
  301. Update(playerid,pCashx);
  302. Update(playerid,pLevelx);
  303. Update(playerid,pPhousekeyx);
  304. Update(playerid,pPbiskeyx);
  305. Update(playerid,pPnumberx);
  306. Update(playerid,pRegx);
  307. Update(playerid,pRegistredDatex);
  308. Update(playerid,pPcarkeyx);
  309. Update(playerid,pmotokeyx);
  310. Update(playerid,pprcarkey2x);
  311. Update(playerid,pPPluscarkeyx);
  312. Update(playerid,pPPluscarkey2x);
  313. Update(playerid,phelikeyx);
  314. Update(playerid,pprcarkeyx);
  315. }
  316. if(PlayerInfo[playerid][pFightStyle] > 0)
  317. {
  318. if(PlayerInfo[playerid][pFightStyle] == 1)
  319. {
  320. SetPlayerFightingStyle (playerid, FIGHT_STYLE_BOXING);
  321. }
  322. else if(PlayerInfo[playerid][pFightStyle] == 2)
  323. {
  324. SetPlayerFightingStyle (playerid, FIGHT_STYLE_KUNGFU);
  325. }
  326. else if(PlayerInfo[playerid][pFightStyle] == 3)
  327. {
  328. SetPlayerFightingStyle (playerid, FIGHT_STYLE_KNEEHEAD);
  329. }
  330. else if(PlayerInfo[playerid][pFightStyle] == 4)
  331. {
  332. SetPlayerFightingStyle (playerid, FIGHT_STYLE_GRABKICK);
  333. }
  334. else if(PlayerInfo[playerid][pFightStyle] == 5)
  335. {
  336. SetPlayerFightingStyle (playerid, FIGHT_STYLE_ELBOW);
  337. }
  338. }
  339. else if(PlayerInfo[playerid][pFightStyle] == 0)
  340. {
  341. SetPlayerFightingStyle (playerid, FIGHT_STYLE_NORMAL);
  342. }
  343. StopAudioStreamForPlayer(playerid);
  344. new string2[128];
  345. if(PlayerInfo[playerid][pTut] == 1)
  346. {
  347. SendClientMessage(playerid,COLOR_WHITE,"");
  348. SendClientMessage(playerid,COLOR_WHITE,"");
  349. SendClientMessage(playerid,COLOR_WHITE,"");
  350. SendClientMessage(playerid,COLOR_WHITE,"");
  351. SendClientMessage(playerid,COLOR_WHITE,"");
  352. SendClientMessage(playerid,COLOR_WHITE,"");
  353. SendClientMessage(playerid,COLOR_WHITE,"");
  354. SendClientMessage(playerid,COLOR_WHITE,"");
  355. SendClientMessage(playerid,COLOR_WHITE,"");
  356. SendClientMessage(playerid,COLOR_WHITE,"");
  357. SendClientMessage(playerid,COLOR_WHITE,"");
  358. SendClientMessage(playerid,COLOR_WHITE,"");
  359. SendClientMessage(playerid,COLOR_WHITE,"");
  360. SendClientMessage(playerid,COLOR_WHITE,"");
  361. SendClientMessage(playerid,COLOR_WHITE,"");
  362. SendClientMessage(playerid,COLOR_WHITE,"");
  363. SendClientMessage(playerid,COLOR_WHITE,"");
  364. SendClientMessage(playerid,COLOR_WHITE,"");
  365. SendClientMessage(playerid,COLOR_WHITE,"");
  366. SendClientMessage(playerid,COLOR_WHITE,"");
  367. }
  368. SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
  369. new adminss=0, adminsafk=0, helperss=0, helpersafk=0;
  370. foreach(Player, ids2)
  371. {
  372. if(PlayerInfo[ids2][pAdmin] > 0)
  373. {
  374. adminss++;
  375. if(IsPlayerAFK[ids2] > 0)
  376. {
  377. adminsafk++;
  378. }
  379. }
  380. if(PlayerInfo[ids2][pHelper] > 0)
  381. {
  382. helperss++;
  383. if(IsPlayerAFK[ids2] > 0)
  384. {
  385. helpersafk++;
  386. }
  387. }
  388. }
  389. new playerss=0, playerssafk=0;
  390. foreach(Player, ids23)
  391. {
  392. playerss++;
  393. if(IsPlayerAFK[ids23] > 0)
  394. {
  395. playerssafk++;
  396. }
  397. }
  398. new query[256],playeriddd,strings[128],namee[30];
  399. GetPlayerName(playerid, namee, sizeof(namee));
  400. SCM(playerid, -1, " ");
  401. SCM(playerid, -1, " ");
  402. SCM(playerid, -1, " ");
  403. SCM(playerid, -1, " ");
  404. SCM(playerid, -1, " ");
  405. SCM(playerid, -1, " ");
  406. SCM(playerid, -1, " ");
  407. SCM(playerid, -1, " ");
  408. SCM(playerid, -1, " ");
  409. SCM(playerid, -1, " ");
  410. SCM(playerid, -1, " ");
  411. SCM(playerid, -1, " ");
  412. SCM(playerid, -1, " ");
  413. SCM(playerid, -1, " ");
  414. SCM(playerid, -1, " ");
  415. SCM(playerid, -1, " ");
  416. SCM(playerid, -1, " ");
  417. SCM(playerid, -1, " ");
  418. SCM(playerid, -1, " ");
  419. SCM(playerid, -1, " ");
  420. SCM(playerid, -1, " ");
  421. SCM(playerid, -1, " ");
  422. SCM(playerid, -1, " ");
  423. SCM(playerid, -1, " ");
  424. if (PlayerInfo[playerid][pPremiumAccount] == 1)
  425. {
  426. SendClientMessage(playerid, COLOR_WHITE,"{00FFFF}Login Info: {ffffff}You are a Premium Account user!");
  427. }
  428. if (PlayerInfo[playerid][pAdmin] > 0)
  429. {
  430. format(string2, sizeof(string2), "{00FFFF}Login Info: {ffffff}You are a level {00FFFF}%d{ffffff} admin",PlayerInfo[playerid][pAdmin],adminss,(adminss-adminsafk));
  431. SendClientMessage(playerid, COLOR_WHITE,string2);
  432. format(string2, sizeof(string2), "{00FFFF}Login Info: {ffffff}There are {00FFFF}%d{ffffff} admins online.",adminss);
  433. SendClientMessage(playerid, COLOR_WHITE,string2);
  434. format(string2, sizeof(string2), "{00FFFF}Login Info: {ffffff}%d admins not afk and {00FFFF}%d{ffffff} afk.",(adminss-adminsafk),adminsafk);
  435. SendClientMessage(playerid, COLOR_WHITE,string2);
  436. format(string2, sizeof(string2), "{00FFFF}Server Info: {ffffff}There are %d players online, {00FFFF}%d{ffffff} not afk and {00FFFF}%d{ffffff} afk.",playerss,(playerss-playerssafk),adminsafk);
  437. SendClientMessage(playerid, COLOR_WHITE,string2);
  438. }
  439. if (PlayerInfo[playerid][pHelper] > 0)
  440. {
  441. format(string2,sizeof(string2), "{00FFFF}Login Info: {ffffff}You are a level {00FFFF}%d{ffffff} helper", PlayerInfo[playerid][pHelper],helperss,(helperss-helpersafk));
  442. SendClientMessage(playerid, COLOR_WHITE,string2);
  443. format(string2,sizeof(string2), "{00FFFF}Login Info: {ffffff}There are {00FFFF}%d{ffffff} helpers online", helperss);
  444. SendClientMessage(playerid, COLOR_WHITE,string2);
  445. format(string2,sizeof(string2), "{00FFFF}Login Info: {ffffff}%d helpers not afk and {00FFFF}%d{ffffff} afk.",(helperss-helpersafk),helpersafk);
  446. SendClientMessage(playerid, COLOR_WHITE,string2);
  447. format(string2,sizeof(string2), "{00FFFF}Server Info: {ffffff}There are %d players online, {00FFFF}%d{ffffff} not afk and {00FFFF}%d{ffffff} afk.",playerss,(playerss-playerssafk),adminsafk);
  448. SendClientMessage(playerid, COLOR_WHITE,string2);
  449. }
  450. format(query,sizeof(query),"SELECT PlayerID FROM `friends` WHERE `FriendID`='%d'", PlayerInfo[playerid][pSQLID]);
  451. new Cache: resultt = mysql_query(SQL,query);
  452. if(cache_get_row_count() > 0)
  453. {
  454. for(new iddd, jddd = cache_get_row_count (); iddd != jddd; ++iddd)
  455. {
  456. playeriddd = cache_get_field_content_int(iddd, "PlayerID");
  457. foreach(Player, ids)
  458. {
  459. if(PlayerInfo[ids][pSQLID] == playeriddd)
  460. {
  461. format(strings,sizeof(strings),"{FFC266}** {FFFF00}Prietenul tau, %s s-a logat pe server. {FFC266}**", namee);
  462. SendClientMessage(ids, COLOR_YELLOW, strings);
  463. }
  464. }
  465. }
  466. }
  467. cache_delete(resultt);
  468. if (PlayerInfo[playerid][pWantedLevel] > 0)
  469. {
  470. SetPlayerWantedLevel(playerid, PlayerInfo[playerid][pWantedLevel]);
  471. PlayerTextDrawShow(playerid, WantedText[playerid]);
  472. new str1[256];
  473. format(str1,sizeof(str1),"WANTED SCADE IN: ~r~%d MINUTE",wantedlost[playerid]/60+1);
  474. PlayerTextDrawSetString(playerid, WantedText[playerid], str1);
  475. SendClientMessage(playerid, COLOR_RED2, "Esti inca urmarit de politie. Nivelul de wanted ti-a fost restaurat.");
  476. wantedlost[playerid] = 1800;
  477. WantedPoints[playerid] = PlayerInfo[playerid][pWantedLevel]*2;
  478. DestroyDynamic3DTextLabel(WantedScris[playerid]);
  479. Tigaanel[playerid] = 1;
  480. new str2[256];
  481. format(str2,sizeof(str2),"{FF00FF}Wanted Level: %d", PlayerInfo[playerid][pWantedLevel]);
  482. WantedScris[playerid] = CreateDynamic3DTextLabel(str2, COLOR_WHITE, 0, 0, -20, 20, playerid);
  483. Streamer_SetFloatData(STREAMER_TYPE_3D_TEXT_LABEL, WantedScris[playerid] , E_STREAMER_ATTACH_OFFSET_Z, 0.48);
  484. }
  485. SetSpawnInfo(playerid, PlayerInfo[playerid][pTeam], PlayerInfo[playerid][pModel], 533.5229,-1813.2379,6.5781, 1.0, -1, -1, -1, -1, -1, -1);
  486. if(PlayerInfo[playerid][pClan] > 0)
  487. {
  488. new szName[25];
  489. if(PlayerInfo[playerid][pClanTag] == 1)
  490. {
  491. format(szName, sizeof(szName), "%s%s", ClanInfo[PlayerInfo[playerid][pClan]][cClanTag], PlayerInfo[playerid][pNormalName]);
  492. SetPlayerName(playerid, szName);
  493. }
  494. else if(PlayerInfo[playerid][pClanTag] == 2)
  495. {
  496. format(szName, sizeof(szName), "%s%s", PlayerInfo[playerid][pNormalName], ClanInfo[PlayerInfo[playerid][pClan]][cClanTag]);
  497. SetPlayerName(playerid, szName);
  498. }
  499. }
  500. if(gTeam[playerid] == 0)
  501. {
  502. gTeam[playerid] = 3;
  503. }
  504. else
  505. {
  506. gTeam[playerid] = PlayerInfo[playerid][pTeam];
  507. }
  508. if(PlayerInfo[playerid][pMember] != 0)
  509. {
  510. new namex[25],disc[84];
  511. GetPlayerName(playerid,namex,sizeof(namex));
  512. format(disc,sizeof(disc),"(Group) {FFFFFF}%s from your group has just logged in.",namex);
  513. SendFamilyMessage(PlayerInfo[playerid][pMember], COLOR_GENANNOUNCE, disc);
  514. SCM(playerid,COLOR_GENANNOUNCE,disc);
  515. }
  516. if(PlayerInfo[playerid][pMember] != 0)
  517. {
  518. if(strlen(DynamicFactions[PlayerInfo[playerid][pMember]][fAnn]) > 0)
  519. {
  520. new factioninfo[128];
  521. format(factioninfo,sizeof(factioninfo), "(Group) MOTD: {FFFFFF}%s.",DynamicFactions[PlayerInfo[playerid][pMember]][fAnn]);
  522. SCM(playerid,COLOR_GENANNOUNCE,factioninfo);
  523. }
  524. }
  525. if(PlayerInfo[playerid][pReg] != 0)
  526. {
  527. SendClientMessage(playerid, COLOR_YELLOW, "{00FFFF}Quest Info: {ffffff}Pe server se afla un quest, pentru detalii folositi {00FFFF}/quest{ffffff}.");
  528. SendClientMessage(playerid, COLOR_YELLOW, "{FF0000}Server Info: {00FF00}La fiecare Level up ve-ti primi +10 Puncte Premium {00FFFF}/buylevel{ffffff}.");
  529. SendClientMessage(playerid, COLOR_YELLOW, "{00FFFF}Server Info: {ffffff}Foloseste comanda {00FFFF}/premiums{ffffff} pentru a vedea jucatorii cu cont ({FFFF00} PREMIUM {ffffff}).");
  530. }
  531. new sendername[30],
  532. playersip[64],
  533. iplog[256],
  534. qqerry[500],
  535. stringname[128];
  536. GetPlayerName(playerid,sendername,sizeof(sendername));
  537. GetPlayerIp(playerid,playersip,sizeof(playersip));
  538. LogIP(playersip,PlayerInfo[playerid][pSQLID]);
  539. format(iplog,sizeof(iplog),"%s (%d) has been connected to the server (IP: %s).",sendername,playerid,playersip);
  540. SendIP(COLOR_WHITE,iplog);
  541. gPlayerLogged[playerid] = 1;
  542. SpawnPlayer(playerid);
  543. mysql_format(SQL,qqerry, sizeof(qqerry), "UPDATE `users` SET `Status` = '1', `OnlineToday` = '1', `OnlineThisWeek` = '1', `LastIP` = '%s' WHERE `id` = '%d'", playersip, PlayerInfo[playerid][pSQLID]);
  544. mysql_tquery(SQL,qqerry,"","");
  545. mysql_format(SQL,qqerry, sizeof(qqerry), "UPDATE `friends` SET `Status` = '1' WHERE `FriendID` = '%d'", PlayerInfo[playerid][pSQLID]);
  546. mysql_tquery(SQL,qqerry,"","");
  547. printf("%s has been connected to the server (IP: %s).",sendername,playersip);
  548. format(stringname,sizeof(stringname),"%s / www.XtremePlay.ro",sendername);
  549. PlayerTextDrawSetString(playerid, Logo[playerid], stringname);
  550. PlayerTextDrawShow(playerid, Logo[playerid]);
  551. if(PlayerInfo[playerid][pPin] == 0) return SCM(playerid, -1, "Nu ai un {00FFFF}pin{ffffff} setat pe cont, foloseste {00FFFF}/addpin{ffffff} pentru a-ti seta unul.");
  552. if(PlayerInfo[playerid][pPin] > 0) return SCM(playerid, -1, "Foloseste {00FFFF}/pin{ffffff} pentru a-ti debloca contul si pentru a avea acces la comenzile {00FFFF}serverului{ffffff}.");
  553. if(PlayerInfo[playerid][pMP3] <= 0)
  554. {
  555. PlayerInfo[playerid][pMP3] = 1;
  556. Update(playerid, pMP3x);
  557. SCM(playerid, -1, "Ai primit cadou un {00FFFF}MP3{ffffff}, foloseste {00FFFF}/mp3{ffffff} pentru a-l folosii.");
  558. }
  559. Logare[playerid] = 0;
  560. LoginRegister[playerid] = 0;
  561. return 1;
  562. }
Add Comment
Please, Sign In to add comment