Advertisement
Guest User

Untitled

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