Advertisement
Guest User

Untitled

a guest
May 16th, 2016
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 102.00 KB | None | 0 0
  1. public OnQueryFinish(query[], resultid, extraid, connectionHandle) {
  2. new
  3. szQuery[2048];
  4.  
  5. switch(resultid) {
  6. case THREAD_CONFIRM_USERNAME: {
  7. mysql_store_result(g_MySQLConnections[0]);
  8.  
  9. if(mysql_fetch_int(g_MySQLConnections[0]) == 0) { // MySQL confirmed the COUNT(*) result is 0; no account with that username exists yet.
  10. mysql_free_result(g_MySQLConnections[0]);
  11. ShowMainMenuDialog(extraid, 2);
  12.  
  13. gPlayerAccount[extraid] = 0;
  14. } else {
  15. mysql_free_result(g_MySQLConnections[0]);
  16. ShowMainMenuDialog(extraid, 1);
  17. gPlayerAccount[extraid] = 1;
  18. }
  19. }
  20. case THREAD_CHECK_NAME_PASSWORD: {
  21. mysql_store_result(g_MySQLConnections[0]);
  22.  
  23. if(mysql_num_rows(g_MySQLConnections[0]) > 0) {
  24. new
  25. szPassword[64],
  26. szTarget[MAX_PLAYER_NAME],
  27. szBuffer[129];
  28.  
  29. GetPVarString(extraid, "opasschange", szPassword, sizeof(szPassword));
  30. GetPVarString(extraid, "opasschangetarget", szTarget, sizeof(szTarget));
  31.  
  32. WP_Hash(szBuffer, sizeof(szBuffer), szPassword);
  33.  
  34. format(szQuery, sizeof(szQuery), "UPDATE players SET Password = '%s' WHERE Username = '%s'", szBuffer, szTarget);
  35. mysql_query(szQuery, THREAD_FULLY_CHANGE_PASSWORD, extraid, g_MySQLConnections[0]);
  36. } else {
  37. DeletePVar(extraid, "opasschange");
  38. DeletePVar(extraid, "opasschangetarget");
  39. SendClientMessage(extraid, COLOR_GREY, "The player account name specified doesn't exist or currently has admin.");
  40. }
  41.  
  42. mysql_free_result(g_MySQLConnections[0]);
  43. }
  44. case THREAD_LIST_NAMECHANGES: {
  45. mysql_store_result(g_MySQLConnections[0]);
  46.  
  47. if(mysql_num_rows(g_MySQLConnections[0]) > 0) {
  48. // Use 'szQuery' because of the large size of the string at our disposal
  49. format(szQuery, sizeof(szQuery), "");
  50.  
  51. new
  52. szPlayerName[MAX_PLAYER_NAME],
  53. szPlayerOldName[MAX_PLAYER_NAME],
  54. szPlayerAdminName[MAX_PLAYER_NAME],
  55. szMessage[1000],
  56. iUnixTS;
  57.  
  58. format(szMessage, sizeof(szMessage), "Listing the last 10 namechanges for %s:\n", GetPlayerNameEx(GetPVarInt(extraid, "namechanges_target")));
  59.  
  60. while(mysql_fetch_row_format(szQuery, "|", g_MySQLConnections[0])) {
  61. sscanf(szQuery, "p<|>s[MAX_PLAYER_NAME]ds[MAX_PLAYER_NAME]s[MAX_PLAYER_NAME]", szPlayerOldName, iUnixTS, szPlayerName, szPlayerAdminName);
  62.  
  63. format(szMessage, sizeof(szMessage), "%s\n%s is now known as %s (as of %s) and his namechange was approved of by %s", szMessage, szPlayerOldName, szPlayerName, timec(iUnixTS), szPlayerAdminName);
  64. }
  65.  
  66. DeletePVar(extraid, "namechanges_target");
  67.  
  68. ShowPlayerDialogEx(extraid, DIALOG_SHOW_NAMECHANGES, DIALOG_STYLE_MSGBOX, "List of namechanges", szMessage, "OK", "");
  69. } else {
  70. SendClientMessage(extraid, COLOR_GREY, "There are no namechanges registered for this player.");
  71. DeletePVar(extraid, "namechanges_target");
  72. }
  73.  
  74. mysql_free_result(g_MySQLConnections[0]);
  75. }
  76. case THREAD_FULLY_CHANGE_PASSWORD: {
  77. new
  78. szMessage[128],
  79. szTarget[MAX_PLAYER_NAME];
  80.  
  81. GetPVarString(extraid, "opasschangetarget", szTarget, sizeof(szTarget));
  82.  
  83. format(szMessage, sizeof(szMessage), "You have changed %s's password.", szTarget);
  84. SendClientMessage(extraid, COLOR_YELLOW, szMessage);
  85.  
  86. format(szMessage, sizeof(szMessage), "AdmCmd: %s's password was changed by %s", szTarget, GetPlayerNameEx(extraid));
  87. Log("logs/password.log", szMessage);
  88. ABroadCast(COLOR_LIGHTRED, szMessage, 1);
  89.  
  90. DeletePVar(extraid, "opasschange");
  91. DeletePVar(extraid, "opasschangetarget");
  92. }
  93. case THREAD_CHECK_NEW_NAME: {
  94. mysql_store_result(g_MySQLConnections[0]);
  95.  
  96. if(mysql_num_rows(g_MySQLConnections[0]) > 0) {
  97. SendClientMessage(GetPVarInt(extraid, "requestby"), COLOR_GREY, "The requested name is already taken.");
  98. if(GetPVarInt(extraid, "requestpath") == 1) {
  99. SendClientMessage(extraid, COLOR_GREY, "The name you requested has already been taken, please select another.");
  100. ShowPlayerDialogEx(extraid, DIALOG_NAMECHANGE2, DIALOG_STYLE_INPUT, "Free name change","This is a roleplay server where you must have a name in this format: Firstname_Lastname.\nFor example: John_Smith or Jimmy_Johnson\n\nAn admin has offered you to change your name to the correct format for free. Please enter your desired name below.\n\nNote: If you press cancel you will be kicked from the server.", "Change", "Cancel");
  101. } else if(GetPVarInt(extraid, "requestpath") == 2) {
  102. SendClientMessage(extraid, COLOR_GREY, "The name you requested has already been taken. Try again?");
  103.  
  104. DeletePVar(extraid, "requestpath");
  105. DeletePVar(extraid, "NewNameRequest");
  106. DeletePVar(extraid, "NameChangeCost");
  107. DeletePVar(extraid, "requestby");
  108. DeletePVar(extraid, "requestedname");
  109. DeletePVar(extraid, "RequestingNameChange");
  110. } else if(GetPVarInt(extraid, "requestpath") == 3) {
  111. SendClientMessage(GetPVarInt(extraid, "requestby"), COLOR_GREY, "That name is already taken.");
  112. DeletePVar(extraid, "requestedname");
  113. DeletePVar(extraid, "requestpath");
  114. DeletePVar(extraid, "requestby");
  115. }
  116. } else {
  117. new
  118. szPlayerName[MAX_PLAYER_NAME];
  119.  
  120. GetPVarString(extraid, "requestedname", szPlayerName, MAX_PLAYER_NAME);
  121.  
  122. format(szQuery, sizeof(szQuery), "UPDATE players SET Username = '%s' WHERE ID = %d", szPlayerName, PlayerInfo[extraid][pID]);
  123. mysql_query(szQuery, THREAD_CONFIRMED_NAMECHANGE, extraid, g_MySQLConnections[0]);
  124. }
  125.  
  126. mysql_free_result(g_MySQLConnections[0]);
  127. }
  128. case THREAD_CONFIRMED_NAMECHANGE: {
  129. new
  130. szPlayerName[MAX_PLAYER_NAME],
  131. szOriginalPlayerName[MAX_PLAYER_NAME],
  132. string[128];
  133.  
  134. GetPVarString(extraid, "requestedname", szPlayerName, MAX_PLAYER_NAME);
  135. GetPlayerName(extraid, "szOriginalPlayerName", MAX_PLAYER_NAME);
  136.  
  137. if(GetPVarInt(extraid, "requestpath") == 1) {
  138. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has approved %s's request to become %s", GetPlayerNameEx(GetPVarInt(extraid, "requestby")), GetPlayerNameEx(extraid), szPlayerName);
  139. ABroadCast(COLOR_YELLOW, string, 2);
  140. format(PlayerInfo[extraid][pFlag], 128, "");
  141. } else if(GetPVarInt(extraid, "requestpath") == 2) {
  142. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has approved %s's request to become %s", GetPlayerNameEx(GetPVarInt(extraid, "requestby")), GetPlayerNameEx(extraid), szPlayerName);
  143. ABroadCast(COLOR_YELLOW, string, 2);
  144. } else {
  145. format(string, sizeof(string), "%s has set %s's name to %s.",GetPlayerNameEx(GetPVarInt(extraid, "requestby")), GetPlayerNameEx(extraid), szPlayerName);
  146. ABroadCast(COLOR_YELLOW, string, 1);
  147. }
  148.  
  149. if(PlayerInfo[extraid][pHouse] != INVALID_HOUSE_ID && strcmp(szOriginalPlayerName, HouseInfo[PlayerInfo[extraid][pHouse]][hOwner], true) == 0) {
  150. strmid(HouseInfo[PlayerInfo[extraid][pHouse]][hOwner], szPlayerName, 0, strlen(szPlayerName), 255);
  151. format(string, sizeof(string), "House owner: %s\nLevel: %d\nID: %d",HouseInfo[PlayerInfo[extraid][pHouse]][hOwner],HouseInfo[PlayerInfo[extraid][pHouse]][hLevel],PlayerInfo[extraid][pHouse]);
  152. UpdateDynamic3DTextLabelText(HouseInfo[PlayerInfo[extraid][pHouse]][hTextID], COLOR_HOUSEGREEN, string);
  153. }
  154.  
  155. if(PlayerInfo[extraid][pHouse2] != INVALID_HOUSE_ID && strcmp(szOriginalPlayerName, HouseInfo[PlayerInfo[extraid][pHouse2]][hOwner], true) == 0) {
  156. strmid(HouseInfo[PlayerInfo[extraid][pHouse2]][hOwner], szPlayerName, 0, strlen(szPlayerName), 255);
  157. format(string, sizeof(string), "House owner: %s\nLevel: %d\nID: %d",HouseInfo[PlayerInfo[extraid][pHouse]][hOwner],HouseInfo[PlayerInfo[extraid][pHouse]][hLevel],PlayerInfo[extraid][pHouse]);
  158. UpdateDynamic3DTextLabelText(HouseInfo[PlayerInfo[extraid][pHouse2]][hTextID], COLOR_HOUSEGREEN, string);
  159. }
  160.  
  161. if(PlayerInfo[extraid][pDonator] >= 1) {
  162. format(string, sizeof(string), "[DONATOR NAMECHANGES] %s has changed their name to %s.", GetPlayerNameEx(extraid), szPlayerName);
  163. Log("logs/donatornames.log", string);
  164. }
  165.  
  166. format(string, sizeof(string), " Your name has been changed from %s to %s.", GetPlayerNameEx(extraid), szPlayerName);
  167. SendClientMessage(extraid, COLOR_YELLOW, string);
  168.  
  169. format(string, sizeof(string), "%s changed \"%s\"s name to \"%s\"",GetPlayerNameEx(GetPVarInt(extraid, "requestby")), GetPlayerNameEx(extraid), szPlayerName);
  170. Log("logs/stats.log", string);
  171.  
  172. if(AdminDuty[extraid] == 0) {
  173. format(szQuery, sizeof(szQuery), "INSERT INTO namechanges (dbid, oldname, newname, approvedbyid, approvedbyname, unixts) VALUES(%d, '%s', '%s', %d, '%s', %d)", PlayerInfo[extraid][pID], GetPlayerNameEx(extraid), szPlayerName, PlayerInfo[GetPVarInt(extraid, "requestby")][pID], GetPlayerNameEx(GetPVarInt(extraid, "requestby")), gettime());
  174. mysql_query(szQuery, THREAD_NO_RESULT, 0, g_MySQLConnections[0]);
  175. }
  176.  
  177. SetPlayerName(extraid, szPlayerName);
  178.  
  179. if(GetPVarInt(extraid, "NameChangeCost") > 0)
  180. PlayerInfo[extraid][pCash] -= GetPVarInt(extraid, "NameChangeCost");
  181.  
  182. PlayerInfo[extraid][pInt] = GetPlayerInterior(extraid);
  183.  
  184. if(GetPVarType(extraid, "tabbedVW") != 0) {
  185. PlayerInfo[extraid][pVW] = GetPVarInt(extraid, "tabbedVW");
  186. } else PlayerInfo[extraid][pVW] = GetPlayerVirtualWorld(extraid);
  187.  
  188. GetPlayerIp(extraid, PlayerInfo[extraid][pIP], 32);
  189. GetPlayerPos(extraid, PlayerInfo[extraid][pPos_x], PlayerInfo[extraid][pPos_y], PlayerInfo[extraid][pPos_z]);
  190. GetPlayerFacingAngle(extraid, PlayerInfo[extraid][pPos_r]);
  191. SaveAccount(extraid);
  192.  
  193. DeletePVar(extraid, "requestby");
  194. DeletePVar(extraid, "requestedname");
  195. DeletePVar(extraid, "requestpath");
  196. DeletePVar(extraid, "NewNameRequest");
  197. DeletePVar(extraid, "NameChangeCost");
  198. DeletePVar(extraid, "RequestingNameChange");
  199. }
  200. case THREAD_GIVE_REF_TOKENS: {
  201. mysql_store_result(g_MySQLConnections[0]);
  202.  
  203. if(mysql_num_rows(g_MySQLConnections[0]) == 0)
  204. return SendClientMessage(extraid, COLOR_YELLOW, "The player who referred you here no longer has an account and has not been given their referral token.");
  205.  
  206. new
  207. iTokens = mysql_fetch_int(g_MySQLConnections[0]) + 1;
  208.  
  209. format(szQuery, sizeof(szQuery), "UPDATE players SET RefTokensOffline = %d WHERE Username = '%s'", iTokens, PlayerInfo[extraid][pReferredBy]);
  210. mysql_query(szQuery, THREAD_LITERALLY_GIVE_REFTOKEN, extraid, g_MySQLConnections[0]);
  211.  
  212. mysql_free_result(g_MySQLConnections[0]);
  213. }
  214. case THREAD_OFFLINE_FLAG: {
  215. mysql_store_result(g_MySQLConnections[0]);
  216.  
  217. if(mysql_num_rows(g_MySQLConnections[0]) == 0)
  218. return SendClientMessage(extraid, COLOR_GREY, "That account doesn't exist!");
  219.  
  220. new
  221. szFlag[128],
  222. szFormattedFlag[128],
  223. szPlayerName[MAX_PLAYER_NAME];
  224.  
  225. GetPVarString(extraid, "offline_flag", szFlag, sizeof(szFlag));
  226. GetPVarString(extraid, "offline_flag_target", szPlayerName, sizeof(szPlayerName));
  227.  
  228. new month,day,year;
  229. getdate(year,month,day);
  230. format(szFormattedFlag, sizeof(szFormattedFlag), "%s - %s (%d/%d/%d)", szFlag, GetPlayerNameEx(extraid), day, month, year);
  231.  
  232. format(szQuery, sizeof(szQuery), "UPDATE players SET Flag = '%s' WHERE Username = '%s'", szFormattedFlag, szPlayerName);
  233. mysql_query(szQuery, THREAD_NO_RESULT, 0, g_MySQLConnections[0]);
  234.  
  235. // Avoid defining a new string, use one that's already clear to go.
  236. format(szFormattedFlag, sizeof(szFormattedFlag), "AdmCmd: %s has flagged %s, reason: %s.", GetPlayerNameEx(extraid), szPlayerName, szFlag);
  237. ABroadCast(COLOR_LIGHTRED, szFormattedFlag, 1);
  238.  
  239. DeletePVar(extraid, "offline_flag");
  240. DeletePVar(extraid, "offline_flag_target");
  241.  
  242. mysql_free_result(g_MySQLConnections[0]);
  243. }
  244. case THREAD_OFFLINE_UNINVITE: {
  245. mysql_store_result(g_MySQLConnections[0]);
  246.  
  247. if(mysql_num_rows(g_MySQLConnections[0]) == 0)
  248. return SendClientMessage(extraid, COLOR_YELLOW, "That account doesn't exist!");
  249.  
  250. if(mysql_retrieve_row()) {
  251. new
  252. szReturn[6];
  253.  
  254. mysql_fetch_field_row(szReturn, "AdminLevel", g_MySQLConnections[0]);
  255.  
  256. if(strval(szReturn) >= 5)
  257. return SendClientMessage(extraid, COLOR_YELLOW, "This player can't be uninvited by you. ");
  258.  
  259. mysql_fetch_field_row(szReturn, "Faction", g_MySQLConnections[0]);
  260.  
  261. if(strval(szReturn) != PlayerInfo[extraid][pFaction])
  262. return SendClientMessage(extraid, COLOR_YELLOW, "This player isn't in the same faction as you.");
  263.  
  264. new
  265. szPlayerName[MAX_PLAYER_NAME];
  266.  
  267. GetPVarString(extraid, "uninvite_target", szPlayerName, MAX_PLAYER_NAME);
  268. format(szQuery, sizeof(szQuery), "UPDATE players SET Faction = 0, Rank = 0, OnDuty = 0, Leader = 0, Skin = 299 WHERE Username = '%s'", szPlayerName);
  269. mysql_query(szQuery, THREAD_FULLY_UNINVITE, extraid, g_MySQLConnections[0]);
  270.  
  271. mysql_free_result(g_MySQLConnections[0]);
  272. }
  273.  
  274. }
  275. case THREAD_FULLY_UNINVITE: {
  276. new
  277. szPlayerName[MAX_PLAYER_NAME],
  278. szMessage[128];
  279.  
  280. GetPVarString(extraid, "uninvite_target", szPlayerName, MAX_PLAYER_NAME);
  281.  
  282. format(szMessage, sizeof(szMessage), "You have kicked %s from the faction.", szPlayerName);
  283. SendClientMessage(extraid, COLOR_LIGHTBLUE, szMessage);
  284.  
  285. format(szMessage, sizeof(szMessage), "%s has uninvited %s from the %s.", GetPlayerNameEx(extraid), szPlayerName, GetFactionName(PlayerInfo[extraid][pFaction]));
  286. Log("logs/faction.log", szMessage);
  287.  
  288. DeletePVar(extraid, "uninvite_target");
  289. }
  290. case THREAD_LITERALLY_GIVE_REFTOKEN: {
  291. new
  292. string[123];
  293.  
  294. format(string, sizeof(string), "Since you have reached 8 playing hours and were referred by %s, they have gained 1 referral token.", PlayerInfo[extraid][pReferredBy]);
  295. SendClientMessage(extraid, COLOR_YELLOW, string);
  296. }
  297. case THREAD_REFERRAL_MENU: {
  298. mysql_store_result(g_MySQLConnections[0]);
  299.  
  300. if(mysql_num_rows(g_MySQLConnections[0]) == 0) {
  301. format(PlayerInfo[extraid][pReferredBy], MAX_PLAYER_NAME, "");
  302. ShowPlayerDialogEx(extraid, REGISTRATION_MENU_FOUR, DIALOG_STYLE_INPUT, "{FFA500}Stratum Roleplay - Registration", "{FFFFFF}ENTRY DECLINED: There is no player registered by that name.\n\nWhat is the name of the player that referred you?\n\nNote: It must be the full player name with underscore ('_'). For example: John_Smith", "Done", "Cancel");
  303. } else {
  304. mysql_free_result(g_MySQLConnections[0]);
  305.  
  306. new
  307. string[128];
  308.  
  309. format(string, sizeof(string), "{FFFFFF}Are you sure you were referred by %s?", PlayerInfo[extraid][pReferredBy]);
  310. ShowPlayerDialogEx(extraid, REGISTRATION_MENU_FIVE, DIALOG_STYLE_MSGBOX, "{FFA500}Stratum Roleplay - Registration", string, "Yes", "No");
  311. }
  312. }
  313. case THREAD_MDC_CHECK: {
  314. if(mysql_num_rows(g_MySQLConnections[0]) == 0) { // No rows exist with the specified criteria, so, wrong password!
  315. mysql_free_result(g_MySQLConnections[0]);
  316. ShowPlayerDialogEx(extraid, MDC_END_ID, DIALOG_STYLE_MSGBOX, "SA-MDC - Logged in | ERROR ", "There is no record of that person.", "OK", "Cancel");
  317. } else {
  318. mysql_store_result(g_MySQLConnections[0]);
  319. new
  320. crimeDescription[128],
  321. crimeIssuerName[MAX_PLAYER_NAME],
  322. crimeIssuedToName[MAX_PLAYER_NAME],
  323. szFullMessage[1028],
  324. iSlot = 0;
  325.  
  326. while(mysql_retrieve_row()) {
  327. iSlot++;
  328. switch(iSlot) {
  329. case 1: {
  330. mysql_fetch_field_row(crimeDescription, "crimeDescription", g_MySQLConnections[0]);
  331. mysql_fetch_field_row(crimeIssuerName, "crimeIssuerName", g_MySQLConnections[0]);
  332. mysql_fetch_field_row(crimeIssuedToName, "crimeIssuedToName", g_MySQLConnections[0]);
  333. if(!isnull(crimeDescription)) {
  334. format(szFullMessage, sizeof(szFullMessage), "Name: %s", crimeIssuedToName);
  335. format(szFullMessage, sizeof(szFullMessage), "%s\n %s - %s", szFullMessage, crimeDescription, crimeIssuerName);
  336. }
  337. }
  338. case 2, 3, 4, 5, 6: {
  339. mysql_fetch_field_row(crimeDescription, "crimeDescription", g_MySQLConnections[0]);
  340. mysql_fetch_field_row(crimeIssuerName, "crimeIssuerName", g_MySQLConnections[0]);
  341. if(!isnull(szFullMessage) && !isnull(crimeDescription)) {
  342. format(szFullMessage, sizeof(szFullMessage), "%s\n %s - %s", szFullMessage, crimeDescription, crimeIssuerName);
  343. }
  344. }
  345. }
  346. }
  347. for(new i=0; i < MAX_PLAYERVEHICLES; i++) {
  348. if(PlayerVehicleInfo[GetPVarInt(extraid, "MDCCHECK")][i][pvTicket] != 0)
  349. {
  350. format(szFullMessage, sizeof(szFullMessage), "%s\n Vehicle registration: %d | Vehicle Name: %s | Ticket: $%d.\n",szFullMessage, PlayerVehicleInfo[GetPVarInt(extraid, "MDCCHECK")][i][pvId],GetVehicleName(PlayerVehicleInfo[GetPVarInt(extraid, "MDCCHECK")][i][pvId]),PlayerVehicleInfo[GetPVarInt(extraid, "MDCCHECK")][i][pvTicket]);
  351. }
  352. }
  353. ShowPlayerDialogEx(extraid, MDC_END_ID, DIALOG_STYLE_LIST, "SA-MDC - Logged in | Criminal History", szFullMessage, "OK", "Cancel");
  354. DeletePVar(extraid, "MDCCHECK");
  355. mysql_free_result(g_MySQLConnections[0]);
  356. }
  357. }
  358. case THREAD_OFFLINE_KILLS: {
  359. mysql_store_result(g_MySQLConnections[0]);
  360. if(IsPlayerConnected(extraid)) {
  361. if(mysql_num_rows(g_MySQLConnections[0]) == 0) { // No rows exist with the specified criteria, so, wrong password!
  362. mysql_free_result(g_MySQLConnections[0]);
  363. SendClientMessage(extraid, COLOR_GREY, "The specified player account doesn't exist.");
  364. } else {
  365. mysql_retrieve_row();
  366.  
  367. new
  368. szPlayerName[MAX_PLAYER_NAME],
  369. szReturn[128],
  370. iPlayerID;
  371.  
  372. mysql_fetch_field_row(szPlayerName, "Username", g_MySQLConnections[0]);
  373. mysql_fetch_field_row(szReturn, "ID", g_MySQLConnections[0]);
  374. iPlayerID = strval(szReturn);
  375. mysql_free_result(g_MySQLConnections[0]);
  376.  
  377. SendClientMessage(extraid, COLOR_GREEN, "________________________________________________");
  378. format(szReturn, sizeof(szReturn), "<< Last 10 Kills of %s >>", szPlayerName);
  379. SendClientMessage(extraid, COLOR_YELLOW, szReturn);
  380.  
  381. format(szQuery, sizeof(szQuery), "SELECT kills.* FROM kills INNER JOIN players ON kills.killerID = players.ID OR kills.killedID = players.ID WHERE players.ID = '%d' ORDER BY kills.killTS ASC LIMIT 10", iPlayerID);
  382. mysql_query(szQuery, THREAD_OFFLINE_KILLS_2, extraid, g_MySQLConnections[0]);
  383. }
  384. }
  385. }
  386. case THREAD_OFFLINE_KILLS_2: {
  387. mysql_store_result(g_MySQLConnections[0]);
  388. new
  389. KillLog[128],
  390. iSlot = 0;
  391.  
  392. while(mysql_retrieve_row()) {
  393. iSlot++;
  394. switch(iSlot) {
  395. case 9: {
  396. mysql_fetch_field_row(KillLog, "killText", g_MySQLConnections[0]);
  397. if(!isnull(KillLog)) SendClientMessage(extraid, COLOR_YELLOW, KillLog);
  398. }
  399. case 8: {
  400. mysql_fetch_field_row(KillLog, "killText", g_MySQLConnections[0]);
  401. if(!isnull(KillLog)) SendClientMessage(extraid, COLOR_YELLOW, KillLog);
  402. }
  403. case 7: {
  404. mysql_fetch_field_row(KillLog, "killText", g_MySQLConnections[0]);
  405. if(!isnull(KillLog)) SendClientMessage(extraid, COLOR_YELLOW, KillLog);
  406. }
  407. case 6: {
  408. mysql_fetch_field_row(KillLog, "killText", g_MySQLConnections[0]);
  409. if(!isnull(KillLog)) SendClientMessage(extraid, COLOR_YELLOW, KillLog);
  410. }
  411. case 5: {
  412. mysql_fetch_field_row(KillLog, "killText", g_MySQLConnections[0]);
  413. if(!isnull(KillLog)) SendClientMessage(extraid, COLOR_YELLOW, KillLog);
  414. }
  415. case 4: {
  416. mysql_fetch_field_row(KillLog, "killText", g_MySQLConnections[0]);
  417. if(!isnull(KillLog)) SendClientMessage(extraid, COLOR_YELLOW, KillLog);
  418. }
  419. case 3: {
  420. mysql_fetch_field_row(KillLog, "killText", g_MySQLConnections[0]);
  421. if(!isnull(KillLog)) SendClientMessage(extraid, COLOR_YELLOW, KillLog);
  422. }
  423. case 2: {
  424. mysql_fetch_field_row(KillLog, "killText", g_MySQLConnections[0]);
  425. if(!isnull(KillLog)) SendClientMessage(extraid, COLOR_YELLOW, KillLog);
  426. }
  427. case 1: {
  428. mysql_fetch_field_row(KillLog, "killText", g_MySQLConnections[0]);
  429. if(!isnull(KillLog)) SendClientMessage(extraid, COLOR_YELLOW, KillLog);
  430. }
  431. case 0: {
  432. mysql_fetch_field_row(KillLog, "killText", g_MySQLConnections[0]);
  433. if(!isnull(KillLog)) SendClientMessage(extraid, COLOR_YELLOW, KillLog);
  434. }
  435. }
  436. }
  437. mysql_free_result(g_MySQLConnections[0]);
  438. }
  439. case THREAD_GET_STATS: {
  440. mysql_store_result(g_MySQLConnections[0]);
  441. if(IsPlayerConnected(extraid)) {
  442. new
  443. szReturn[128];
  444.  
  445. if(mysql_num_rows(g_MySQLConnections[0]) == 0) { // No rows exist with the specified criteria, so, wrong password!
  446. mysql_free_result(g_MySQLConnections[0]);
  447. SendClientMessage(extraid, COLOR_GREY, "The specified player account doesn't exist.");
  448. } else {
  449. mysql_retrieve_row();
  450.  
  451. new facgang[20], employer[64], rank[64], division[64], jtext[20], jtext2[20];
  452.  
  453. mysql_fetch_field_row(szReturn, "Level", g_MySQLConnections[0]);
  454. new level = strval(szReturn);
  455.  
  456. mysql_fetch_field_row(szReturn, "ConnectTime", g_MySQLConnections[0]);
  457. new phours = strval(szReturn);
  458.  
  459. mysql_fetch_field_row(szReturn, "Respect", g_MySQLConnections[0]);
  460. new respect = strval(szReturn);
  461.  
  462. new nxtlevel = level + 1;
  463. new expamount = nxtlevel*levelexp;
  464. new costlevel = nxtlevel*2500;
  465.  
  466. mysql_fetch_field_row(szReturn, "PhoneNumber", g_MySQLConnections[0]);
  467. new pnumber = strval(szReturn);
  468.  
  469. mysql_fetch_field_row(szReturn, "Warnings", g_MySQLConnections[0]);
  470. new warns = strval(szReturn);
  471.  
  472. facgang = "Faction";
  473. employer = "None";
  474. rank = "None";
  475.  
  476. mysql_fetch_field_row(szReturn, "Gang", g_MySQLConnections[0]);
  477. new iGang = strval(szReturn);
  478.  
  479. mysql_fetch_field_row(szReturn, "Rank", g_MySQLConnections[0]);
  480. new iRank = strval(szReturn);
  481.  
  482. mysql_fetch_field_row(szReturn, "Division", g_MySQLConnections[0]);
  483. new iDivision = strval(szReturn);
  484.  
  485. mysql_fetch_field_row(szReturn, "Faction", g_MySQLConnections[0]);
  486. new iFaction = strval(szReturn);
  487.  
  488. if(iGang < 255) {
  489. facgang = "Family";
  490. division = "None";
  491.  
  492. format(employer, sizeof(employer), "%s", FamilyInfo[iGang][FamilyName]);
  493. switch(iRank) {
  494. case 1: format(rank, sizeof(rank), "%s", FamilyInfo[iGang][FamilyRank1]);
  495. case 2: format(rank, sizeof(rank), "%s", FamilyInfo[iGang][FamilyRank2]);
  496. case 3: format(rank, sizeof(rank), "%s", FamilyInfo[iGang][FamilyRank3]);
  497. case 4: format(rank, sizeof(rank), "%s", FamilyInfo[iGang][FamilyRank4]);
  498. case 5: format(rank, sizeof(rank), "%s", FamilyInfo[iGang][FamilyRank5]);
  499. case 6: format(rank, sizeof(rank), "%s", FamilyInfo[iGang][FamilyRank6]);
  500. default: format(rank, sizeof(rank), "%s", FamilyInfo[iGang][FamilyRank1]);
  501. }
  502. }
  503. else {
  504. PlayerInfo[MAX_PLAYERS][pDivision] = iDivision;
  505. PlayerInfo[MAX_PLAYERS][pRank] = iRank;
  506. PlayerInfo[MAX_PLAYERS][pFaction] = iFaction;
  507.  
  508. GetPlayerFactionInfo(MAX_PLAYERS, rank, division, employer);
  509. }
  510.  
  511. mysql_fetch_field_row(szReturn, "Job", g_MySQLConnections[0]);
  512. new iJob = strval(szReturn);
  513.  
  514. mysql_fetch_field_row(szReturn, "Job2", g_MySQLConnections[0]);
  515. new iJob2 = strval(szReturn);
  516.  
  517. switch(iJob)
  518. {
  519. case 1: jtext = "Detective";
  520. case 2: jtext = "Lawyer";
  521. case 3: jtext = "Whore";
  522. case 4: jtext = "Drugs Dealer";
  523. case 5: jtext = "Car Jacker";
  524. //case 6: jtext = "News Reporter";
  525. case 7: jtext = "Car Mechanic";
  526. case 8: jtext = "Bodyguard";
  527. case 9: jtext = "Arms Dealer";
  528. //case 10: jtext = "Car Dealer";
  529. case 12: jtext = "Boxer";
  530. case 14: jtext = "Drug Smuggler";
  531. //case 15: jtext = "Paper Boy";
  532. //case 16: jtext = "Trucker";
  533. case 17: jtext = "Taxi Driver";
  534. case 18: jtext = "Craftsman";
  535. case 19: jtext = "Bartender";
  536. case 20: jtext = "Trucker";
  537. case 21: jtext = "Pizza Boy";
  538. default: jtext = "None";
  539. }
  540. switch(iJob2)
  541. {
  542. case 1: jtext2 = "Detective";
  543. case 2: jtext2 = "Lawyer";
  544. case 3: jtext2 = "Whore";
  545. case 4: jtext2 = "Drugs Dealer";
  546. case 5: jtext2 = "Car Jacker";
  547. //case 6: jtext2 = "News Reporter";
  548. case 7: jtext2 = "Car Mechanic";
  549. case 8: jtext2 = "Bodyguard";
  550. case 9: jtext2 = "Arms Dealer";
  551. //case 10: jtext2 = "Car Dealer";
  552. case 12: jtext2 = "Boxer";
  553. case 14: jtext2 = "Drug Smuggler";
  554. //case 15: jtext2 = "Paper Boy";
  555. //case 16: jtext2 = "Trucker";
  556. case 17: jtext2 = "Taxi Driver";
  557. case 18: jtext2 = "Craftsman";
  558. case 19: jtext2 = "Bartender";
  559. case 20: jtext2 = "Trucker";
  560. case 21: jtext2 = "Pizza Boy";
  561. default: jtext2 = "None";
  562. }
  563.  
  564. new jlevel;
  565. switch(iJob)
  566. {
  567. case 1:
  568. {
  569. mysql_fetch_field_row(szReturn, "DetSkill", g_MySQLConnections[0]);
  570. new skilllevel = strval(szReturn);
  571. if(skilllevel >= 0 && skilllevel <= 50) { jlevel = 1; }
  572. else if(skilllevel >= 51 && skilllevel <= 100) { jlevel = 2; }
  573. else if(skilllevel >= 101 && skilllevel <= 200) { jlevel = 3; }
  574. else if(skilllevel >= 201 && skilllevel <= 400) { jlevel = 4; }
  575. else if(skilllevel >= 401) { jlevel = 5; }
  576. }
  577. case 2:
  578. {
  579. mysql_fetch_field_row(szReturn, "LawSkill", g_MySQLConnections[0]);
  580. new skilllevel = strval(szReturn);
  581. if(skilllevel >= 0 && skilllevel <= 50) { jlevel = 1; }
  582. else if(skilllevel >= 51 && skilllevel <= 100) { jlevel = 2; }
  583. else if(skilllevel >= 101 && skilllevel <= 200) { jlevel = 3; }
  584. else if(skilllevel >= 201 && skilllevel <= 400) { jlevel = 4; }
  585. else if(skilllevel >= 401) { jlevel = 5; }
  586. }
  587. case 3:
  588. {
  589. mysql_fetch_field_row(szReturn, "SexSkill", g_MySQLConnections[0]);
  590. new skilllevel = strval(szReturn);
  591. if(skilllevel >= 0 && skilllevel <= 50) { jlevel = 1; }
  592. else if(skilllevel >= 51 && skilllevel <= 100) { jlevel = 2; }
  593. else if(skilllevel >= 101 && skilllevel <= 200) { jlevel = 3; }
  594. else if(skilllevel >= 201 && skilllevel <= 400) { jlevel = 4; }
  595. else if(skilllevel >= 401) { jlevel = 5; }
  596. }
  597. case 4:
  598. {
  599. mysql_fetch_field_row(szReturn, "DrugsSkill", g_MySQLConnections[0]);
  600. new skilllevel = strval(szReturn);
  601. if(skilllevel >= 0 && skilllevel <= 50) { jlevel = 1; }
  602. else if(skilllevel >= 51 && skilllevel <= 100) { jlevel = 2; }
  603. else if(skilllevel >= 101 && skilllevel <= 200) { jlevel = 3; }
  604. else if(skilllevel >= 201 && skilllevel <= 400) { jlevel = 4; }
  605. else if(skilllevel >= 401) { jlevel = 5; }
  606. }
  607. case 5:
  608. {
  609. mysql_fetch_field_row(szReturn, "CarSkill", g_MySQLConnections[0]);
  610. new skilllevel = strval(szReturn);
  611. if(skilllevel >= 0 && skilllevel <= 50) { jlevel = 1; }
  612. else if(skilllevel >= 51 && skilllevel <= 100) { jlevel = 2; }
  613. else if(skilllevel >= 101 && skilllevel <= 200) { jlevel = 3; }
  614. else if(skilllevel >= 201 && skilllevel <= 400) { jlevel = 4; }
  615. else if(skilllevel >= 401) { jlevel = 5; }
  616. }
  617. case 7:
  618. {
  619. mysql_fetch_field_row(szReturn, "MechSkill", g_MySQLConnections[0]);
  620. new skilllevel = strval(szReturn);
  621. if(skilllevel >= 0 && skilllevel <= 50) { jlevel = 1; }
  622. else if(skilllevel >= 51 && skilllevel <= 100) { jlevel = 2; }
  623. else if(skilllevel >= 101 && skilllevel <= 200) { jlevel = 3; }
  624. else if(skilllevel >= 201 && skilllevel <= 400) { jlevel = 4; }
  625. else if(skilllevel >= 401) { jlevel = 5; }
  626. }
  627. case 9:
  628. {
  629. mysql_fetch_field_row(szReturn, "ArmsSkill", g_MySQLConnections[0]);
  630. new skilllevel = strval(szReturn);
  631. if(skilllevel >= 0 && skilllevel < 50) { jlevel = 1; }
  632. else if(skilllevel >= 50 && skilllevel < 100) { jlevel = 2; }
  633. else if(skilllevel >= 100 && skilllevel < 200) { jlevel = 3; }
  634. else if(skilllevel >= 200 && skilllevel < 400) { jlevel = 4; }
  635. else if(skilllevel >= 400) { jlevel = 5; }
  636. }
  637. case 12:
  638. {
  639. mysql_fetch_field_row(szReturn, "BoxSkill", g_MySQLConnections[0]);
  640. new skilllevel = strval(szReturn);
  641. if(skilllevel >= 0 && skilllevel <= 50) { jlevel = 1; }
  642. else if(skilllevel >= 51 && skilllevel <= 100) { jlevel = 2; }
  643. else if(skilllevel >= 101 && skilllevel <= 200) { jlevel = 3; }
  644. else if(skilllevel >= 201 && skilllevel <= 400) { jlevel = 4; }
  645. else if(skilllevel >= 401) { jlevel = 5; }
  646. }
  647. case 14:
  648. {
  649. mysql_fetch_field_row(szReturn, "SmugSkill", g_MySQLConnections[0]);
  650. new skilllevel = strval(szReturn);
  651. if(skilllevel >= 0 && skilllevel <= 50) { jlevel = 1; }
  652. else if(skilllevel >= 51 && skilllevel <= 100) { jlevel = 2; }
  653. else if(skilllevel >= 101 && skilllevel <= 200) { jlevel = 3; }
  654. else if(skilllevel >= 201 && skilllevel <= 400) { jlevel = 4; }
  655. else if(skilllevel >= 401) { jlevel = 5; }
  656. }
  657. case 20:
  658. {
  659. mysql_fetch_field_row(szReturn, "TruckSkill", g_MySQLConnections[0]);
  660. new skilllevel = strval(szReturn);
  661. if(skilllevel >= 0 && skilllevel <= 50) { jlevel = 1; }
  662. else if(skilllevel >= 51 && skilllevel <= 100) { jlevel = 2; }
  663. else if(skilllevel >= 101 && skilllevel <= 200) { jlevel = 3; }
  664. else if(skilllevel >= 201 && skilllevel <= 400) { jlevel = 4; }
  665. else if(skilllevel >= 401) { jlevel = 5; }
  666. }
  667. default: jlevel = 0;
  668. }
  669.  
  670. mysql_fetch_field_row(szReturn, "UpgradePoints", g_MySQLConnections[0]);
  671. new upgrade = strval(szReturn);
  672.  
  673. mysql_fetch_field_row(szReturn, "SpawnArmor", g_MySQLConnections[0]);
  674. new Float:sarmor = floatstr(szReturn);
  675.  
  676. mysql_fetch_field_row(szReturn, "Cash", g_MySQLConnections[0]);
  677. new cash = strval(szReturn);
  678.  
  679. mysql_fetch_field_row(szReturn, "Bank", g_MySQLConnections[0]);
  680. new bank = strval(szReturn);
  681.  
  682. new totalwealth = cash + bank;
  683.  
  684. mysql_fetch_field_row(szReturn, "Insurance", g_MySQLConnections[0]);
  685. new iInsurance = strval(szReturn);
  686.  
  687. new insur[20];
  688. switch(iInsurance)
  689. {
  690. case 1: insur = "County General";
  691. case 2: insur = "All Saints";
  692. default: insur = "None";
  693. }
  694.  
  695. mysql_fetch_field_row(szReturn, "Crimes", g_MySQLConnections[0]);
  696. new crimes = strval(szReturn);
  697.  
  698. mysql_fetch_field_row(szReturn, "Arrested", g_MySQLConnections[0]);
  699. new arrests = strval(szReturn);
  700.  
  701. mysql_fetch_field_row(szReturn, "WantedLevel", g_MySQLConnections[0]);
  702. new wanted = strval(szReturn);
  703.  
  704. new Float:health, Float:armor;
  705.  
  706. mysql_fetch_field_row(szReturn, "Health", g_MySQLConnections[0]);
  707. health = floatstr(szReturn);
  708.  
  709. mysql_fetch_field_row(szReturn, "Armor", g_MySQLConnections[0]);
  710. armor = floatstr(szReturn);
  711.  
  712. mysql_fetch_field_row(szReturn, "Pot", g_MySQLConnections[0]);
  713. new pot = strval(szReturn);
  714.  
  715. mysql_fetch_field_row(szReturn, "Crack", g_MySQLConnections[0]);
  716. new crack = strval(szReturn);
  717.  
  718. mysql_fetch_field_row(szReturn, "RadioFreq", g_MySQLConnections[0]);
  719. new radiofreq = strval(szReturn);
  720.  
  721. mysql_fetch_field_row(szReturn, "Materials", g_MySQLConnections[0]);
  722. new mats = strval(szReturn);
  723.  
  724. mysql_fetch_field_row(szReturn, "Rope", g_MySQLConnections[0]);
  725. new rope = strval(szReturn);
  726.  
  727. mysql_fetch_field_row(szReturn, "Cigars", g_MySQLConnections[0]);
  728. new cigars = strval(szReturn);
  729.  
  730. mysql_fetch_field_row(szReturn, "Sprunk", g_MySQLConnections[0]);
  731. new sprunk = strval(szReturn);
  732.  
  733. mysql_fetch_field_row(szReturn, "Spraycan", g_MySQLConnections[0]);
  734. new spray = strval(szReturn);
  735.  
  736. mysql_fetch_field_row(szReturn, "BiggestFish", g_MySQLConnections[0]);
  737. new bigfish = strval(szReturn);
  738.  
  739. // Eight line (admin only)
  740. mysql_fetch_field_row(szReturn, "House", g_MySQLConnections[0]);
  741. new house = strval(szReturn);
  742.  
  743. mysql_fetch_field_row(szReturn, "Renting", g_MySQLConnections[0]);
  744. new rent = strval(szReturn);
  745.  
  746. mysql_fetch_field_row(szReturn, "Interior", g_MySQLConnections[0]);
  747. new interior = strval(szReturn);
  748.  
  749. mysql_fetch_field_row(szReturn, "VirtualWorld", g_MySQLConnections[0]);
  750. new vw = strval(szReturn);
  751. new realvw = vw;
  752.  
  753. mysql_fetch_field_row(szReturn, "JailTime", g_MySQLConnections[0]);
  754. new jtime = strval(szReturn);
  755.  
  756. new
  757. szPlayerName[MAX_PLAYER_NAME];
  758.  
  759. mysql_fetch_field_row(szPlayerName, "Username", g_MySQLConnections[0]);
  760.  
  761. // Added
  762. new married[20];
  763. mysql_fetch_field_row(married, "MarriedTo", g_MySQLConnections[0]);
  764.  
  765. mysql_fetch_field_row(szReturn, "RefTokens", g_MySQLConnections[0]);
  766. new reftokens = strval(szReturn);
  767.  
  768. new sext[16];
  769. mysql_fetch_field_row(szReturn, "Sex", g_MySQLConnections[0]);
  770.  
  771. if(strval(szReturn) == 1) { sext = "Male"; } else { sext = "Female"; }
  772.  
  773. mysql_fetch_field_row(szReturn, "Age", g_MySQLConnections[0]);
  774. new age = strval(szReturn);
  775.  
  776. mysql_fetch_field_row(szReturn, "Donator", g_MySQLConnections[0]);
  777. new donator = strval(szReturn);
  778.  
  779. new donatortxt[16];
  780. if(donator == 0) { donatortxt = "No"; }
  781. else if(donator == 1) { donatortxt = "Ruby"; }
  782. else if(donator == 2) { donatortxt = "Sapphire"; }
  783. else if(donator == 3) { donatortxt = "Diamond"; }
  784. else { donatortxt = "No"; }
  785.  
  786. mysql_fetch_field_row(szReturn, "NewMutedTotal", g_MySQLConnections[0]);
  787. new nmutes = strval(szReturn);
  788.  
  789. mysql_fetch_field_row(szReturn, "AdMutedTotal", g_MySQLConnections[0]);
  790. new admutes = strval(szReturn);
  791.  
  792. mysql_fetch_field_row(szReturn, "ReportMutedTotal", g_MySQLConnections[0]);
  793. new rmutes = strval(szReturn);
  794.  
  795. mysql_fetch_field_row(szReturn, "AdminLevel", g_MySQLConnections[0]);
  796. new adminlevel = strval(szReturn);
  797.  
  798. mysql_fetch_field_row(szReturn, "Banned", g_MySQLConnections[0]);
  799. new banned = strval(szReturn);
  800.  
  801. mysql_fetch_field_row(szReturn, "Permabanned", g_MySQLConnections[0]);
  802. new permabanned = strval(szReturn);
  803.  
  804. mysql_fetch_field_row(szReturn, "Disabled", g_MySQLConnections[0]);
  805. new disabled = strval(szReturn);
  806.  
  807. SendClientMessage(extraid, COLOR_NEWS,"___________________________________________________________________________________________________");
  808. new coordsstring[128];
  809. format(coordsstring, sizeof(coordsstring),"%s - (Level: %d) - (Playing hours: %d) - (Gender: %s) - (Age: %d) - (Phone number: %d) - (Warnings: %d)", szPlayerName, level, phours, sext, age, pnumber, warns);
  810. SendClientMessage(extraid, COLOR_WHITE, coordsstring);
  811. format(coordsstring, sizeof(coordsstring),"(%s: %s) - (Rank: %s [%d]) - (Division: %s) - (Job: %s [lvl: %d]) - (Radio freq: %d kHz)", facgang, employer, rank, PlayerInfo[MAX_PLAYERS][pRank], division, jtext, jlevel, radiofreq);
  812. SendClientMessage(extraid, COLOR_FORSTATS, coordsstring);
  813. format(coordsstring, sizeof(coordsstring),"(Total wealth: $%d) - (Cash: $%d) - (Bank balance: $%d) - (Insurance: %s) - (Married to: %s)", totalwealth, cash, bank, insur, married);
  814. SendClientMessage(extraid, COLOR_WHITE, coordsstring);
  815. format(coordsstring, sizeof(coordsstring),"(Respect points: %d/%d [$%d]) - (Upgrade Points: %d) - (Spawn armor: %.1f) - (Health: %.1f) - (Armor: %.1f)", respect, expamount, costlevel, upgrade, sarmor, health, armor);
  816. SendClientMessage(extraid, COLOR_FORSTATS, coordsstring);
  817. format(coordsstring, sizeof(coordsstring),"(Crimes: %d) - (Arrests: %d) - (Wanted Level: %d) - (Materials: %d) - (Pot: %d) - (Crack: %d)", crimes, arrests, wanted, mats, pot, crack);
  818. SendClientMessage(extraid, COLOR_WHITE, coordsstring);
  819. format(coordsstring, sizeof(coordsstring),"(Rope: %d) - (Cigars: %d) - (Sprunk: %d) - (Spray: %d) - (Biggest fish: %d) - (Referral Tokens: %d) - (Donator: %s)", rope, cigars, sprunk, spray, bigfish, reftokens, donatortxt);
  820. SendClientMessage(extraid, COLOR_FORSTATS, coordsstring);
  821. format(coordsstring, sizeof(coordsstring), "(Admin Level: %d) - (Banned: %d) - (Permabanned: %d) - (Account disabled: %d)", adminlevel, banned, permabanned, disabled);
  822. SendClientMessage(extraid, COLOR_WHITE,coordsstring);
  823. format(coordsstring, sizeof(coordsstring), "(House: %d) - (Renting: %d) - (Int: %d) - (VW: %d) - (Real VW: %d) - (Jail: %d secs) - (Mutes: [N: %d] [AD: %d] [R: %d])", house, rent, interior, vw, realvw, jtime, nmutes, admutes, rmutes);
  824. SendClientMessage(extraid, COLOR_FORSTATS,coordsstring);
  825. SendClientMessage(extraid, COLOR_NEWS,"___________________________________________________________________________________________________");
  826. }
  827. }
  828.  
  829. mysql_free_result(g_MySQLConnections[0]);
  830. }
  831. case THREAD_OFFLINE_FINE: {
  832. mysql_store_result(g_MySQLConnections[0]);
  833.  
  834. new
  835. szMessage[128],
  836. szPlayerIP[20],
  837. iPlayerAdminLevel,
  838. iPlayerBanned,
  839. szReason[128],
  840. iPlayerPermabanned,
  841. iCash,
  842. iBankAccount,
  843. iFinedAmount,
  844. szPlayerName[MAX_PLAYER_NAME],
  845. szResult[256],
  846. iTotalCashAfterFine;
  847.  
  848. if(mysql_fetch_row_format(szResult, "|", g_MySQLConnections[0])) {
  849. sscanf(szResult, "p<|>dddssdd", iPlayerPermabanned, iPlayerBanned, iPlayerAdminLevel, szPlayerName, szPlayerIP, iBankAccount, iCash);
  850.  
  851. if(iPlayerPermabanned > 0)
  852. return SendClientMessage(extraid, COLOR_GREY, "The specified player is permanently banned.");
  853.  
  854. if(iPlayerAdminLevel > 0)
  855. return SendClientMessage(extraid, COLOR_GREY, "You can't fine other administrators.");
  856.  
  857. GetPVarString(extraid, "ofinereason", szReason, sizeof(szReason));
  858. mysql_real_escape_string(szReason, szReason, g_MySQLConnections[0]);
  859.  
  860. iFinedAmount = GetPVarInt(extraid, "ofineamount");
  861.  
  862. iTotalCashAfterFine = iCash - iFinedAmount;
  863. format(szQuery, sizeof(szQuery), "UPDATE players SET Cash = %d WHERE Username = '%s'", iTotalCashAfterFine, szPlayerName);
  864. mysql_query(szQuery, THREAD_NO_RESULT, extraid, g_MySQLConnections[0]);
  865.  
  866. format(szMessage, sizeof(szMessage), "AdmCmd: %s was offline fined $%d by %s, reason: %s", szPlayerName, iFinedAmount, GetPlayerNameEx(extraid), szReason);
  867. Log("logs/admin.log", szMessage);
  868. format(szMessage, sizeof(szMessage), "AdmCmd: %s was offline fined $%d by %s, reason: %s", szPlayerName, iFinedAmount, GetPlayerNameEx(extraid), szReason);
  869. ABroadCast(COLOR_LIGHTRED,szMessage,1);
  870. } else SendClientMessage(extraid, COLOR_GREY, "The player specified does not exist.");
  871.  
  872. mysql_free_result(g_MySQLConnections[0]);
  873. }
  874. case THREAD_OFFLINE_BAN: {
  875. mysql_store_result(g_MySQLConnections[0]);
  876.  
  877. new
  878. szMessage[128],
  879. szPlayerIP[20],
  880. iPlayerAdminLevel,
  881. iPlayerBanned,
  882. szReason[128],
  883. iPlayerPermabanned,
  884. szPlayerName[MAX_PLAYER_NAME],
  885. iAccountID,
  886. szResult[256];
  887.  
  888. if(mysql_fetch_row_format(szResult, "|", g_MySQLConnections[0])) {
  889. sscanf(szResult, "p<|>ddds[MAX_PLAYER_NAME]s[20]d", iPlayerPermabanned, iPlayerBanned, iPlayerAdminLevel, szPlayerName, szPlayerIP, iAccountID);
  890.  
  891. if(iPlayerPermabanned > 0)
  892. return SendClientMessage(extraid, COLOR_GREY, "The specified player is already permanently banned.");
  893.  
  894. if(iPlayerAdminLevel > 0)
  895. return SendClientMessage(extraid, COLOR_GREY, "You can't ban other administrators.");
  896.  
  897. GetPVarString(extraid, "obanreason", szReason, sizeof(szReason));
  898. mysql_real_escape_string(szReason, szReason, g_MySQLConnections[0]);
  899.  
  900. AddBan(szPlayerIP);
  901.  
  902. format(szMessage, sizeof(szMessage), "AdmCmd: %s (IP: %s) was offline banned by %s, reason: %s", szPlayerName, szPlayerIP, GetPlayerNameEx(extraid), szReason);
  903. Log("logs/ban.log", szMessage);
  904. ABroadCast(COLOR_LIGHTRED, szMessage, 1);
  905.  
  906. format(szQuery, sizeof(szQuery), "UPDATE players SET Banned = 1 WHERE Username = '%s'", szPlayerName);
  907. mysql_query(szQuery, THREAD_NO_RESULT, extraid, g_MySQLConnections[0]);
  908. punishmentLogEx(iAccountID, PlayerInfo[extraid][pID], 4, szMessage, szReason);
  909.  
  910. DeletePVar(extraid, "obanreason");
  911. } else SendClientMessage(extraid, COLOR_GREY, "The player specified does not exist.");
  912.  
  913. mysql_free_result(g_MySQLConnections[0]);
  914. }
  915. case THREAD_OFFLINE_PRISON: {
  916. mysql_store_result(g_MySQLConnections[0]);
  917.  
  918. new
  919. szMessage[128],
  920. szPlayerIP[20],
  921. iPlayerAdminLevel,
  922. iPlayerPrisonTime,
  923. iPlayerBanned,
  924. szReason[128],
  925. iPlayerPermabanned,
  926. szPlayerName[MAX_PLAYER_NAME],
  927. iAccountID,
  928. szResult[285];
  929.  
  930. if(mysql_fetch_row_format(szResult, "|", g_MySQLConnections[0])) {
  931. sscanf(szResult, "p<|>ddds[20]s[19]d", iPlayerPermabanned, iPlayerBanned, iPlayerAdminLevel, szPlayerName, szPlayerIP, iPlayerPrisonTime, iAccountID);
  932. print(szResult);
  933.  
  934. if(iPlayerPermabanned > 0)
  935. return SendClientMessage(extraid, COLOR_GREY, "The specified player is already permanently banned.");
  936.  
  937. if(iPlayerBanned > 0)
  938. return SendClientMessage(extraid, COLOR_GREY, "The specified player is already banned.");
  939.  
  940. if(iPlayerAdminLevel > 0)
  941. return SendClientMessage(extraid, COLOR_GREY, "You can't warn other administrators.");
  942.  
  943. GetPVarString(extraid, "oprisonreason", szReason, sizeof(szReason));
  944. mysql_real_escape_string(szReason, szReason, g_MySQLConnections[0]);
  945.  
  946. iPlayerPrisonTime = GetPVarInt(extraid, "oprisontime");
  947.  
  948. format(szMessage, sizeof(szMessage), "AdmCmd: %s was offline prisoned by %s, reason: %s", szPlayerName, GetPlayerNameEx(extraid), szReason);
  949. ABroadCast(COLOR_LIGHTRED, szMessage, 1);
  950. format(szMessage, sizeof(szMessage), "AdmCmd: %s was offline prisoned by %s, reason: %s", szPlayerName, GetPlayerNameEx(extraid), szReason);
  951. Log("logs/admin.log", szMessage);
  952. punishmentLogEx(iAccountID, PlayerInfo[extraid][pID], 2, szMessage, szReason);
  953.  
  954. format(szQuery, sizeof(szQuery), "UPDATE players SET Jailed = 3, JailTime = %d, PrisonReason = '%s', PrisonedBy = '%s' WHERE Username = '%s'", iPlayerPrisonTime, szReason, GetPlayerNameExEx(extraid), szPlayerName);
  955. mysql_query(szQuery, THREAD_NO_RESULT, extraid, g_MySQLConnections[0]);
  956.  
  957. DeletePVar(extraid, "oprisonreason");
  958. DeletePVar(extraid, "oprisontime");
  959. } else SendClientMessage(extraid, COLOR_GREY, "The player specified does not exist.");
  960.  
  961. mysql_free_result(g_MySQLConnections[0]);
  962. }
  963. case THREAD_OFFLINE_WARN: {
  964. mysql_store_result(g_MySQLConnections[0]);
  965.  
  966. new
  967. szMessage[128],
  968. szPlayerIP[20],
  969. iPlayerAdminLevel,
  970. iPlayerWarnings,
  971. iPlayerBanned,
  972. szReason[128],
  973. iPlayerPermabanned,
  974. szPlayerName[MAX_PLAYER_NAME],
  975. iAccountID,
  976. szResult[256];
  977.  
  978. if(mysql_fetch_row_format(szResult, "|", g_MySQLConnections[0])) {
  979. sscanf(szResult, "p<|>ddds[24]s[20]dd", iPlayerPermabanned, iPlayerBanned, iPlayerAdminLevel, szPlayerName, szPlayerIP, iPlayerWarnings, iAccountID);
  980. print(szResult);
  981.  
  982. if(iPlayerPermabanned > 0)
  983. return SendClientMessage(extraid, COLOR_GREY, "The specified player is already permanently banned.");
  984.  
  985. if(iPlayerBanned > 0)
  986. return SendClientMessage(extraid, COLOR_GREY, "The specified player is already banned.");
  987.  
  988. if(iPlayerAdminLevel > 0)
  989. return SendClientMessage(extraid, COLOR_GREY, "You can't warn other administrators.");
  990.  
  991. GetPVarString(extraid, "owarnreason", szReason, sizeof(szReason));
  992.  
  993. iPlayerWarnings += 1;
  994.  
  995. if(iPlayerWarnings >= 3) {
  996. format(szReason, sizeof(szReason), "%s (had 3 warnings)", szReason);
  997. SetPVarString(extraid, "obanreason", szReason);
  998.  
  999. format(szQuery, sizeof(szQuery), "UPDATE players SET Warnings = %d WHERE Username = '%s'", iPlayerWarnings, szPlayerName);
  1000. mysql_query(szQuery, THREAD_NO_RESULT, extraid, g_MySQLConnections[0]);
  1001.  
  1002. punishmentLogEx(iAccountID, PlayerInfo[extraid][pID], 4, szMessage, szReason);
  1003. mysql_real_escape_string(szPlayerName, szPlayerName, g_MySQLConnections[0]);
  1004.  
  1005. format(szMessage, sizeof(szMessage), "SELECT Permabanned, Banned, AdminLevel, Username, LastIP FROM players WHERE Username = '%s'", szPlayerName);
  1006. mysql_query(szMessage, THREAD_OFFLINE_BAN, extraid, g_MySQLConnections[0]);
  1007. return 1;
  1008. }
  1009.  
  1010. format(szMessage, sizeof(szMessage), "AdmCmd: %s was offline warned by %s, reason: %s", szPlayerName, GetPlayerNameEx(extraid), szReason);
  1011. ABroadCast(COLOR_LIGHTRED, szMessage, 1);
  1012. format(szMessage, sizeof(szMessage), "AdmCmd: %s was offline warned by %s, reason: %s", szPlayerName, GetPlayerNameEx(extraid), szReason);
  1013. Log("logs/admin.log", szMessage);
  1014. punishmentLogEx(iAccountID, PlayerInfo[extraid][pID], 1, szMessage, szReason);
  1015.  
  1016. format(szQuery, sizeof(szQuery), "UPDATE players SET Warnings = %d WHERE Username = '%s'", iPlayerWarnings, szPlayerName);
  1017. mysql_query(szQuery, THREAD_NO_RESULT, extraid, g_MySQLConnections[0]);
  1018.  
  1019. DeletePVar(extraid, "owarnreason");
  1020. } else SendClientMessage(extraid, COLOR_GREY, "The player specified does not exist.");
  1021.  
  1022. mysql_free_result(g_MySQLConnections[0]);
  1023. }
  1024. case THREAD_OFFLINE_IP_CHECK: {
  1025. mysql_store_result(g_MySQLConnections[0]);
  1026.  
  1027. new
  1028. szMessage[128],
  1029. szPlayerIP[20],
  1030. szPlayerName[MAX_PLAYER_NAME],
  1031. szResult[256];
  1032.  
  1033. if(mysql_fetch_row_format(szResult, "|", g_MySQLConnections[0])) {
  1034. sscanf(szResult, "p<|>s[20]s[16]", szPlayerName, szPlayerIP);
  1035.  
  1036. format(szMessage, sizeof(szMessage), "Name: %s | IP: %s", szPlayerName, szPlayerIP);
  1037. SendClientMessage(extraid, COLOR_WHITE, szMessage);
  1038. } else SendClientMessage(extraid, COLOR_GREY, "The player specified does not exist.");
  1039.  
  1040. mysql_free_result(g_MySQLConnections[0]);
  1041. }
  1042. case THREAD_CHECK_BANNED: {
  1043. mysql_store_result(g_MySQLConnections[0]);
  1044.  
  1045. new
  1046. szResult[128],
  1047. szMessage[128],
  1048. szPlayerIP[20],
  1049. szPlayerName[MAX_PLAYER_NAME],
  1050. iPlayerBan,
  1051. iPlayerWarnings,
  1052. iPlayerPermaban;
  1053.  
  1054. if(mysql_fetch_row_format(szResult, "|", g_MySQLConnections[0])) {
  1055. sscanf(szResult, "p<|>ddds[16]s[20]", iPlayerBan, iPlayerPermaban, iPlayerWarnings, szPlayerIP, szPlayerName);
  1056. print(szResult);
  1057.  
  1058. if(iPlayerPermaban > 0) {
  1059. SendClientMessage(extraid, COLOR_GREY, "You can't unban this person in-game, they have been permanently banned.");
  1060. mysql_free_result(g_MySQLConnections[0]);
  1061. } else {
  1062. if(iPlayerBan > 0) {
  1063. RemoveBan(szPlayerIP);
  1064.  
  1065. format(szMessage, sizeof(szMessage), "AdmCmd: %s (IP: %s) was unbanned by %s.", szPlayerName, szPlayerIP, GetPlayerNameEx(extraid));
  1066. ABroadCast(COLOR_LIGHTRED, szMessage, 1);
  1067.  
  1068. format(szMessage, sizeof(szMessage), "AdmCmd: %s (IP: %s) was unbanned by %s.", szPlayerName, szPlayerIP, GetPlayerNameEx(extraid));
  1069. Log("logs/ban.log", szMessage);
  1070.  
  1071. if(iPlayerWarnings >= 3) {
  1072. format(szQuery, sizeof(szQuery), "UPDATE players SET Banned = 0, Warnings = 0 WHERE Username = '%s'", szPlayerName);
  1073. } else format(szQuery, sizeof(szQuery), "UPDATE players SET Banned = 0 WHERE Username = '%s'", szPlayerName);
  1074. mysql_query(szQuery, THREAD_NO_RESULT, 0, g_MySQLConnections[0]);
  1075. } else SendClientMessage(extraid, COLOR_GREY, "The player specified isn't banned.");
  1076. }
  1077. } else SendClientMessage(extraid, COLOR_GREY, "No rows exist with the criteria specified.");
  1078.  
  1079. mysql_free_result(g_MySQLConnections[0]);
  1080. }
  1081. case THREAD_DELETE_PLAYER_OBJECT: {
  1082. new
  1083. string[64],
  1084. listitem = GetPVarInt(extraid, "deleteObject");
  1085.  
  1086. PlayerToyInfo[extraid][listitem][ptModelID] = 0;
  1087. PlayerToyInfo[extraid][listitem][ptBone] = 1;
  1088. PlayerToyInfo[extraid][listitem][ptRealID] = 0;
  1089. PlayerToyInfo[extraid][listitem][ptPosX] = 0.0;
  1090. PlayerToyInfo[extraid][listitem][ptPosY] = 0.0;
  1091. PlayerToyInfo[extraid][listitem][ptPosZ] = 0.0;
  1092. PlayerToyInfo[extraid][listitem][ptPosX] = 0.0;
  1093. PlayerToyInfo[extraid][listitem][ptPosY] = 0.0;
  1094. PlayerToyInfo[extraid][listitem][ptPosZ] = 0.0;
  1095.  
  1096. format(string, sizeof(string), "You have deleted your toy from slot %d.", listitem);
  1097. ShowPlayerDialogEx(extraid, 0, DIALOG_STYLE_MSGBOX, "Toy Menu - Removal of Toy", string, "OK", "");
  1098.  
  1099. DeletePVar(extraid, "deleteObject");
  1100. }
  1101. case THREAD_LOAD_P_ITEMS_CHAIN_1: {
  1102. mysql_store_result(g_MySQLConnections[0]);
  1103.  
  1104. new
  1105. szReturn[16],
  1106. iSlot = 0;
  1107.  
  1108. while(mysql_retrieve_row()) {
  1109. mysql_fetch_field_row(szReturn, "ID", g_MySQLConnections[0]);
  1110. PlayerToyInfo[extraid][iSlot][ptRealID] = strval(szReturn);
  1111.  
  1112. mysql_fetch_field_row(szReturn, "ModelID", g_MySQLConnections[0]);
  1113. PlayerToyInfo[extraid][iSlot][ptModelID] = strval(szReturn);
  1114.  
  1115. mysql_fetch_field_row(szReturn, "Bone", g_MySQLConnections[0]);
  1116. PlayerToyInfo[extraid][iSlot][ptBone] = strval(szReturn);
  1117.  
  1118. if(PlayerToyInfo[extraid][iSlot][ptBone] > 18 || PlayerToyInfo[extraid][iSlot][ptBone] < 1) PlayerToyInfo[extraid][iSlot][ptBone] = 1;
  1119.  
  1120. mysql_fetch_field_row(szReturn, "PosX", g_MySQLConnections[0]);
  1121. PlayerToyInfo[extraid][iSlot][ptPosX] = floatstr(szReturn);
  1122.  
  1123. mysql_fetch_field_row(szReturn, "PosY", g_MySQLConnections[0]);
  1124. PlayerToyInfo[extraid][iSlot][ptPosY] = floatstr(szReturn);
  1125.  
  1126. mysql_fetch_field_row(szReturn, "PosZ", g_MySQLConnections[0]);
  1127. PlayerToyInfo[extraid][iSlot][ptPosZ] = floatstr(szReturn);
  1128.  
  1129. mysql_fetch_field_row(szReturn, "RotX", g_MySQLConnections[0]);
  1130. PlayerToyInfo[extraid][iSlot][ptRotX] = floatstr(szReturn);
  1131.  
  1132. mysql_fetch_field_row(szReturn, "RotY", g_MySQLConnections[0]);
  1133. PlayerToyInfo[extraid][iSlot][ptRotY] = floatstr(szReturn);
  1134.  
  1135. mysql_fetch_field_row(szReturn, "RotZ", g_MySQLConnections[0]);
  1136. PlayerToyInfo[extraid][iSlot][ptRotZ] = floatstr(szReturn);
  1137.  
  1138. mysql_fetch_field_row(szReturn, "ScaX", g_MySQLConnections[0]);
  1139. PlayerToyInfo[extraid][iSlot][ptScaleX] = floatstr(szReturn);
  1140.  
  1141. mysql_fetch_field_row(szReturn, "ScaY", g_MySQLConnections[0]);
  1142. PlayerToyInfo[extraid][iSlot][ptScaleY] = floatstr(szReturn);
  1143.  
  1144. mysql_fetch_field_row(szReturn, "ScaZ", g_MySQLConnections[0]);
  1145. PlayerToyInfo[extraid][iSlot][ptScaleZ] = floatstr(szReturn);
  1146.  
  1147. iSlot++;
  1148. }
  1149.  
  1150. mysql_free_result(g_MySQLConnections[0]);
  1151.  
  1152. format(szQuery, sizeof(szQuery), "SELECT playervehicles.* FROM playervehicles INNER JOIN players ON playervehicles.Owner = players.ID WHERE players.ID = '%d' ORDER BY playervehicles.Owner ASC LIMIT %d", PlayerInfo[extraid][pID], MAX_PLAYERVEHICLES);
  1153. mysql_query(szQuery, THREAD_LOAD_P_ITEMS_CHAIN_2, extraid, g_MySQLConnections[0]);
  1154. }
  1155. case THREAD_LOAD_P_ITEMS_CHAIN_2: {
  1156. mysql_store_result(g_MySQLConnections[0]);
  1157.  
  1158. new
  1159. szReturn[16],
  1160. iSlot = 0;
  1161.  
  1162. while(mysql_retrieve_row()) {
  1163. mysql_fetch_field_row(szReturn, "ID", g_MySQLConnections[0]);
  1164. PlayerVehicleInfo[extraid][iSlot][pvRealID] = strval(szReturn);
  1165.  
  1166. mysql_fetch_field_row(szReturn, "PosX", g_MySQLConnections[0]);
  1167. PlayerVehicleInfo[extraid][iSlot][pvPosX] = floatstr(szReturn);
  1168.  
  1169. mysql_fetch_field_row(szReturn, "PosY", g_MySQLConnections[0]);
  1170. PlayerVehicleInfo[extraid][iSlot][pvPosY] = floatstr(szReturn);
  1171.  
  1172. mysql_fetch_field_row(szReturn, "PosZ", g_MySQLConnections[0]);
  1173. PlayerVehicleInfo[extraid][iSlot][pvPosZ] = floatstr(szReturn);
  1174.  
  1175. mysql_fetch_field_row(szReturn, "PosAngle", g_MySQLConnections[0]);
  1176. PlayerVehicleInfo[extraid][iSlot][pvPosAngle] = floatstr(szReturn);
  1177.  
  1178. mysql_fetch_field_row(szReturn, "ModelID", g_MySQLConnections[0]);
  1179. PlayerVehicleInfo[extraid][iSlot][pvModelId] = strval(szReturn);
  1180.  
  1181. mysql_fetch_field_row(szReturn, "LockType", g_MySQLConnections[0]);
  1182. PlayerVehicleInfo[extraid][iSlot][pvLock] = strval(szReturn);
  1183.  
  1184. mysql_fetch_field_row(szReturn, "Locked", g_MySQLConnections[0]);
  1185. PlayerVehicleInfo[extraid][iSlot][pvLocked] = strval(szReturn);
  1186.  
  1187. mysql_fetch_field_row(szReturn, "PaintJob", g_MySQLConnections[0]);
  1188. PlayerVehicleInfo[extraid][iSlot][pvPaintJob] = strval(szReturn);
  1189.  
  1190. mysql_fetch_field_row(szReturn, "Color1", g_MySQLConnections[0]);
  1191. PlayerVehicleInfo[extraid][iSlot][pvColor1] = strval(szReturn);
  1192.  
  1193. mysql_fetch_field_row(szReturn, "Color2", g_MySQLConnections[0]);
  1194. PlayerVehicleInfo[extraid][iSlot][pvColor2] = strval(szReturn);
  1195.  
  1196. mysql_fetch_field_row(szReturn, "Price", g_MySQLConnections[0]);
  1197. PlayerVehicleInfo[extraid][iSlot][pvPrice] = strval(szReturn);
  1198.  
  1199. mysql_fetch_field_row(szReturn, "Ticket", g_MySQLConnections[0]);
  1200. PlayerVehicleInfo[extraid][iSlot][pvTicket] = strval(szReturn);
  1201.  
  1202. mysql_fetch_field_row(szReturn, "Weapon0", g_MySQLConnections[0]);
  1203. PlayerVehicleInfo[extraid][iSlot][pvWeapons][0] = strval(szReturn);
  1204.  
  1205. mysql_fetch_field_row(szReturn, "Weapon1", g_MySQLConnections[0]);
  1206. PlayerVehicleInfo[extraid][iSlot][pvWeapons][1] = strval(szReturn);
  1207.  
  1208. mysql_fetch_field_row(szReturn, "Weapon2", g_MySQLConnections[0]);
  1209. PlayerVehicleInfo[extraid][iSlot][pvWeapons][2] = strval(szReturn);
  1210.  
  1211. mysql_fetch_field_row(szReturn, "WepUpgrade", g_MySQLConnections[0]);
  1212. PlayerVehicleInfo[extraid][iSlot][pvWepUpgrade] = strval(szReturn);
  1213.  
  1214. /*mysql_fetch_field_row(szReturn, "Fuel", g_MySQLConnections[0]);*/
  1215. PlayerVehicleInfo[extraid][iSlot][pvFuel] = 100.0; //floatstr(szReturn);
  1216.  
  1217. mysql_fetch_field_row(szReturn, "Impound", g_MySQLConnections[0]);
  1218. PlayerVehicleInfo[extraid][iSlot][pvImpounded] = strval(szReturn);
  1219.  
  1220. mysql_fetch_field_row(szReturn, "Spawned", g_MySQLConnections[0]);
  1221. PlayerVehicleInfo[extraid][iSlot][pvSpawned] = strval(szReturn);
  1222.  
  1223. mysql_fetch_field_row(szReturn, "Disabled", g_MySQLConnections[0]);
  1224. PlayerVehicleInfo[extraid][iSlot][pvDisabled] = strval(szReturn);
  1225.  
  1226. mysql_fetch_field_row(PlayerVehicleInfo[extraid][iSlot][pvNumberPlate], "NumPlate", g_MySQLConnections[0]);
  1227.  
  1228. mysql_fetch_field_row(szReturn, "Disabled", g_MySQLConnections[0]);
  1229. PlayerVehicleInfo[extraid][iSlot][pvDisabled] = strval(szReturn);
  1230.  
  1231. mysql_fetch_field_row(szReturn, "Mod0", g_MySQLConnections[0]);
  1232. PlayerVehicleInfo[extraid][iSlot][pvMods][0] = strval(szReturn);
  1233.  
  1234. mysql_fetch_field_row(szReturn, "Mod1", g_MySQLConnections[0]);
  1235. PlayerVehicleInfo[extraid][iSlot][pvMods][1] = strval(szReturn);
  1236.  
  1237. mysql_fetch_field_row(szReturn, "Mod2", g_MySQLConnections[0]);
  1238. PlayerVehicleInfo[extraid][iSlot][pvMods][2] = strval(szReturn);
  1239.  
  1240. mysql_fetch_field_row(szReturn, "Mod3", g_MySQLConnections[0]);
  1241. PlayerVehicleInfo[extraid][iSlot][pvMods][3] = strval(szReturn);
  1242.  
  1243. mysql_fetch_field_row(szReturn, "Mod4", g_MySQLConnections[0]);
  1244. PlayerVehicleInfo[extraid][iSlot][pvMods][4] = strval(szReturn);
  1245.  
  1246. mysql_fetch_field_row(szReturn, "Mod5", g_MySQLConnections[0]);
  1247. PlayerVehicleInfo[extraid][iSlot][pvMods][5] = strval(szReturn);
  1248.  
  1249. mysql_fetch_field_row(szReturn, "Mod6", g_MySQLConnections[0]);
  1250. PlayerVehicleInfo[extraid][iSlot][pvMods][6] = strval(szReturn);
  1251.  
  1252. mysql_fetch_field_row(szReturn, "Mod7", g_MySQLConnections[0]);
  1253. PlayerVehicleInfo[extraid][iSlot][pvMods][7] = strval(szReturn);
  1254.  
  1255. mysql_fetch_field_row(szReturn, "Mod8", g_MySQLConnections[0]);
  1256. PlayerVehicleInfo[extraid][iSlot][pvMods][8] = strval(szReturn);
  1257.  
  1258. mysql_fetch_field_row(szReturn, "Mod9", g_MySQLConnections[0]);
  1259. PlayerVehicleInfo[extraid][iSlot][pvMods][9] = strval(szReturn);
  1260.  
  1261. mysql_fetch_field_row(szReturn, "Mod10", g_MySQLConnections[0]);
  1262. PlayerVehicleInfo[extraid][iSlot][pvMods][10] = strval(szReturn);
  1263.  
  1264. mysql_fetch_field_row(szReturn, "Mod11", g_MySQLConnections[0]);
  1265. PlayerVehicleInfo[extraid][iSlot][pvMods][11] = strval(szReturn);
  1266.  
  1267. mysql_fetch_field_row(szReturn, "Mod12", g_MySQLConnections[0]);
  1268. PlayerVehicleInfo[extraid][iSlot][pvMods][12] = strval(szReturn);
  1269.  
  1270. mysql_fetch_field_row(szReturn, "Mod13", g_MySQLConnections[0]);
  1271. PlayerVehicleInfo[extraid][iSlot][pvMods][13] = strval(szReturn);
  1272.  
  1273. mysql_fetch_field_row(szReturn, "Mod14", g_MySQLConnections[0]);
  1274. PlayerVehicleInfo[extraid][iSlot][pvMods][14] = strval(szReturn);
  1275. if(AdminLoggedInBefore[extraid] == 0) LoadPlayerVehicles(extraid);
  1276. CheckPlayerVehicleForDesync(extraid, PlayerVehicleInfo[extraid][iSlot][pvId]);
  1277.  
  1278. iSlot++;
  1279. }
  1280.  
  1281. mysql_free_result(g_MySQLConnections[0]);
  1282.  
  1283. format(szQuery, sizeof(szQuery), "SELECT kills.* FROM kills INNER JOIN players ON kills.killerID = players.ID OR kills.killedID = players.ID WHERE players.ID = '%d' ORDER BY kills.killTS ASC LIMIT 10", PlayerInfo[extraid][pID]);
  1284. mysql_query(szQuery, THREAD_LOAD_P_ITEMS_CHAIN_3, extraid, g_MySQLConnections[0]);
  1285. }
  1286. case THREAD_LOAD_P_ITEMS_CHAIN_3: {
  1287. mysql_store_result(g_MySQLConnections[0]);
  1288.  
  1289. new
  1290. iSlot = 0;
  1291.  
  1292. while(mysql_retrieve_row()) {
  1293. iSlot++;
  1294. switch(iSlot) {
  1295. case 0: mysql_fetch_field_row(PlayerInfo[extraid][pKillLog0], "killText", g_MySQLConnections[0]);
  1296. case 1: mysql_fetch_field_row(PlayerInfo[extraid][pKillLog1], "killText", g_MySQLConnections[0]);
  1297. case 2: mysql_fetch_field_row(PlayerInfo[extraid][pKillLog2], "killText", g_MySQLConnections[0]);
  1298. case 3: mysql_fetch_field_row(PlayerInfo[extraid][pKillLog3], "killText", g_MySQLConnections[0]);
  1299. case 4: mysql_fetch_field_row(PlayerInfo[extraid][pKillLog4], "killText", g_MySQLConnections[0]);
  1300. case 5: mysql_fetch_field_row(PlayerInfo[extraid][pKillLog5], "killText", g_MySQLConnections[0]);
  1301. case 6: mysql_fetch_field_row(PlayerInfo[extraid][pKillLog6], "killText", g_MySQLConnections[0]);
  1302. case 7: mysql_fetch_field_row(PlayerInfo[extraid][pKillLog7], "killText", g_MySQLConnections[0]);
  1303. case 8: mysql_fetch_field_row(PlayerInfo[extraid][pKillLog8], "killText", g_MySQLConnections[0]);
  1304. case 9: mysql_fetch_field_row(PlayerInfo[extraid][pKillLog9], "killText", g_MySQLConnections[0]);
  1305. }
  1306. }
  1307.  
  1308. mysql_free_result(g_MySQLConnections[0]);
  1309. }
  1310. case THREAD_SAVE_ACCOUNT_CHAIN_1: {
  1311. format(szQuery, sizeof(szQuery), "UPDATE players SET Job = %d, Job2 = %d, UpgradePoints = %d, SpawnArmor = '%f', Cash = %d, Bank = %d, Insurance = %d, Crimes = %d, Arrested = %d, WantedLevel = %d, Health = '%f', Armor = '%f', \
  1312. Pot = %d, Crack = %d, Radio = %d, RadioFreq = %d, Phonebook = %d, Dice = %d, CDPlayer = %d, Materials = %d, Rope = %d, Cigars = %d, Sprunk = %d, Spraycan = %d, House = %d, House2 = %d, Renting = %d, Interior = %d, VirtualWorld = %d, Jailed = %d WHERE ID = %d",
  1313. PlayerInfo[extraid][pJob], PlayerInfo[extraid][pJob2], PlayerInfo[extraid][gPupgrade], PlayerInfo[extraid][pSarmor], PlayerInfo[extraid][pCash], PlayerInfo[extraid][pBank], PlayerInfo[extraid][pInsurance], PlayerInfo[extraid][pCrimes],
  1314. PlayerInfo[extraid][pArrested], PlayerInfo[extraid][pWantedLevel], PlayerInfo[extraid][pHealth], PlayerInfo[extraid][pArmor], PlayerInfo[extraid][pPot], PlayerInfo[extraid][pCrack], PlayerInfo[extraid][pRadio], PlayerInfo[extraid][pRadioFreq],
  1315. PlayerInfo[extraid][pPhoneBook], PlayerInfo[extraid][pDice], PlayerInfo[extraid][pCDPlayer], PlayerInfo[extraid][pMats], PlayerInfo[extraid][pRope], PlayerInfo[extraid][pCigar], PlayerInfo[extraid][pSprunk], PlayerInfo[extraid][pSpraycan], PlayerInfo[extraid][pHouse],
  1316. PlayerInfo[extraid][pHouse2], PlayerInfo[extraid][pRenting], PlayerInfo[extraid][pInt], PlayerInfo[extraid][pVW], PlayerInfo[extraid][pJailed], PlayerInfo[extraid][pID]);
  1317.  
  1318. mysql_query(szQuery, THREAD_SAVE_ACCOUNT_CHAIN_2, extraid, g_MySQLConnections[0]);
  1319. }
  1320. case THREAD_SAVE_ACCOUNT_CHAIN_2: {
  1321. format(szQuery, sizeof(szQuery), "UPDATE players SET JailTime = %d, Gun0 = %d, Gun1 = %d, Gun2 = %d, Gun3 = %d, Gun4 = %d, Gun5 = %d, Gun6 = %d, Gun7 = %d, Gun8 = %d, Gun9 = %d, Gun10 = %d, Gun11 = %d, Paycheck = %d, PayReady = %d, Hospital = %d, \
  1322. DetSkill = %d, FishSkill = %d, LawSkill = %d, DrugsSkill = %d, SmugglerSkill = %d, ArmsSkill = %d, MechSkill = %d, BoxSkill = %d, TruckSkill = %d, CarSkill = %d, LawyerTime = %d, LawyerFreeTime = %d, DrugsTime = %d, MechTime = %d WHERE ID = %d",
  1323. PlayerInfo[extraid][pJailTime], PlayerInfo[extraid][pGuns][0], PlayerInfo[extraid][pGuns][1], PlayerInfo[extraid][pGuns][2], PlayerInfo[extraid][pGuns][3], PlayerInfo[extraid][pGuns][4], PlayerInfo[extraid][pGuns][5], PlayerInfo[extraid][pGuns][6], PlayerInfo[extraid][pGuns][7],
  1324. PlayerInfo[extraid][pGuns][8], PlayerInfo[extraid][pGuns][9], PlayerInfo[extraid][pGuns][10], PlayerInfo[extraid][pGuns][11], PlayerInfo[extraid][pPayCheck], PlayerInfo[extraid][pPayReady], PlayerInfo[extraid][pHospital], PlayerInfo[extraid][pDetSkill], PlayerInfo[extraid][pFishSkill],
  1325. PlayerInfo[extraid][pLawSkill], PlayerInfo[extraid][pDrugsSkill], PlayerInfo[extraid][pSmugSkill], PlayerInfo[extraid][pArmsSkill], PlayerInfo[extraid][pMechSkill], PlayerInfo[extraid][pBoxSkill], PlayerInfo[extraid][pTruckSkill], PlayerInfo[extraid][pCarSkill], PlayerInfo[extraid][pLawyerTime],
  1326. PlayerInfo[extraid][pLawyerFreeTime], PlayerInfo[extraid][pDrugsTime], PlayerInfo[extraid][pMechTime], PlayerInfo[extraid][pID]);
  1327.  
  1328. mysql_query(szQuery, THREAD_SAVE_ACCOUNT_CHAIN_3, extraid, g_MySQLConnections[0]);
  1329. }
  1330. case THREAD_SAVE_ACCOUNT_CHAIN_3: {
  1331. format(szQuery, sizeof(szQuery), "UPDATE players SET SexTime = %d, CarTime = %d, Fishes = %d, BiggestFish = %d, pWEXists = %d, pWX = '%f', pWY = '%f', pWZ = '%f', pWVW = %d, pWInt = %d, pWValue = %d, pWSeeds = %d, Wins = %d, Loses = %d, \
  1332. FightingStyle = %d, Screwdriver = %d, Wristwatch = %d, Tire = %d, Firstaid = %d, Rccam = %d, Receiver = %d, GPS = %d, Sweep = %d, SweepLeft = %d, Bugged = %d, OnDuty = %d, CarLic = %d, FlyLic = %d, GunLic = %d, Division = %d WHERE ID = %d",
  1333. PlayerInfo[extraid][pSexTime], PlayerInfo[extraid][pCarTime], PlayerInfo[extraid][pFishes], PlayerInfo[extraid][pBiggestFish], PlayerInfo[extraid][pWeedObject], PlayerInfo[extraid][pWeedPos][0], PlayerInfo[extraid][pWeedPos][1], PlayerInfo[extraid][pWeedPos][2],
  1334. PlayerInfo[extraid][pWeedVW], PlayerInfo[extraid][pWeedInt], PlayerInfo[extraid][pWeedGrowth], PlayerInfo[extraid][pWSeeds], PlayerInfo[extraid][pWins], PlayerInfo[extraid][pLoses], PlayerInfo[extraid][pFightStyle], PlayerInfo[extraid][pScrewdriver],
  1335. PlayerInfo[extraid][pWristwatch], PlayerInfo[extraid][pTire], PlayerInfo[extraid][pFirstaid], PlayerInfo[extraid][pRccam], PlayerInfo[extraid][pReceiver], PlayerInfo[extraid][pGPS], PlayerInfo[extraid][pSweep], PlayerInfo[extraid][pSweepLeft],
  1336. PlayerInfo[extraid][pBugged], PlayerInfo[extraid][pDuty], PlayerInfo[extraid][pCarLic], PlayerInfo[extraid][pFlyLic], PlayerInfo[extraid][pGunLic], PlayerInfo[extraid][pDivision], PlayerInfo[extraid][pID]);
  1337.  
  1338. mysql_query(szQuery, THREAD_SAVE_ACCOUNT_CHAIN_4, extraid, g_MySQLConnections[0]);
  1339. }
  1340. case THREAD_SAVE_ACCOUNT_CHAIN_4: {
  1341. // Escape strings for now....
  1342. new
  1343. szPrisonedBy[MAX_PLAYER_NAME],
  1344. szPrisonReason[128],
  1345. szContractBy[MAX_PLAYER_NAME],
  1346. szContractDetail[128];
  1347.  
  1348. mysql_real_escape_string(PlayerInfo[extraid][pPrisonedBy], szPrisonedBy, g_MySQLConnections[0]);
  1349. mysql_real_escape_string(PlayerInfo[extraid][pPrisonReason], szPrisonReason, g_MySQLConnections[0]);
  1350.  
  1351. mysql_real_escape_string(PlayerInfo[extraid][pContractBy], szContractBy, g_MySQLConnections[0]);
  1352. mysql_real_escape_string(PlayerInfo[extraid][pContractDetail], szContractDetail, g_MySQLConnections[0]);
  1353.  
  1354. format(szQuery, sizeof(szQuery), "UPDATE players SET TicketTime = %d, HeadValue = %d, ContractBy = '%s', ContractDetail = '%s', Bombs = %d, CHits = %d, FHits = %d, PrisonedBy = '%s', PrisonReason = '%s', AcceptReport = %d, TrashReport = %d, Accent = %d, \
  1355. NewMuted = %d, NewMutedTotal = %d, AdMuted = %d, AdMutedTotal = %d, ReportMuted = %d, ReportMutedTotal = %d, ReportMutedTime = %d, Speedo = %d, GCMuted = %d, GCMutedTime = %d, CallsAccepted = %d, PatientsDelivered = %d WHERE ID = %d",
  1356. PlayerInfo[extraid][pTicketTime], PlayerInfo[extraid][pHeadValue], szContractBy, szContractDetail, PlayerInfo[extraid][pBombs], PlayerInfo[extraid][pCHits], PlayerInfo[extraid][pFHits], szPrisonedBy, szPrisonReason,
  1357. PlayerInfo[extraid][pAcceptReport], PlayerInfo[extraid][pTrashReport], PlayerInfo[extraid][pAccent], PlayerInfo[extraid][pNMute], PlayerInfo[extraid][pNMuteTotal], PlayerInfo[extraid][pADMute], PlayerInfo[extraid][pADMuteTotal], PlayerInfo[extraid][pRMuted], PlayerInfo[extraid][pRMutedTotal],
  1358. PlayerInfo[extraid][pRMutedTime], PlayerInfo[extraid][pSpeedo], PlayerInfo[extraid][pGCMuted], PlayerInfo[extraid][pGCMutedTime], PlayerInfo[extraid][pCallsAccepted], PlayerInfo[extraid][pPatientsDelivered], PlayerInfo[extraid][pID]);
  1359.  
  1360. mysql_query(szQuery, THREAD_SAVE_ACCOUNT_CHAIN_5, extraid, g_MySQLConnections[0]);
  1361. }
  1362. case THREAD_SAVE_ACCOUNT_CHAIN_5: {
  1363. // Escape more strings...
  1364. new
  1365. szMarriedTo[MAX_PLAYER_NAME],
  1366. szFlag[128],
  1367. szReferredBy[MAX_PLAYER_NAME];
  1368.  
  1369. mysql_real_escape_string(PlayerInfo[extraid][pMarriedTo], szMarriedTo, g_MySQLConnections[0]);
  1370. mysql_real_escape_string(PlayerInfo[extraid][pFlag], szFlag, g_MySQLConnections[0]);
  1371. mysql_real_escape_string(PlayerInfo[extraid][pReferredBy], szReferredBy, g_MySQLConnections[0]);
  1372.  
  1373. format(szQuery, sizeof(szQuery), "UPDATE players SET SMSLog = %d, TriageTime = %d, Married = %d, MarriedTo = '%s', Flag = '%s', ReferredBy = '%s', RefTokens = %d, RefTokensOffline = %d, Helper = %d, GangMod = %d, LiveBanned = %d WHERE ID = %d",
  1374. PlayerInfo[extraid][pSmslog], PlayerInfo[extraid][pTriageTime], PlayerInfo[extraid][pMarried], szMarriedTo, szFlag, szReferredBy, PlayerInfo[extraid][pRefTokens], PlayerInfo[extraid][pRefTokensOffline], PlayerInfo[extraid][pHelper],
  1375. PlayerInfo[extraid][pGangMod], PlayerInfo[extraid][pLiveBanned], PlayerInfo[extraid][pID]);
  1376.  
  1377. mysql_query(szQuery, THREAD_SAVING_FINISHED, extraid, g_MySQLConnections[0]);
  1378. }
  1379. case THREAD_SAVING_FINISHED: {
  1380. if(GetPVarInt(extraid, "attemptLoginAfter") == 1) { // Log the player back in if we need to (new registrations) and avoid saving things we know don't exist yet (i.e. toys)
  1381. ResetPlayerVariables(extraid);
  1382. AttemptPlayerLogin(extraid, PlayerInfo[extraid][pKey]);
  1383. DeletePVar(extraid, "attemptLoginAfter");
  1384. } else {
  1385.  
  1386. // Save player toys
  1387. for(new v = 0; v < MAX_PLAYERTOYS; v++) {
  1388. if(PlayerToyInfo[extraid][v][ptRealID] >= 1) { // Check to ensure the toy has a real ID, in MySQL (if inserted it'll have a "real ID").
  1389. format(szQuery, sizeof(szQuery), "UPDATE toys SET ModelID = %d, Bone = %d, PosX = '%f', PosY = '%f', PosZ = '%f', RotX = '%f', RotY = '%f', RotZ = '%f', ScaX = '%f', ScaY = '%f', ScaZ = '%f' WHERE Owner = %d AND ID = %d",
  1390. PlayerToyInfo[extraid][v][ptModelID], PlayerToyInfo[extraid][v][ptBone], PlayerToyInfo[extraid][v][ptPosX], PlayerToyInfo[extraid][v][ptPosY], PlayerToyInfo[extraid][v][ptPosZ], PlayerToyInfo[extraid][v][ptRotX], PlayerToyInfo[extraid][v][ptRotY], PlayerToyInfo[extraid][v][ptRotZ],
  1391. PlayerToyInfo[extraid][v][ptScaleX], PlayerToyInfo[extraid][v][ptScaleY], PlayerToyInfo[extraid][v][ptScaleZ], PlayerInfo[extraid][pID], PlayerToyInfo[extraid][v][ptRealID]);
  1392.  
  1393. mysql_query(szQuery, THREAD_NO_RESULT, 0, g_MySQLConnections[0]);
  1394. }
  1395. }
  1396.  
  1397. // Save player vehicles
  1398. for(new v = 0; v < MAX_PLAYERVEHICLES; v++) {
  1399. if(PlayerVehicleInfo[extraid][v][pvRealID] >= 1) { // Check to ensure the vehicle has a real ID, in MySQL (if inserted, it'll have a "real ID").
  1400. format(szQuery, sizeof(szQuery), "UPDATE playervehicles SET PosX = '%f', PosY = '%f', PosZ = '%f', PosAngle = '%f', ModelID = %d, LockType = %d, Locked = %d, PaintJob = %d, Color1 = %d, Color2 = %d, \
  1401. Price = %d, Ticket = %d, Weapon0 = %d, Weapon1 = %d, Weapon2 = %d, WepUpgrade = %d, Impound = %d, Spawned = %d, Disabled = %d, NumPlate = '%s', Mod0 = %d, Mod1 = %d, Mod2 = %d,",
  1402. PlayerVehicleInfo[extraid][v][pvPosX], PlayerVehicleInfo[extraid][v][pvPosY], PlayerVehicleInfo[extraid][v][pvPosZ], PlayerVehicleInfo[extraid][v][pvPosAngle], PlayerVehicleInfo[extraid][v][pvModelId], PlayerVehicleInfo[extraid][v][pvLock], PlayerVehicleInfo[extraid][v][pvLocked], PlayerVehicleInfo[extraid][v][pvPaintJob],
  1403. PlayerVehicleInfo[extraid][v][pvColor1], PlayerVehicleInfo[extraid][v][pvColor2], PlayerVehicleInfo[extraid][v][pvPrice], PlayerVehicleInfo[extraid][v][pvTicket], PlayerVehicleInfo[extraid][v][pvWeapons][0], PlayerVehicleInfo[extraid][v][pvWeapons][1], PlayerVehicleInfo[extraid][v][pvWeapons][2],
  1404. PlayerVehicleInfo[extraid][v][pvWepUpgrade], PlayerVehicleInfo[extraid][v][pvImpounded], PlayerVehicleInfo[extraid][v][pvSpawned], PlayerVehicleInfo[extraid][v][pvDisabled], PlayerVehicleInfo[extraid][v][pvNumberPlate], PlayerVehicleInfo[extraid][v][pvMods][0], PlayerVehicleInfo[extraid][v][pvMods][1], PlayerVehicleInfo[extraid][v][pvMods][2]);
  1405.  
  1406. // Concencating the string seems like the most appropriate method for this type... Don't wanna send more than 1 query per player vehicle.
  1407. format(szQuery, sizeof(szQuery), "%s Mod3 = %d, Mod4 = %d, Mod5 = %d, Mod6 = %d, Mod7 = %d, Mod8 = %d, Mod9 = %d, Mod10 = %d, Mod11 = %d, Mod12 = %d, Mod13 = %d, Mod14 = %d WHERE Owner = %d AND ID = %d", szQuery, PlayerVehicleInfo[extraid][v][pvMods][3], PlayerVehicleInfo[extraid][v][pvMods][4], PlayerVehicleInfo[extraid][v][pvMods][5],
  1408. PlayerVehicleInfo[extraid][v][pvMods][6], PlayerVehicleInfo[extraid][v][pvMods][7], PlayerVehicleInfo[extraid][v][pvMods][8], PlayerVehicleInfo[extraid][v][pvMods][9], PlayerVehicleInfo[extraid][v][pvMods][10], PlayerVehicleInfo[extraid][v][pvMods][11], PlayerVehicleInfo[extraid][v][pvMods][12],
  1409. PlayerVehicleInfo[extraid][v][pvMods][13], PlayerVehicleInfo[extraid][v][pvMods][14], PlayerInfo[extraid][pID], PlayerVehicleInfo[extraid][v][pvRealID]);
  1410.  
  1411. // Submit the huge query...
  1412. mysql_query(szQuery, THREAD_NO_RESULT, 0, g_MySQLConnections[0]);
  1413. }
  1414. }
  1415. }
  1416. }
  1417. case THREAD_REGISTER_ACCOUNT: {
  1418. ResetPlayerVariables(extraid);
  1419.  
  1420. gPlayerLogged[extraid] = 1;
  1421. PlayerInfo[extraid][pID] = mysql_insert_id(g_MySQLConnections[0]);
  1422. PlayerInfo[extraid][pReg] = 1;
  1423. GetPVarString(extraid, "password", PlayerInfo[extraid][pKey], 128);
  1424. DeletePVar(extraid, "password");
  1425.  
  1426. SetPVarInt(extraid, "attemptLoginAfter", 1);
  1427. SaveAccount(extraid);
  1428.  
  1429. TotalRegister++;
  1430. }
  1431. case THREAD_LOGIN_ATTEMPT: {
  1432. mysql_store_result(g_MySQLConnections[0]);
  1433.  
  1434. if(IsPlayerConnected(extraid)) {
  1435. new
  1436. szReturn[128],
  1437. string[128];
  1438.  
  1439. if(mysql_num_rows(g_MySQLConnections[0]) == 0) { // No rows exist with the specified criteria, so, wrong password!
  1440. mysql_free_result(g_MySQLConnections[0]);
  1441. ShowMainMenuDialog(extraid, 3);
  1442.  
  1443. gPlayerLogTries[extraid]++;
  1444. } else {
  1445. mysql_retrieve_row();
  1446.  
  1447. // Decided against using sscanf as I'd have to create a variable the size of mars. Old school method it is...
  1448. mysql_fetch_field_row(szReturn, "ID", g_MySQLConnections[0]);
  1449. PlayerInfo[extraid][pID] = strval(szReturn);
  1450.  
  1451. mysql_fetch_field_row(PlayerInfo[extraid][pKey], "Password", g_MySQLConnections[0]);
  1452.  
  1453. mysql_fetch_field_row(szReturn, "Level", g_MySQLConnections[0]);
  1454. PlayerInfo[extraid][pLevel] = strval(szReturn);
  1455.  
  1456. mysql_fetch_field_row(szReturn, "AdminLevel", g_MySQLConnections[0]);
  1457. PlayerInfo[extraid][pAdmin] = strval(szReturn);
  1458.  
  1459. mysql_fetch_field_row(PlayerInfo[extraid][pAdminName], "AdminName", g_MySQLConnections[0]);
  1460.  
  1461. mysql_fetch_field_row(szReturn, "BanAppealer", g_MySQLConnections[0]);
  1462. PlayerInfo[extraid][pBanAppealer] = strval(szReturn);
  1463.  
  1464. mysql_fetch_field_row(szReturn, "Donator", g_MySQLConnections[0]);
  1465. PlayerInfo[extraid][pDonator] = strval(szReturn);
  1466.  
  1467. mysql_fetch_field_row(szReturn, "Banned", g_MySQLConnections[0]);
  1468. PlayerInfo[extraid][pBanned] = strval(szReturn);
  1469.  
  1470. mysql_fetch_field_row(szReturn, "Permabanned", g_MySQLConnections[0]);
  1471. PlayerInfo[extraid][pPermaBanned] = strval(szReturn);
  1472.  
  1473. mysql_fetch_field_row(szReturn, "Disabled", g_MySQLConnections[0]);
  1474. PlayerInfo[extraid][pDisabled] = strval(szReturn);
  1475.  
  1476. mysql_fetch_field_row(PlayerInfo[extraid][pIP], "LastIP", g_MySQLConnections[0]);
  1477.  
  1478. mysql_fetch_field_row(szReturn, "Registered", g_MySQLConnections[0]);
  1479. PlayerInfo[extraid][pReg] = strval(szReturn);
  1480.  
  1481. mysql_fetch_field_row(szReturn, "Tutorial", g_MySQLConnections[0]);
  1482. PlayerInfo[extraid][pTut] = strval(szReturn);
  1483.  
  1484. mysql_fetch_field_row(szReturn, "Sex", g_MySQLConnections[0]);
  1485. PlayerInfo[extraid][pSex] = strval(szReturn);
  1486.  
  1487. mysql_fetch_field_row(szReturn, "Age", g_MySQLConnections[0]);
  1488. PlayerInfo[extraid][pAge] = strval(szReturn);
  1489.  
  1490. mysql_fetch_field_row(szReturn, "Skin", g_MySQLConnections[0]);
  1491. PlayerInfo[extraid][pSkin] = strval(szReturn);
  1492.  
  1493. mysql_fetch_field_row(szReturn, "PosX", g_MySQLConnections[0]);
  1494. PlayerInfo[extraid][pPos_x] = floatstr(szReturn);
  1495. SetPVarFloat(extraid, "realX", floatstr(szReturn));
  1496.  
  1497. mysql_fetch_field_row(szReturn, "PosY", g_MySQLConnections[0]);
  1498. PlayerInfo[extraid][pPos_y] = floatstr(szReturn);
  1499. SetPVarFloat(extraid, "realY", floatstr(szReturn));
  1500.  
  1501. mysql_fetch_field_row(szReturn, "PosZ", g_MySQLConnections[0]);
  1502. PlayerInfo[extraid][pPos_z] = floatstr(szReturn);
  1503. SetPVarFloat(extraid, "realZ", floatstr(szReturn));
  1504.  
  1505. mysql_fetch_field_row(szReturn, "PosR", g_MySQLConnections[0]);
  1506. PlayerInfo[extraid][pPos_r] = floatstr(szReturn);
  1507.  
  1508. mysql_fetch_field_row(szReturn, "ConnectTime", g_MySQLConnections[0]);
  1509. PlayerInfo[extraid][pConnectTime] = strval(szReturn);
  1510.  
  1511. mysql_fetch_field_row(szReturn, "Respect", g_MySQLConnections[0]);
  1512. PlayerInfo[extraid][pRespect] = strval(szReturn);
  1513.  
  1514. mysql_fetch_field_row(szReturn, "PhoneNumber", g_MySQLConnections[0]);
  1515. PlayerInfo[extraid][pNumber] = strval(szReturn);
  1516.  
  1517. mysql_fetch_field_row(szReturn, "Warnings", g_MySQLConnections[0]);
  1518. PlayerInfo[extraid][pWarns] = strval(szReturn);
  1519.  
  1520. mysql_fetch_field_row(szReturn, "Gang", g_MySQLConnections[0]);
  1521. PlayerInfo[extraid][pGang] = strval(szReturn);
  1522.  
  1523. mysql_fetch_field_row(szReturn, "Faction", g_MySQLConnections[0]);
  1524. PlayerInfo[extraid][pFaction] = strval(szReturn);
  1525.  
  1526. mysql_fetch_field_row(szReturn, "Leader", g_MySQLConnections[0]);
  1527. PlayerInfo[extraid][pLeader] = strval(szReturn);
  1528.  
  1529. mysql_fetch_field_row(szReturn, "Rank", g_MySQLConnections[0]);
  1530. PlayerInfo[extraid][pRank] = strval(szReturn);
  1531.  
  1532. mysql_fetch_field_row(szReturn, "Job", g_MySQLConnections[0]);
  1533. PlayerInfo[extraid][pJob] = strval(szReturn);
  1534.  
  1535. mysql_fetch_field_row(szReturn, "Job2", g_MySQLConnections[0]);
  1536. PlayerInfo[extraid][pJob2] = strval(szReturn);
  1537.  
  1538. mysql_fetch_field_row(szReturn, "UpgradePoints", g_MySQLConnections[0]);
  1539. PlayerInfo[extraid][gPupgrade] = strval(szReturn);
  1540.  
  1541. mysql_fetch_field_row(szReturn, "SpawnArmor", g_MySQLConnections[0]);
  1542. PlayerInfo[extraid][pSarmor] = strval(szReturn);
  1543.  
  1544. mysql_fetch_field_row(szReturn, "Cash", g_MySQLConnections[0]);
  1545. PlayerInfo[extraid][pCash] = strval(szReturn);
  1546.  
  1547. mysql_fetch_field_row(szReturn, "Bank", g_MySQLConnections[0]);
  1548. PlayerInfo[extraid][pBank] = strval(szReturn);
  1549.  
  1550. mysql_fetch_field_row(szReturn, "Insurance", g_MySQLConnections[0]);
  1551. PlayerInfo[extraid][pInsurance] = strval(szReturn);
  1552.  
  1553. mysql_fetch_field_row(szReturn, "Smslog", g_MySQLConnections[0]);
  1554. PlayerInfo[extraid][pSmslog] = strval(szReturn);
  1555.  
  1556. mysql_fetch_field_row(szReturn, "Crimes", g_MySQLConnections[0]);
  1557. PlayerInfo[extraid][pCrimes] = strval(szReturn);
  1558.  
  1559. mysql_fetch_field_row(szReturn, "Arrested", g_MySQLConnections[0]);
  1560. PlayerInfo[extraid][pArrested] = strval(szReturn);
  1561.  
  1562. mysql_fetch_field_row(szReturn, "WantedLevel", g_MySQLConnections[0]);
  1563. PlayerInfo[extraid][pWantedLevel] = strval(szReturn);
  1564.  
  1565. mysql_fetch_field_row(szReturn, "Health", g_MySQLConnections[0]);
  1566. PlayerInfo[extraid][pHealth] = floatstr(szReturn);
  1567.  
  1568. mysql_fetch_field_row(szReturn, "Armor", g_MySQLConnections[0]);
  1569. PlayerInfo[extraid][pArmor] = floatstr(szReturn);
  1570.  
  1571. mysql_fetch_field_row(szReturn, "Pot", g_MySQLConnections[0]);
  1572. PlayerInfo[extraid][pPot] = strval(szReturn);
  1573.  
  1574. mysql_fetch_field_row(szReturn, "Crack", g_MySQLConnections[0]);
  1575. PlayerInfo[extraid][pCrack] = strval(szReturn);
  1576.  
  1577. mysql_fetch_field_row(szReturn, "Radio", g_MySQLConnections[0]);
  1578. PlayerInfo[extraid][pRadio] = strval(szReturn);
  1579.  
  1580. mysql_fetch_field_row(szReturn, "RadioFreq", g_MySQLConnections[0]);
  1581. PlayerInfo[extraid][pRadioFreq] = strval(szReturn);
  1582.  
  1583. mysql_fetch_field_row(szReturn, "Phonebook", g_MySQLConnections[0]);
  1584. PlayerInfo[extraid][pPhoneBook] = strval(szReturn);
  1585.  
  1586. mysql_fetch_field_row(szReturn, "Dice", g_MySQLConnections[0]);
  1587. PlayerInfo[extraid][pDice] = strval(szReturn);
  1588.  
  1589. mysql_fetch_field_row(szReturn, "CDPlayer", g_MySQLConnections[0]);
  1590. PlayerInfo[extraid][pCDPlayer] = strval(szReturn);
  1591.  
  1592. mysql_fetch_field_row(szReturn, "Materials", g_MySQLConnections[0]);
  1593. PlayerInfo[extraid][pMats] = strval(szReturn);
  1594.  
  1595. mysql_fetch_field_row(szReturn, "Rope", g_MySQLConnections[0]);
  1596. PlayerInfo[extraid][pRope] = strval(szReturn);
  1597.  
  1598. mysql_fetch_field_row(szReturn, "Cigars", g_MySQLConnections[0]);
  1599. PlayerInfo[extraid][pCigar] = strval(szReturn);
  1600.  
  1601. mysql_fetch_field_row(szReturn, "Sprunk", g_MySQLConnections[0]);
  1602. PlayerInfo[extraid][pSprunk] = strval(szReturn);
  1603.  
  1604. mysql_fetch_field_row(szReturn, "Spraycan", g_MySQLConnections[0]);
  1605. PlayerInfo[extraid][pSpraycan] = strval(szReturn);
  1606.  
  1607. mysql_fetch_field_row(szReturn, "House", g_MySQLConnections[0]);
  1608. PlayerInfo[extraid][pHouse] = strval(szReturn);
  1609.  
  1610. mysql_fetch_field_row(szReturn, "House2", g_MySQLConnections[0]);
  1611. PlayerInfo[extraid][pHouse2] = strval(szReturn);
  1612.  
  1613. mysql_fetch_field_row(szReturn, "Renting", g_MySQLConnections[0]);
  1614. PlayerInfo[extraid][pRenting] = strval(szReturn);
  1615.  
  1616. mysql_fetch_field_row(szReturn, "Interior", g_MySQLConnections[0]);
  1617. PlayerInfo[extraid][pInt] = strval(szReturn);
  1618.  
  1619. mysql_fetch_field_row(szReturn, "VirtualWorld", g_MySQLConnections[0]);
  1620. PlayerInfo[extraid][pVW] = strval(szReturn);
  1621.  
  1622. mysql_fetch_field_row(szReturn, "Jailed", g_MySQLConnections[0]);
  1623. PlayerInfo[extraid][pJailed] = strval(szReturn);
  1624.  
  1625. mysql_fetch_field_row(szReturn, "JailTime", g_MySQLConnections[0]);
  1626. PlayerInfo[extraid][pJailTime] = strval(szReturn);
  1627.  
  1628. mysql_fetch_field_row(szReturn, "Gun0", g_MySQLConnections[0]);
  1629. PlayerInfo[extraid][pGuns][0] = strval(szReturn);
  1630.  
  1631. mysql_fetch_field_row(szReturn, "Gun1", g_MySQLConnections[0]);
  1632. PlayerInfo[extraid][pGuns][1] = strval(szReturn);
  1633.  
  1634. mysql_fetch_field_row(szReturn, "Gun2", g_MySQLConnections[0]);
  1635. PlayerInfo[extraid][pGuns][2] = strval(szReturn);
  1636.  
  1637. mysql_fetch_field_row(szReturn, "Gun3", g_MySQLConnections[0]);
  1638. PlayerInfo[extraid][pGuns][3] = strval(szReturn);
  1639.  
  1640. mysql_fetch_field_row(szReturn, "Gun4", g_MySQLConnections[0]);
  1641. PlayerInfo[extraid][pGuns][4] = strval(szReturn);
  1642.  
  1643. mysql_fetch_field_row(szReturn, "Gun5", g_MySQLConnections[0]);
  1644. PlayerInfo[extraid][pGuns][5] = strval(szReturn);
  1645.  
  1646. mysql_fetch_field_row(szReturn, "Gun6", g_MySQLConnections[0]);
  1647. PlayerInfo[extraid][pGuns][6] = strval(szReturn);
  1648.  
  1649. mysql_fetch_field_row(szReturn, "Gun7", g_MySQLConnections[0]);
  1650. PlayerInfo[extraid][pGuns][7] = strval(szReturn);
  1651.  
  1652. mysql_fetch_field_row(szReturn, "Gun8", g_MySQLConnections[0]);
  1653. PlayerInfo[extraid][pGuns][8] = strval(szReturn);
  1654.  
  1655. mysql_fetch_field_row(szReturn, "Gun9", g_MySQLConnections[0]);
  1656. PlayerInfo[extraid][pGuns][9] = strval(szReturn);
  1657.  
  1658. mysql_fetch_field_row(szReturn, "Gun10", g_MySQLConnections[0]);
  1659. PlayerInfo[extraid][pGuns][10] = strval(szReturn);
  1660.  
  1661. mysql_fetch_field_row(szReturn, "Gun11", g_MySQLConnections[0]);
  1662. PlayerInfo[extraid][pGuns][11] = strval(szReturn);
  1663.  
  1664. mysql_fetch_field_row(szReturn, "Paycheck", g_MySQLConnections[0]);
  1665. PlayerInfo[extraid][pPayCheck] = strval(szReturn);
  1666.  
  1667. mysql_fetch_field_row(szReturn, "PayReady", g_MySQLConnections[0]);
  1668. PlayerInfo[extraid][pPayReady] = strval(szReturn);
  1669.  
  1670. mysql_fetch_field_row(szReturn, "Hospital", g_MySQLConnections[0]);
  1671. PlayerInfo[extraid][pHospital] = strval(szReturn);
  1672.  
  1673. mysql_fetch_field_row(szReturn, "DetSkill", g_MySQLConnections[0]);
  1674. PlayerInfo[extraid][pDetSkill] = strval(szReturn);
  1675.  
  1676. mysql_fetch_field_row(szReturn, "LawSkill", g_MySQLConnections[0]);
  1677. PlayerInfo[extraid][pLawSkill] = strval(szReturn);
  1678.  
  1679. mysql_fetch_field_row(szReturn, "SexSkill", g_MySQLConnections[0]);
  1680. PlayerInfo[extraid][pSexSkill] = strval(szReturn);
  1681.  
  1682. mysql_fetch_field_row(szReturn, "DrugsSkill", g_MySQLConnections[0]);
  1683. PlayerInfo[extraid][pDrugsSkill] = strval(szReturn);
  1684.  
  1685. mysql_fetch_field_row(szReturn, "SmugglerSkill", g_MySQLConnections[0]);
  1686. PlayerInfo[extraid][pSmugSkill] = strval(szReturn);
  1687.  
  1688. mysql_fetch_field_row(szReturn, "ArmsSkill", g_MySQLConnections[0]);
  1689. PlayerInfo[extraid][pArmsSkill] = strval(szReturn);
  1690.  
  1691. mysql_fetch_field_row(szReturn, "MechSkill", g_MySQLConnections[0]);
  1692. PlayerInfo[extraid][pMechSkill] = strval(szReturn);
  1693.  
  1694. mysql_fetch_field_row(szReturn, "FishSkill", g_MySQLConnections[0]);
  1695. PlayerInfo[extraid][pFishSkill] = strval(szReturn);
  1696.  
  1697. mysql_fetch_field_row(szReturn, "BoxSkill", g_MySQLConnections[0]);
  1698. PlayerInfo[extraid][pBoxSkill] = strval(szReturn);
  1699.  
  1700. mysql_fetch_field_row(szReturn, "TruckSkill", g_MySQLConnections[0]);
  1701. PlayerInfo[extraid][pTruckSkill] = strval(szReturn);
  1702.  
  1703. mysql_fetch_field_row(szReturn, "CarSkill", g_MySQLConnections[0]);
  1704. PlayerInfo[extraid][pCarSkill] = strval(szReturn);
  1705.  
  1706. mysql_fetch_field_row(szReturn, "LawyerTime", g_MySQLConnections[0]);
  1707. PlayerInfo[extraid][pLawyerTime] = strval(szReturn);
  1708.  
  1709. mysql_fetch_field_row(szReturn, "LawyerFreeTime", g_MySQLConnections[0]);
  1710. PlayerInfo[extraid][pLawyerFreeTime] = strval(szReturn);
  1711.  
  1712. mysql_fetch_field_row(szReturn, "DrugsTime", g_MySQLConnections[0]);
  1713. PlayerInfo[extraid][pDrugsTime] = strval(szReturn);
  1714.  
  1715. mysql_fetch_field_row(szReturn, "MechTime", g_MySQLConnections[0]);
  1716. PlayerInfo[extraid][pMechTime] = strval(szReturn);
  1717.  
  1718. mysql_fetch_field_row(szReturn, "SexTime", g_MySQLConnections[0]);
  1719. PlayerInfo[extraid][pSexTime] = strval(szReturn);
  1720.  
  1721. mysql_fetch_field_row(szReturn, "CarTime", g_MySQLConnections[0]);
  1722. PlayerInfo[extraid][pCarTime] = strval(szReturn);
  1723.  
  1724. mysql_fetch_field_row(szReturn, "Fishes", g_MySQLConnections[0]);
  1725. PlayerInfo[extraid][pFishes] = strval(szReturn);
  1726.  
  1727. mysql_fetch_field_row(szReturn, "BiggestFish", g_MySQLConnections[0]);
  1728. PlayerInfo[extraid][pBiggestFish] = strval(szReturn);
  1729.  
  1730. mysql_fetch_field_row(szReturn, "pWEXists", g_MySQLConnections[0]);
  1731. PlayerInfo[extraid][pWeedObject] = strval(szReturn);
  1732.  
  1733. mysql_fetch_field_row(szReturn, "pWX", g_MySQLConnections[0]);
  1734. PlayerInfo[extraid][pWeedPos][0] = floatstr(szReturn);
  1735.  
  1736. mysql_fetch_field_row(szReturn, "pWY", g_MySQLConnections[0]);
  1737. PlayerInfo[extraid][pWeedPos][1] = floatstr(szReturn);
  1738.  
  1739. mysql_fetch_field_row(szReturn, "pWZ", g_MySQLConnections[0]);
  1740. PlayerInfo[extraid][pWeedPos][2] = floatstr(szReturn);
  1741.  
  1742. mysql_fetch_field_row(szReturn, "pWVW", g_MySQLConnections[0]);
  1743. PlayerInfo[extraid][pWeedVW] = strval(szReturn);
  1744.  
  1745. mysql_fetch_field_row(szReturn, "pWInt", g_MySQLConnections[0]);
  1746. PlayerInfo[extraid][pWeedInt] = strval(szReturn);
  1747.  
  1748. mysql_fetch_field_row(szReturn, "pWValue", g_MySQLConnections[0]);
  1749. PlayerInfo[extraid][pWeedGrowth] = strval(szReturn);
  1750.  
  1751. mysql_fetch_field_row(szReturn, "pWSeeds", g_MySQLConnections[0]);
  1752. PlayerInfo[extraid][pWSeeds] = strval(szReturn);
  1753.  
  1754. mysql_fetch_field_row(szReturn, "Wins", g_MySQLConnections[0]);
  1755. PlayerInfo[extraid][pWins] = strval(szReturn);
  1756.  
  1757. mysql_fetch_field_row(szReturn, "Loses", g_MySQLConnections[0]);
  1758. PlayerInfo[extraid][pLoses] = strval(szReturn);
  1759.  
  1760. mysql_fetch_field_row(szReturn, "FightingStyle", g_MySQLConnections[0]);
  1761. PlayerInfo[extraid][pFightStyle] = strval(szReturn);
  1762.  
  1763. mysql_fetch_field_row(szReturn, "Screwdriver", g_MySQLConnections[0]);
  1764. PlayerInfo[extraid][pScrewdriver] = strval(szReturn);
  1765.  
  1766. mysql_fetch_field_row(szReturn, "Wristwatch", g_MySQLConnections[0]);
  1767. PlayerInfo[extraid][pWristwatch] = strval(szReturn);
  1768.  
  1769. mysql_fetch_field_row(szReturn, "Tire", g_MySQLConnections[0]);
  1770. PlayerInfo[extraid][pTire] = strval(szReturn);
  1771.  
  1772. mysql_fetch_field_row(szReturn, "Firstaid", g_MySQLConnections[0]);
  1773. PlayerInfo[extraid][pFirstaid] = strval(szReturn);
  1774.  
  1775. mysql_fetch_field_row(szReturn, "Rccam", g_MySQLConnections[0]);
  1776. PlayerInfo[extraid][pRccam] = strval(szReturn);
  1777.  
  1778. mysql_fetch_field_row(szReturn, "Receiver", g_MySQLConnections[0]);
  1779. PlayerInfo[extraid][pReceiver] = strval(szReturn);
  1780.  
  1781. mysql_fetch_field_row(szReturn, "GPS", g_MySQLConnections[0]);
  1782. PlayerInfo[extraid][pGPS] = strval(szReturn);
  1783.  
  1784. mysql_fetch_field_row(szReturn, "Sweep", g_MySQLConnections[0]);
  1785. PlayerInfo[extraid][pSweep] = strval(szReturn);
  1786.  
  1787. mysql_fetch_field_row(szReturn, "SweepLeft", g_MySQLConnections[0]);
  1788. PlayerInfo[extraid][pSweepLeft] = strval(szReturn);
  1789.  
  1790. mysql_fetch_field_row(szReturn, "Bugged", g_MySQLConnections[0]);
  1791. PlayerInfo[extraid][pBugged] = strval(szReturn);
  1792.  
  1793. mysql_fetch_field_row(szReturn, "CarLic", g_MySQLConnections[0]);
  1794. PlayerInfo[extraid][pCarLic] = strval(szReturn);
  1795.  
  1796. mysql_fetch_field_row(szReturn, "FlyLic", g_MySQLConnections[0]);
  1797. PlayerInfo[extraid][pFlyLic] = strval(szReturn);
  1798.  
  1799. mysql_fetch_field_row(szReturn, "BoatLic", g_MySQLConnections[0]);
  1800. PlayerInfo[extraid][pBoatLic] = strval(szReturn);
  1801.  
  1802. mysql_fetch_field_row(szReturn, "FishLic", g_MySQLConnections[0]);
  1803. PlayerInfo[extraid][pFishLic] = strval(szReturn);
  1804.  
  1805. mysql_fetch_field_row(szReturn, "GunLic", g_MySQLConnections[0]);
  1806. PlayerInfo[extraid][pGunLic] = strval(szReturn);
  1807.  
  1808. mysql_fetch_field_row(szReturn, "Division", g_MySQLConnections[0]);
  1809. PlayerInfo[extraid][pDivision] = strval(szReturn);
  1810.  
  1811. mysql_fetch_field_row(szReturn, "TicketTime", g_MySQLConnections[0]);
  1812. PlayerInfo[extraid][pTicketTime] = strval(szReturn);
  1813.  
  1814. mysql_fetch_field_row(szReturn, "HeadValue", g_MySQLConnections[0]);
  1815. PlayerInfo[extraid][pHeadValue] = strval(szReturn);
  1816.  
  1817. mysql_fetch_field_row(PlayerInfo[extraid][pContractBy], "ContractBy", g_MySQLConnections[0]);
  1818.  
  1819. mysql_fetch_field_row(PlayerInfo[extraid][pContractDetail], "ContractBy", g_MySQLConnections[0]);
  1820.  
  1821. mysql_fetch_field_row(szReturn, "Bombs", g_MySQLConnections[0]);
  1822. PlayerInfo[extraid][pBombs] = strval(szReturn);
  1823.  
  1824. mysql_fetch_field_row(szReturn, "CHits", g_MySQLConnections[0]);
  1825. PlayerInfo[extraid][pCHits] = strval(szReturn);
  1826.  
  1827. mysql_fetch_field_row(szReturn, "FHits", g_MySQLConnections[0]);
  1828. PlayerInfo[extraid][pFHits] = strval(szReturn);
  1829.  
  1830. mysql_fetch_field_row(PlayerInfo[extraid][pPrisonedBy], "PrisonedBy", g_MySQLConnections[0]);
  1831.  
  1832. mysql_fetch_field_row(PlayerInfo[extraid][pPrisonReason], "PrisonReason", g_MySQLConnections[0]);
  1833.  
  1834. mysql_fetch_field_row(szReturn, "AcceptReport", g_MySQLConnections[0]);
  1835. PlayerInfo[extraid][pAcceptReport] = strval(szReturn);
  1836.  
  1837. mysql_fetch_field_row(szReturn, "TrashReport", g_MySQLConnections[0]);
  1838. PlayerInfo[extraid][pTrashReport] = strval(szReturn);
  1839.  
  1840. mysql_fetch_field_row(szReturn, "Accent", g_MySQLConnections[0]);
  1841. PlayerInfo[extraid][pAccent] = strval(szReturn);
  1842.  
  1843. mysql_fetch_field_row(szReturn, "NewMuted", g_MySQLConnections[0]);
  1844. PlayerInfo[extraid][pNMute] = strval(szReturn);
  1845.  
  1846. mysql_fetch_field_row(szReturn, "NewMutedTotal", g_MySQLConnections[0]);
  1847. PlayerInfo[extraid][pNMuteTotal] = strval(szReturn);
  1848.  
  1849. mysql_fetch_field_row(szReturn, "AdMuted", g_MySQLConnections[0]);
  1850. PlayerInfo[extraid][pADMute] = strval(szReturn);
  1851.  
  1852. mysql_fetch_field_row(szReturn, "AdMutedTotal", g_MySQLConnections[0]);
  1853. PlayerInfo[extraid][pADMuteTotal] = strval(szReturn);
  1854.  
  1855. mysql_fetch_field_row(szReturn, "ReportMuted", g_MySQLConnections[0]);
  1856. PlayerInfo[extraid][pRMuted] = strval(szReturn);
  1857.  
  1858. mysql_fetch_field_row(szReturn, "ReportMutedTotal", g_MySQLConnections[0]);
  1859. PlayerInfo[extraid][pRMutedTotal] = strval(szReturn);
  1860.  
  1861. mysql_fetch_field_row(szReturn, "ReportMutedTime", g_MySQLConnections[0]);
  1862. PlayerInfo[extraid][pRMutedTime] = strval(szReturn);
  1863.  
  1864. mysql_fetch_field_row(szReturn, "Speedo", g_MySQLConnections[0]);
  1865. PlayerInfo[extraid][pSpeedo] = strval(szReturn);
  1866.  
  1867. mysql_fetch_field_row(szReturn, "GCMuted", g_MySQLConnections[0]);
  1868. PlayerInfo[extraid][pGCMuted] = strval(szReturn);
  1869.  
  1870. mysql_fetch_field_row(szReturn, "GCMutedTime", g_MySQLConnections[0]);
  1871. PlayerInfo[extraid][pGCMutedTime] = strval(szReturn);
  1872.  
  1873. mysql_fetch_field_row(szReturn, "CallsAccepted", g_MySQLConnections[0]);
  1874. PlayerInfo[extraid][pCallsAccepted] = strval(szReturn);
  1875.  
  1876. mysql_fetch_field_row(szReturn, "PatientsDelivered", g_MySQLConnections[0]);
  1877. PlayerInfo[extraid][pPatientsDelivered] = strval(szReturn);
  1878.  
  1879. mysql_fetch_field_row(szReturn, "TriageTime", g_MySQLConnections[0]);
  1880. PlayerInfo[extraid][pTriageTime] = strval(szReturn);
  1881.  
  1882. mysql_fetch_field_row(szReturn, "Married", g_MySQLConnections[0]);
  1883. PlayerInfo[extraid][pMarried] = strval(szReturn);
  1884.  
  1885. mysql_fetch_field_row(PlayerInfo[extraid][pMarriedTo], "MarriedTo", g_MySQLConnections[0]);
  1886.  
  1887. mysql_fetch_field_row(szReturn, "OnDuty", g_MySQLConnections[0]);
  1888. PlayerInfo[extraid][pDuty] = strval(szReturn);
  1889.  
  1890. mysql_fetch_field_row(PlayerInfo[extraid][pFlag], "Flag", g_MySQLConnections[0]);
  1891.  
  1892. mysql_fetch_field_row(PlayerInfo[extraid][pReferredBy], "ReferredBy", g_MySQLConnections[0]);
  1893.  
  1894. mysql_fetch_field_row(szReturn, "ReferredBy", g_MySQLConnections[0]);
  1895. PlayerInfo[extraid][pRefTokens] = strval(szReturn);
  1896.  
  1897. mysql_fetch_field_row(szReturn, "RefTokens", g_MySQLConnections[0]);
  1898. PlayerInfo[extraid][pRefTokens] = strval(szReturn);
  1899.  
  1900. mysql_fetch_field_row(szReturn, "RefTokensOffline", g_MySQLConnections[0]);
  1901. PlayerInfo[extraid][pRefTokensOffline] = strval(szReturn);
  1902.  
  1903. mysql_fetch_field_row(szReturn, "Helper", g_MySQLConnections[0]);
  1904. PlayerInfo[extraid][pHelper] = strval(szReturn);
  1905.  
  1906. mysql_fetch_field_row(szReturn, "GangMod", g_MySQLConnections[0]);
  1907. PlayerInfo[extraid][pGangMod] = strval(szReturn);
  1908.  
  1909. mysql_fetch_field_row(szReturn, "LiveBanned", g_MySQLConnections[0]);
  1910. PlayerInfo[extraid][pLiveBanned] = strval(szReturn);
  1911.  
  1912. // Free the result (of the entire player record) when we're done with loading it...
  1913. mysql_free_result(g_MySQLConnections[0]);
  1914.  
  1915. if(PlayerInfo[extraid][pHospital] == 1) {
  1916. PlayerInfo[extraid][pHospital] = 0;
  1917. SetPVarInt(extraid, "MedicBill", 1);
  1918. }
  1919.  
  1920. TotalLogin++;
  1921. GetPlayerIp(extraid, PlayerInfo[extraid][pIP], 16);
  1922. if(PlayerInfo[extraid][pBanned] >= 1 || PlayerInfo[extraid][pPermaBanned] >= 1) {
  1923. format(string, sizeof(string), "WARNING: %s (IP:%s) tried to login whilst banned and has been auto-banned.", GetPlayerNameEx(extraid), PlayerInfo[extraid][pIP]);
  1924. ABroadCast(COLOR_YELLOW, string, 1);
  1925. SendClientMessage(extraid, COLOR_NEWS, "You're banned from Stratum Roleplay.");
  1926. AddBan(PlayerInfo[extraid][pIP]);
  1927. Log("logs/ban.log", string);
  1928. return Kick(extraid);
  1929. }
  1930.  
  1931. if(PlayerInfo[extraid][pSprunk] > 10) {
  1932. format(string, sizeof(string), "You're carrying too much Sprunk. You now have 10 cans, and have been refunded $%d for your loss.", PlayerInfo[extraid][pSprunk] - 10);
  1933. SendClientMessage(extraid, COLOR_GREY, string);
  1934.  
  1935. PlayerInfo[extraid][pCash] += PlayerInfo[extraid][pSprunk] - 10;
  1936. PlayerInfo[extraid][pSprunk] = 10;
  1937. }
  1938.  
  1939. if(PlayerInfo[extraid][pSmslog] >= 1) {
  1940. format(string, sizeof(string), "SMS logs have been removed, you have been refunded %d materials.", PlayerInfo[extraid][pSmslog] * 2000);
  1941. SendClientMessage(extraid, COLOR_GREY, string);
  1942.  
  1943. PlayerInfo[extraid][pMats] += PlayerInfo[extraid][pSmslog] * 2000;
  1944. PlayerInfo[extraid][pSmslog] = 0;
  1945. }
  1946.  
  1947. if(PlayerInfo[extraid][pTut] == 1)
  1948. PlayerPlaySound(extraid,SOUND_OFF,2050.1995, 1344.5500, 13.2378); //Music Off
  1949.  
  1950. SetSpawnInfo(extraid, 0, PlayerInfo[extraid][pSkin], PlayerInfo[extraid][pPos_x], PlayerInfo[extraid][pPos_y], PlayerInfo[extraid][pPos_z], 1.0, -1, -1, -1, -1, -1, -1);
  1951.  
  1952. gPlayerLogged[extraid] = 1;
  1953. SpawnPlayer(extraid);
  1954. SetPlayerScore(extraid, PlayerInfo[extraid][pLevel]);
  1955.  
  1956. if(PlayerInfo[extraid][pTut] == 1) {
  1957. HideMainMenuGUI(extraid);
  1958. InsideTut[extraid] = 0;
  1959. }
  1960.  
  1961. if(PlayerInfo[extraid][pDisabled] != 0) {
  1962. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s has been auto kicked because their account is disabled.", GetPlayerNameEx(extraid));
  1963. ABroadCast(COLOR_YELLOW, string, 4);
  1964. SendClientMessage(extraid, COLOR_NEWS, "This account is disabled. Please contact us via the forum ("WEBSITE").");
  1965. return Kick(extraid);
  1966. }
  1967.  
  1968. if(PlayerInfo[extraid][pAdmin] < 0 || PlayerInfo[extraid][pAdmin] > 6) {
  1969. new name[MAX_PLAYER_NAME];
  1970. GetPlayerName(extraid, name, sizeof(name));
  1971. format(string, sizeof(string), "{AA3333}AdmWarning{FFFF00}: %s attempted to log in with Admin Level %d.", GetPlayerNameEx(extraid), PlayerInfo[extraid][pAdmin]);
  1972. PlayerInfo[extraid][pAdmin] = 0;
  1973. ABroadCast(COLOR_YELLOW, string, 4);
  1974. return Kick(extraid);
  1975. }
  1976.  
  1977. if(PlayerInfo[extraid][pInt] > 0 || PlayerInfo[extraid][pVW] > 0) {
  1978. LoadObjectsForPlayer(extraid);
  1979. }
  1980.  
  1981. SkinDelay(extraid);
  1982. SetPlayerFightingStyle(extraid, PlayerInfo[extraid][pFightStyle]);
  1983. SetPlayerToTeamColor(extraid);
  1984.  
  1985. if(AdminLoggedInBefore[extraid] == 0) {
  1986. if(PlayerInfo[extraid][pTut] == 1) {
  1987. format(string, sizeof(string), "Welcome to Stratum Roleplay, %s.", GetPlayerNameEx(extraid));
  1988. SendClientMessage(extraid, COLOR_NEWS, string);
  1989. }
  1990.  
  1991. if(PlayerInfo[extraid][pAdmin] > 0 && PlayerInfo[extraid][pTut] == 1) {
  1992. format(string, sizeof(string), "You have logged in as Level %d Admin.",PlayerInfo[extraid][pAdmin]);
  1993. SendClientMessage(extraid, COLOR_WHITE,string);
  1994.  
  1995. if(strlen(PlayerInfo[extraid][pAdminName]) > 2 && strlen(PlayerInfo[extraid][pAdminName]) < 20) {
  1996. format(string, sizeof(string), "%s (%s) has logged in as Level %d Admin.", GetPlayerNameEx(extraid), PlayerInfo[extraid][pAdminName], PlayerInfo[extraid][pAdmin]);
  1997. }
  1998. else {
  1999. format(string, sizeof(string), "%s (unset admin name) has logged in as Level %d Admin.", GetPlayerNameEx(extraid), PlayerInfo[extraid][pAdmin]);
  2000. }
  2001.  
  2002. foreach(Player, i) {
  2003. if(PlayerInfo[i][pAdmin] >= 5 && PlayerInfo[i][pAdmin] >= PlayerInfo[extraid][pAdmin] && i != extraid) {
  2004. SendClientMessage(i, COLOR_WHITE, string);
  2005. }
  2006. }
  2007. }
  2008. if(PlayerInfo[extraid][pTut] == 1) {
  2009. format(string, sizeof(string), "~w~Welcome~n~~y~%s", GetPlayerNameEx(extraid));
  2010. GameTextForPlayer(extraid, string, 5000, 1);
  2011.  
  2012. new motdstring[128];
  2013. format(motdstring, sizeof(motdstring), "News: %s", GlobalMOTD);
  2014. SendClientMessage(extraid, COLOR_WHITE, motdstring);
  2015.  
  2016. new amotdstring[128];
  2017. format(amotdstring, sizeof(amotdstring), "Admin News: %s", AdminMOTD);
  2018. if(PlayerInfo[extraid][pAdmin] > 0) SendClientMessage(extraid, COLOR_YELLOW, amotdstring);
  2019. }
  2020. if(PlayerInfo[extraid][pGang] < 255 && PlayerInfo[extraid][pTut] == 1) {
  2021. format(string, sizeof(string), "Family MOTD: %s.", FamilyInfo[PlayerInfo[extraid][pGang]][FamilyMOTD]);
  2022. SendClientMessage(extraid, COLOR_YELLOW, string);
  2023. }
  2024. if(!isnull(PlayerInfo[extraid][pFlag])) {
  2025. format(string, sizeof(string), "%s has an outstanding flag.", GetPlayerNameEx(extraid));
  2026. ABroadCast(COLOR_WHITE, string, 1);
  2027. }
  2028. if(PlayerInfo[extraid][pRefTokensOffline] != 0) {
  2029. format(string, sizeof(string), "You have gained %d referral token(s) while you were offline. Use /refshop to spend them.", PlayerInfo[extraid][pRefTokensOffline]);
  2030. SendClientMessage(extraid, COLOR_YELLOW, string);
  2031. PlayerInfo[extraid][pRefTokens] += PlayerInfo[extraid][pRefTokensOffline];
  2032. PlayerInfo[extraid][pRefTokensOffline] = 0;
  2033. }
  2034. if(PlayerInfo[extraid][pJob2] >= 1 && PlayerInfo[extraid][pDonator] < 2 && PlayerInfo[extraid][pLevel] < 25) {
  2035. PlayerInfo[extraid][pJob2] = 0;
  2036. SendClientMessage(extraid, COLOR_YELLOW, "You have lost your secondary job due to the fact that you no longer have a donator package or are below level 25.");
  2037. }
  2038. }
  2039.  
  2040. /* --------- Load alternative player items (vehicles, toys, etc) --------- */
  2041. LoadPlayerDynamicItems(extraid);
  2042. format(szQuery, sizeof(szQuery), "UPDATE connections SET AccountID = %d WHERE PlayerID = %d", PlayerInfo[extraid][pID], extraid);
  2043. mysql_query(szQuery, THREAD_NO_RESULT, extraid, g_MySQLConnections[0]);
  2044.  
  2045. if(PlayerInfo[extraid][pWeedObject] != 0) {
  2046. PlayerInfo[extraid][pWeedObject] = CreateDynamicObject(3409, PlayerInfo[extraid][pWeedPos][0], PlayerInfo[extraid][pWeedPos][1], PlayerInfo[extraid][pWeedPos][2], 0.0, 0.0, 0.0, PlayerInfo[extraid][pWeedVW], PlayerInfo[extraid][pWeedInt]);
  2047. }
  2048.  
  2049. new
  2050. iCheckOne = INVALID_HOUSE_ID,
  2051. iCheckTwo = INVALID_HOUSE_ID,
  2052. szPlayerName[MAX_PLAYER_NAME];
  2053.  
  2054. GetPlayerName(extraid, szPlayerName, sizeof(szPlayerName));
  2055.  
  2056. for(new i = 0; i < MAX_HOUSES; ++i) if(strcmp(szPlayerName, HouseInfo[i][hOwner], false) == 0) {
  2057. if(iCheckOne != INVALID_HOUSE_ID) iCheckTwo = i;
  2058. else if(iCheckTwo == INVALID_HOUSE_ID) iCheckOne = i;
  2059. else break;
  2060. }
  2061.  
  2062. if(iCheckOne != INVALID_HOUSE_ID)
  2063. PlayerInfo[extraid][pHouse] = iCheckOne;
  2064. else PlayerInfo[extraid][pHouse] = INVALID_HOUSE_ID;
  2065.  
  2066. if(iCheckTwo != INVALID_HOUSE_ID)
  2067. PlayerInfo[extraid][pHouse2] = iCheckTwo;
  2068. else PlayerInfo[extraid][pHouse2] = INVALID_HOUSE_ID;
  2069.  
  2070. if(PlayerInfo[extraid][pRenting] != INVALID_HOUSE_ID && (PlayerInfo[extraid][pHouse] != INVALID_HOUSE_ID || PlayerInfo[extraid][pHouse2] != INVALID_HOUSE_ID)) {
  2071. PlayerInfo[extraid][pRenting] = INVALID_HOUSE_ID;
  2072. }
  2073. }
  2074. } else mysql_free_result(g_MySQLConnections[0]); // The player logged off before we could get their result, so we need to free it.
  2075. }
  2076. }
  2077. return 1;
  2078. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement