Advertisement
Guest User

code

a guest
Apr 15th, 2018
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 386.37 KB | None | 0 0
  1. #if defined _0_A_d_m_i_n_
  2.  
  3. =======================================================================
  4. /* 0Admin - Administration filterscript.
  5. Created over a period of 2 months.
  6. With the most unique features ever. */
  7.  
  8.  
  9. #endif
  10. //Main Include
  11. #include <a_samp>
  12.  
  13.  
  14. /*-----------------------------------------------
  15. Don't change this otherwise whirlpool won't work!*/
  16. #define MAX_INI_ENTRY_TEXT 130
  17. #undef MAX_PLAYER_NAME
  18. #define MAX_PLAYER_NAME 24
  19. /*-----------------------------------------------*/
  20.  
  21. //Includes
  22. #include < YSI/Y_ini >
  23. #include < sscanf2 >
  24. #include < zcmd >
  25. #include < foreach >
  26. #include < regex >
  27. //#include YSI/y_scripting
  28.  
  29. //Version of the script.
  30. #define Version "1.1"
  31.  
  32. #pragma dynamic 46500
  33. //Colors:
  34. #define ORAN "{FF5500}"
  35. #define GREE "{94ED40}"
  36. #define BLUE "{4097ED}"
  37. #define W "{FFFFFF}"
  38. #define GREY "{C3C3C3}"
  39.  
  40.  
  41. //Tags:
  42. #define Dialog: _:DIALOG_
  43. #define Color: _:COL_
  44.  
  45.  
  46. //Shortcuts
  47. #define D: = 906 //If you have Dialog Problems, please change here, the higher, the better!
  48. #define PARAMS playerid, params[]
  49. #define SPD ShowPlayerDialog
  50. #define LIST DIALOG_STYLE_LIST
  51. #define INPUT DIALOG_STYLE_INPUT
  52. #define BOX DIALOG_STYLE_MSGBOX
  53. #define CaseDialog<%0> case(Dialog:%0):
  54. #define iDialog<%0> if(dialogid == Dialog:%0)
  55. #define GetVehicleName(%0) vNames[(%0) - 400]
  56. #define Freeze(%0) TogglePlayerControllable((%0), false)
  57. #define UnFreeze(%0) TogglePlayerControllable((%0), true)
  58. #define Col(%0,%1) ChangeVehicleColor(GetPlayerVehicleID(playerid), (%0), ((%0) & (zC = %1)))
  59. #define db_GetField DB::get_field_assoc
  60. #define db_Query DB::query
  61. #define db_Free DB::free_result
  62. #define db_Valid DB::num_rows
  63. #define DB:: db_
  64.  
  65. /*
  66. =======================================
  67. ==| Bellow choose your own settings |==
  68. =======================================
  69. */
  70.  
  71. //----------------------------------------
  72. #define SECURITY_QUESTION false /*true - Will enable the security question so user can retrieve their password.
  73. false - Won't.*/
  74. //----------------------------------------
  75. #define STATS_STABILIZER false /*true - Stats will be stabilized, uses OnPlayerUpdate, unchek in case of lag...
  76. false - Won't.*/
  77. //----------------------------------------
  78. #define SAVE_IN_LOGS true /*true - It will save on file when player gets kicked/banned/muted etc..
  79. false - It won't save.*/
  80. //----------------------------------------
  81. #define SAVE_MUTE true /*true - Mute with mute time will be saved and on connect it will be re-applied!
  82. false - Mute won't be saved and it will be disabled on connect/disconnect*/
  83. //----------------------------------------
  84. #define SAVE_FREEZE true /*true - Player will be frozen after re-connect
  85. false - Player will be able to move after reconnection.*/
  86. //----------------------------------------
  87. #define SAVE_JAIL true /*true - Player after reconection will be jailed for the amount of time set
  88. false - Player after reconnection won't go to jail!*/
  89. //----------------------------------------
  90. #define USE_RANKS true /*true - Tell player when reaching x kills his new rank!
  91. false - Don't use ransk at all!*/
  92. //----------------------------------------
  93. #define PRINT_RANKS false /* true - Will print the created rank names in the console.
  94. false - Will do the opposite! Won't show them in console!*/
  95. //----------------------------------------
  96. #define UPDATE_TOP_ALWAYS true /*true - The top x players file will be update once a kill/death or whatever stat is, has occured.
  97. false - It will update only on disconnect.*/
  98. //----------------------------------------
  99. #define TRACK_ACCOUNTS true /*true - Each time a player disconnects from the server and he has an account a file of his stats will be created with the stats on date x
  100. false - Not gonna happen! Only when admin uses !stats <id> in console or /rcon !stats id in game.*/
  101.  
  102. //ATTENTION: KEEP THE SYMBOM INSIDE ' '.
  103. #define ADMIN_CHAT_SYMBOL '@' //Choose symbol1 to let vip members talk among them. Use same symbol on both for 1 usage.
  104. #define ADMIN_CHAT_SYMBOL2 '#' //Choose symbol2 to let vip members talk among them. Use same symbol on both for 1 usage.
  105. #define VIP_CHAT_SYMBOL '*' //Choose symbol1 to let Admins talk among them. Use same symbol on both for 1 usage.
  106. #define VIP_CHAT_SYMBOL2 '$' //Choose symbol2 to let Admins talk among them. Use same symbol on both for 1 usage.
  107.  
  108. //Start defining here the way you like!
  109. #define MIN_PASS_LEN (4) //Minimum characters a password must have. (On register)
  110. #define MAX_PASS_LEN (20) //Maximum characters a password must have. (On register)
  111. #define MAX_PASS_FAIL (4) //Define how many tries a player has to login.
  112. #define MAX_RCON_ATTEMPTS 3 //Define how many tries a player must have to enter the right RCON Password.
  113. #define MIN_PING_LIMIT 100 //Minimum ping an admin must enter on the cPanel, category, "Ping Kicker"
  114. #define MAX_PING_LIMIT 3000 //Maximum ping an admin must enter on the cPanel, category, "Ping Kicker"
  115. #define IPGKICK 1 //Minimun level for admin to not be kicked by the Ping Kicker.
  116. #define LOW_SPAM_RATE (1300) //Each how many seconds the spam rate drops
  117. #define GOD_TICK_RATE (500) //Once every x ms/seconds the god will update. (If causes lag increase number)
  118. #define MINIMUM_SPAM (3) //Minimum spam message for the anti-spam to be triggered!
  119. #define MEDIUM_SPAM (10) //Medium spam messages for the player to be kicked for spamming.
  120. #define MAXIMUM_SPAM (16) //Maximum spam messages for the player to be BANNED for spamming.
  121. #define MIN_CMD_SPAM (7) //Minimun commands spam for the player to be kicked for commands spamming.
  122. #define MAX_CMD_SPAM (16) //Maximum commands spam for the player to be BANNED for commands spamming
  123. #define MAX_COOKIE_COST 95 //How much a cookie costs!
  124. #define MAX_P_WARNS 3 //Max warns for the player to achieve to get kicked!
  125. #define MAX_TOP_LIMIT 15 //Max how many players will be shown in the top x players!
  126. #define MAX_SHOW_PER_ROW 6 //Define here how many players should be shoed on /vips /admins /muted etc per row!
  127. #define MAX_RANK_LEN (50) //Define here the max rank name lenght!
  128. #define EXTRA_MINUTES 15 /*Define how many +minutes of mute or jail the player will receive
  129. after evading with a different IP but same name, or same IP but different name*/
  130. //Files
  131. #define LOGS_LOC "0Admin/Logs/" //The location where the server will print a log of a ban/kick
  132. #define KICK_LOG "0Admin/Logs/KickLog.ini" //Naming the Kick Log
  133. #define BAN_LOG "0Admin/Logs/BanLog.ini" //Naming the Ban Log
  134. #define RCON_LOG "0Admin/Logs/RCONFails.ini" //Printing in the log what IP tried to break the RCON and with what password!
  135. #define REPORT_LOG "0Admin/Logs/Reports.ini" //Where the report logs will be saved
  136. #define SETRANK_LOG "0Admin/Logs/SetRank.ini" //A log where it will store the player that has changed rank etc..
  137. #define SETLEVEL_LOG "0Admin/Logs/SetLevel.ini" //A log where it will store the player that has changed level etc..
  138. #define SETVIP_LOG "0Admin/Logs/SetVip.ini" //A log where it will store the player that has changed vip etc..
  139. #define PMS_LOG "0Admin/Logs/PMs.ini" //Where all Personal Messages will be stored!
  140. #define WARNS_LOG "0Admin/Logs/Warns.ini" //Where the warns will be stored!
  141. #define VIPCHAT_LOG "0Admin/Logs/VIP Chat.ini" //Here saves everything admins chat trough the Admin Chat.
  142. #define ADMINCHAT_LOG "0Admin/Logs/Admin Chat.ini" //Here stores all the messages sent by VIP members
  143. #define USER_ID "0Admin/Account_ID.ini" //Saving how many accounts have been created and which was the last one
  144. #define AKA_FILE "0Admin/AKA.ini" //Sacing the AKA(Also Known As) of a player!
  145. #define SERVER_FILE "0Admin/SVSettings.ini" //The server data, where Autologin Antispam anti whatever will asve!
  146. #define DATABASE_LOC "0Admin/Database.db" //Define here where the database with the top x players and muted/jaled/frozen
  147. #define STATS_LOC "0Admin/Stats/" //Where the file of the player creates when admins uses !stats <id> in console.
  148.  
  149. //For the /SETSTAT command
  150. #define NAME 0
  151. #define MONEY 1
  152. #define SCORE 2
  153. #define COOKIES 3
  154. #define RESPECT 4
  155. #define KILLS 5
  156. #define DEATHS 6
  157. #define MESSAGES 7
  158. #define COMMANDS 8
  159. #define FCOMMANDS 9
  160. #define ONLINE 10
  161. #define LEVEL 11
  162. #define VLEVEL 12
  163. #define CPASS 13
  164. #define BACCOUNT 14
  165. #define DACCOUNT 15
  166.  
  167. #define ADMIN_SPEC_TYPE_NONE 0
  168. #define ADMIN_SPEC_TYPE_PLAYER 1
  169. #define ADMIN_SPEC_TYPE_VEHICLE 2
  170.  
  171.  
  172. //Shortcuts
  173.  
  174. #define CreateTable(%0,%1,%2)\
  175. DB::Query((%0), "CREATE TABLE IF NOT EXISTS " "`"%1"`" %2)
  176.  
  177.  
  178. //----------------------------------------
  179. #define Public:%0(%1) forward %0(%1);\
  180. public %0(%1)
  181.  
  182. //----------------------------------------
  183. #define FormatMSG(%0,%1,%2,%3)\
  184. do{\
  185. format(_S_T_R_, sizeof (_S_T_R_), (%2), %3);\
  186. SendClientMessage((%0),(%1), _S_T_R_);\
  187. }\
  188. while (False)
  189.  
  190. //----------------------------------------
  191. #define SendAdminCMD(%0,%1,%2)\
  192. do{\
  193. foreach(Player, zI){\
  194. if(P_DATA[zI][Level]> 1){\
  195. if(zI != (%0)){\
  196. format(_S_T_R_, sizeof (_S_T_R_), (%1), %2);\
  197. SendClientMessage(zI,Color:GREY, _S_T_R_);\
  198. }\
  199. }\
  200. }\
  201. }\
  202. while (False)
  203.  
  204. //----------------------------------------
  205. #define LevelCheck(%0,%1)\
  206. do{\
  207. if(P_DATA[(%0)][Level] < (%1) && !IsPlayerAdmin((%0))){\
  208. if(S_DATA[TellPlayer]){\
  209. new Str[256];\
  210. format(Str, 256, "SERVER:"W" You must be an admin level "ORAN"%d"W" to use this command!", (%1));\
  211. return SendClientMessage((%0), Color:ORAN, Str);\
  212. }else return 0;\
  213. }\
  214. }\
  215. while(False)
  216.  
  217. //----------------------------------------
  218. #define LoginCheck(%0) \
  219. do{\
  220. if(!P_DATA[(%0)][Logged])\
  221. {\
  222. if(S_DATA[TellPlayer])\
  223. {\
  224. return SendClientMessage((%0), Color:ORAN, "SERVER:"W" You must be logged in to use this command!");\
  225. }else return 0;\
  226. }\
  227. }\
  228. while(False)
  229.  
  230. //----------------------------------------
  231. #define SaveInLog(%0,%1,%2) \
  232. do\
  233. {\
  234. new File:_File = fopen((%0), io_append);\
  235. format(_S_T_R_, sizeof (_S_T_R_), %1 "\r\n", %2);\
  236. if((_File))\
  237. {\
  238. fwrite((_File), _S_T_R_);\
  239. fclose((_File));\
  240. }\
  241. }\
  242. while(False)
  243.  
  244. //----------------------------------------
  245. #define FileExist(%0);\
  246. if(!fexist(%0))\
  247. {\
  248. printf("MISSING FILE: \"%s\" doesn't exist, created by the system", %0);\
  249. new File:uFile = fopen(%0, io_write); fclose(uFile);\
  250. Fail = true;\
  251. }
  252.  
  253. //----------------------------------------
  254. #define CheckImune(%0,%1); \
  255. if(P_DATA[(%0)][Level] < P_DATA[(%1)][Level]) \
  256. return SendError(%0, "You are not allowed to use this command on this admin!");
  257.  
  258. //----------------------------------------
  259. #define VipCheck(%0, %1); \
  260. if(P_DATA[(%0)][Vip] < %1 && !IsPlayerAdmin(%0)) \
  261. return format(_S_T_R_, 256, "SERVER:"W" You must be a VIP level "ORAN"%d"W" to use this command!", %0),\
  262. SendClientMessage((%0), Color:ORAN, _S_T_R_);
  263.  
  264. //----------------------------------------
  265. #define CheckComponents(%0,%1)\
  266. if(!strcmp(GPVSEx((%0), "Type"), "None") && !P_DATA[(%0)][A_Component1] &&\
  267. !P_DATA[(%0)][A_Component2] && !P_DATA[(%0)][A_Component3] &&\
  268. !P_DATA[(%0)][A_Component4] && !P_DATA[(%0)][A_Wheels] &&\
  269. !P_DATA[(%0)][A_Color])\
  270. return SendError((%0), %1),cmd_accp((%0), "")
  271.  
  272. //----------------------------------------
  273. #define PRESSED(%0) \
  274. (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
  275.  
  276. //----------------------------------------
  277. #define RELEASED(%0) \
  278. (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))
  279.  
  280. //----------------------------------------
  281. #define OpenWriteClose(%0,%1,%2,%3);\
  282. {\
  283. new INI:%1 = INI_Open((%0));\
  284. INI_WriteInt((%1), %2, (%3));\
  285. INI_Close((%1));\
  286. }
  287. //----------------------------------------
  288. #define _0CMD(%0) \
  289. if(!strcmp(cmd, "!0" %0, true))
  290.  
  291. //----------------------------------------
  292. #define Triadic(%0)\
  293. (%0) ? ("Enabled") : ("Disabled")
  294.  
  295. //----------------------------------------
  296. #define CONSOLE(%0) \
  297. if(!strcmp(cmd, (%0), true, .length = strlen((%0))))
  298.  
  299. //----------------------------------------
  300. #define PrintError(%0) \
  301. print("\n----------------\n" %0 "\n----------------\n")
  302.  
  303. //----------------------------------------
  304. #define PrintErrorEx(%0,%1) \
  305. printf("\n----------------\n" %0 "\n----------------\n", %1)
  306.  
  307. //----------------------------------------
  308. #define loop(%0,%1) \
  309. for(new _%0; (_%0) != (%1); (_%0)++)
  310.  
  311. //----------------------------------------
  312. #define _GetField<%0>Store<%1>\
  313. DB::GetField(Result, %0, (Field), sizeof((Field)));\
  314. P_DATA[playerid][%1] = strval(Field);
  315.  
  316. //----------------------------------------
  317. #define Show(%0) \
  318. ShowPlayerDialog(playerid, Dialog:Empty, BOX, ""W"Your Commands:", (%0), "Close", "")
  319.  
  320. //----------------------------------------
  321. #define Detour<%0,%1> \
  322. CMD:%0(PARAMS) return cmd_%1(playerid, "");
  323.  
  324. native WP_Hash(buffer[], len, const str[]);
  325.  
  326. stock
  327. bool:False = false,
  328. _S_T_R_[256];
  329.  
  330. enum
  331. Colors
  332. {
  333. COL_ORAN = 0xFF5500FF,
  334. COL_GREY = 0xC3C3C3FF,
  335. COL_GREE = 0xADEB50FF,
  336. COL_FUNC = 0xFFA640FF,
  337. COL_BLUE = 0x4097EDFF,
  338. COL_WHITE = -1
  339. };
  340.  
  341. enum
  342. Dialogs
  343. {
  344. Dialog:Register D:+1, Dialog:Register1 D:+2,
  345. Dialog:Login D:+3, Dialog:Login2 D:+4,
  346. Dialog:Login3 D:+5, Dialog:Stats D:+6,
  347. Dialog:cPanel D:+7, Dialog:cPanel_Back D:+8,
  348. Dialog:cPanel_Ping D:+9, Dialog:cPanel2 D:+10,
  349. Dialog:Empty D:+11, Dialog:ACCP D:+12,
  350. Dialog:ACCP_NOS D:+13, Dialog:ACCP_COLORS D:+14,
  351. Dialog:ACCP_C_C D:+15, Dialog:ACCP_WHEELS D:+16,
  352. Dialog:ACCP_COMPS D:+17, Dialog:ACCP_SAVE D:+18,
  353. Dialog:ACCP_LOAD D:+19, Dialog:ACCP_DISCARD D:+20,
  354. Dialog:SetStatsSure D:+21, Dialog:SetStatsTrue D:+22,
  355. Dialog:TOP D:+23, Dialog:TOP_SELECT D:+24,
  356. Dialog:TOP_RESPECT D:+25, Dialog:CLICK D:+26,
  357. Dialog:CLICK_PM D:+27, Dialog:CLICK_RP D:+28,
  358. Dialog:CLICK_MONEY D:+29, Dialog:CLICK_REPORT D:+30,
  359. Dialog:PCP D:+31, Dialog:NAME D:+32,
  360. Dialog:MONEY D:+33, Dialog:SCORE D:+34,
  361. Dialog:COOKIES D:+35, Dialog:RESPECT D:+36,
  362. Dialog:KILLS D:+37, Dialog:DEATHS D:+38,
  363. Dialog:MESSAGES D:+39, Dialog:COMMANDS D:+40,
  364. Dialog:FCOMMANDS D:+41, Dialog:ONLINE D:+42,
  365. Dialog:LEVEL D:+43, Dialog:VLEVEL D:+44,
  366. Dialog:CPASS D:+45, Dialog:BACCOUNT D:+46,
  367. Dialog:DACCOUNT D:+47, Dialog:RESPECT_NEG D:+48,
  368. Dialog:RESPECT_POS D:+49, Dialog:ONLINE_H D:+50,
  369. Dialog:ONLINE_M D:+51, Dialog:ONLINE_S D:+52,
  370. Dialog:SAnswer D:+53, Dialog:SAnswer2 D:+54,
  371. Dialog:SQuestion D:+55, Dialog:ForgPass D:+56,
  372. Dialog:PCPBack D:+57, Dialog:PCPShout D:+58
  373.  
  374. };
  375. enum
  376. P_ENUM_DATA
  377. {
  378. Money, Score, MutedAll, Level,
  379. Vip, Rank, Msgs, Cmds,
  380. fCmds, Kills, Deaths, Negative,
  381. Positive, God, CarGod, Boost,
  382. Banned, Kicks, LogFail, Logged,
  383. Muted, Frozen, Jailed, cmgddon,
  384. Hours, Minutes, Seconds, TotalTime,
  385. ConnTime, AccID, MutedTime, JailTime,
  386. SpamMSG, cSpam, tLevel, PMSent,
  387. RepMSG[128], Warns, Cookies, aCar,
  388. pAuto, GiveCar, Spec_ID, Spec_Type,
  389. NosTimer, Accp_Saved, A_Color, Spin,
  390. A_Component1, A_Component2, A_Component3, A_Component4,
  391. A_Wheels, Incred, BAPMs, VIPTag,
  392. Text3D:Tag3D, Float:bSpeed
  393. };
  394. enum
  395. S_ENUM_DATA
  396. {
  397. AntiSpam, AntiCSpam, Ping, sAccounts,
  398. RconFails, RCONProt, TellPlayer, Chat,
  399. ReadPM, ReadCMD, AKA, ShowFunction,
  400. AntiRepeat, AutoLogin, AnnRank, AntiAD,
  401. sCMDS, sMSGS, sCrashes, sDisc,
  402. sConn, sKB, sPlayers, sRecord,
  403. sD, sM, sY, RecordBy[MAX_PLAYER_NAME],
  404. sH, sMi, sS, VipChat,
  405. AdminChat
  406. };
  407.  
  408. enum INI_Enum_NV { iName[15], iValue };
  409. enum INI_Server_Enum_NV { isName[15], isValue };
  410. enum WHEELS_E { iWheel, iwName[15] };
  411. enum vCOLORS_E { ivColor, ivcRGB[9], ivcName[15] };
  412. enum vCOMPONENTS_E { iComponent, icName[20] };
  413. enum RANKS_E { iRank, irName[MAX_RANK_LEN] };
  414.  
  415.  
  416. new
  417. bool:Fail = false;
  418.  
  419.  
  420. new
  421. DB:_DB,
  422. PlayerIP[MAX_PLAYERS][50],
  423. P_DATA[MAX_PLAYERS][P_ENUM_DATA],
  424. S_DATA[S_ENUM_DATA],
  425. MuteTimer[MAX_PLAYERS],
  426. JailTimer[MAX_PLAYERS],
  427. PlayerText3D:ZaAdminCar[MAX_PLAYERS],
  428. StatsString[800],
  429. WhosStats[129],
  430.  
  431. _Levels[][] =
  432. {
  433. { "Member" },
  434. { "Helper" },
  435. { "Mini Moderator" },
  436. { "Moderator" },
  437. { "Administrator" },
  438. { "Owner" }
  439. },
  440.  
  441. #if USE_RANKS == true
  442.  
  443. //When you add/remove a rank, count each rank and insert here the number:
  444. #define TOTAL_RANKS (12)
  445.  
  446. _Ranks[TOTAL_RANKS][RANKS_E] =
  447. {
  448. /* Kills Rank Name */
  449. { 0, "Looser" },
  450. { 25, "Easy Killa'" },
  451. { 50, "Baby Killer" },
  452. { 75, "e-Gangsta" },
  453. { 100, "Boss" },
  454. { 150, "Lil' Psycho" },
  455. { 200, "Psycho" },
  456. { 300, "Unstopable" },
  457. { 400, "Elite Killer" },
  458. { 600, "Godlike killer!" },
  459. { 800, "INSANE KILLER" },
  460. { 1000, "The God of Deathmatch" }//Last row must NOT have the ','
  461. },
  462. #endif
  463.  
  464. ACCP_Components[7][vCOMPONENTS_E] =
  465. {
  466. /* Model Component Name */
  467. { 1019, "Twin Exhaust" },
  468. { 1018, "Upswept Exhaust" },
  469. { 1001, "Win Spoiler" },
  470. { 1023, "Fury Spoiler" },
  471. { 1003, "Alpha Spoiler" },
  472. { 1087, "Hydraulics" },
  473. { 1017, "Skirt" }
  474. },
  475.  
  476. ACCP_Colors[16][vCOLORS_E] =
  477. {
  478. /* CarCol RRGGBB Color Name */
  479. { 1, "{FFFFFF}", "White" },
  480. { 0, "{000000}", "Black" },
  481. { 2, "{2a77a1}", "Light Blue" },
  482. { 3, "{840510}", "Dark Red" },
  483. { 25, "{253739}", "Dark Grey" },
  484. { 85, "{87446f}", "Soft Magenta" },
  485. { 6, "{d68f11}", "Orange" },
  486. { 109, "{bdbdc5}", "Grey" },
  487. { 49, "{d6dbd5}", "White Grey" },
  488. { 86, "{34603f}", "Green" },
  489. { 113, "{5f272a}", "Brown" },
  490. { 126, "{ed6aae}", "Pinky" },
  491. { 51, "{305045}", "Dark Green" },
  492. { 12, "{5e7e8d}", "Soft Blue" },
  493. { 102, "{ab9d83}", "Easy Color" },
  494. { 65, "{8f8c47}", "Ugly Green" }
  495. },
  496.  
  497.  
  498. Wheels[17][WHEELS_E] =
  499. {
  500. /* Model Wheel Name */
  501. { 1_025, "Offroad" },
  502. { 1_073, "Shadow" },
  503. { 1_074, "Mega" },
  504. { 1_075, "Rimshine" },
  505. { 1_076, "Wires" },
  506. { 1_077, "Classic" },
  507. { 1_078, "Twist" },
  508. { 1_079, "Cutter" },
  509. { 1_080, "Switch" },
  510. { 1_081, "Grove" },
  511. { 1_082, "Import" },
  512. { 1_083, "Dollar" },
  513. { 1_084, "Trance" },
  514. { 1_085, "Atomic" },
  515. { 1_096, "Ahab" },
  516. { 1_097, "Virtual" },
  517. { 1_098, "Access" }
  518. },
  519. SpamColors[35] =
  520. {
  521. 0xFBBA00FF, 0xB4B5B7AA, 0xAFAFAFAA, 0x0000BBAA, 0x800080AA,
  522. 0x000000AA, 0x33AA33AA, 0xA52A2AAA, 0xFFA00AFF, 0xFF560AFF,
  523. 0xFFD8B0FF, 0xFFD876FF, 0xFFBF3BFF, 0xFFC628FF, 0xFF4D28FF,
  524. 0xFFFF28FF, 0xC0C0C0AA, 0xFFDD80FF, 0x00DD37FF, 0x2C2727AA,
  525. 0xC968FCFF, 0xC9C0FCFF, 0xA790FCFF, 0x0097FFFF, 0xFF6463FF,
  526. 0x00DDFFFF, 0x00DDFF15, 0xC500FFFF, 0x33AA33AA, 0x00DD37FF
  527. },
  528. INI_Server_Info[16][INI_Server_Enum_NV] =
  529. {
  530. /* Feature Value */
  531. { "AntiSpam", 1 },
  532. { "AntiCMDSpam", 1 },
  533. { "MaxPing", 750 },
  534. { "RconProtect", 1 },
  535. { "TellPlayer", 1 },
  536. { "BlockChat", 0 },
  537. { "ReadPMs", 0 },
  538. { "ReadCommands", 0 },
  539. { "AKA", 1 },
  540. { "ShowFunction", 1 },
  541. { "AntiRepeat", 1 },
  542. { "AutoLogin", 0 },
  543. { "AnnRank", 1 },
  544. { "AntiAdv", 1 },
  545. { "AdminChat", 1 },
  546. { "VipChat", 1 }
  547. },
  548. vNames[212][] =
  549. {
  550. {"Landstalker"}, {"Bravura"}, {"Buffalo"}, {"Linerunner"}, {"Perrenial"}, {"Sentinel"}, {"Dumper"},
  551. {"Firetruck"}, {"Trashmaster"}, {"Stretch"}, {"Manana"}, {"Infernus"}, {"Voodoo"}, {"Pony"}, {"Mule"},
  552. {"Cheetah"}, {"Ambulance"}, {"Leviathan"}, {"Moonbeam"}, {"Esperanto"}, {"Taxi"}, {"Washington"},
  553. {"Bobcat"}, {"Mr Whoopee"}, {"BF Injection"}, {"Hunter"}, {"Premier"}, {"Enforcer"}, {"Securicar"},
  554. {"Banshee"}, {"Predator"}, {"Bus"},{"Rhino"}, {"Barracks"}, {"Hotknife"}, {"Trailer 1"}, {"Previon"},
  555. {"Coach"}, {"Cabbie"}, {"Stallion"}, {"Rumpo"}, {"RC Bandit"}, {"Romero"}, {"Packer"}, {"Monster"},
  556. {"Admiral"}, {"Squalo"}, {"Seasparrow"}, {"Pizzaboy"}, {"Tram"}, {"Trailer 2"}, {"Turismo"},
  557. {"Speeder"}, {"Reefer"}, {"Tropic"}, {"Flatbed"}, {"Yankee"}, {"Caddy"}, {"Solair"}, {"Berkley's RC Van"},
  558. {"Skimmer"}, {"PCJ-6_0_0"}, {"Faggio"}, {"Freeway"}, {"RC Baron"}, {"RC Raider"}, {"Glendale"}, {"Oceanic"},
  559. {"Sanchez"}, {"Sparrow"}, {"Patriot"}, {"Quad"}, {"Coastguard"}, {"Dinghy"}, {"Hermes"}, {"Sabre"},
  560. {"Rustler"}, {"ZR-3_5_0"}, {"Walton"}, {"Regina"}, {"Comet"},{"BMX"}, {"Burrito"}, {"Camper"}, {"Marquis"},
  561. {"Baggage"}, {"Dozer"}, {"Maverick"}, {"News Chopper"}, {"Rancher"}, {"FBI Rancher"}, {"Virgo"}, {"Greenwood"},
  562. {"Jetmax"}, {"Hotring"}, {"Sandking"}, {"Blista Compact"}, {"Police Maverick"},{"Boxville"}, {"Benson"},
  563. {"Mesa"}, {"RC Goblin"}, {"Hotring Racer A"}, {"Hotring Racer B"},{"Bloodring Banger"},{"Rancher"},
  564. {"Super GT"}, {"Elegant"}, {"Journey"}, {"Bike"}, {"Mountain Bike"}, {"Beagle"}, {"Cropdust"}, {"Stunt"},
  565. {"Tanker"}, {"Roadtrain"}, {"Nebula"}, {"Majestic"}, {"Buccaneer"}, {"Shamal"}, {"Hydra"}, {"FCR-900"},
  566. {"NRG-500"}, {"HPV1000"}, {"Cement Truck"}, {"Tow Truck"}, {"Fortune"}, {"Cadrona"}, {"FBI Truck"},
  567. {"Willard"}, {"Forklift"}, {"Tractor"}, {"Combine"}, {"Feltzer"}, {"Remington"}, {"Slamvan"},
  568. {"Blade"}, {"Freight"}, {"Streak"}, {"Vortex"}, {"Vincent"}, {"Bullet"}, {"Clover"}, {"Sadler"},
  569. {"Firetruck LA"}, {"Hustler"}, {"Intruder"}, {"Primo"}, {"Cargobob"}, {"Tampa"}, {"Sunrise"}, {"Merit"},
  570. {"Utility"}, {"Nevada"}, {"Yosemite"}, {"Windsor"}, {"Monster A"}, {"Monster B"}, {"Uranus"}, {"Jester"},
  571. {"Sultan"}, {"Stratum"}, {"Elegy"}, {"Raindance"}, {"RC Tiger"}, {"Flash"}, {"Tahoma"}, {"Savanna"},
  572. {"Bandito"}, {"Freight Flat"}, {"Streak Carriage"}, {"Kart"}, {"Mower"}, {"Duneride"}, {"Sweeper"},
  573. {"Broadway"}, {"Tornado"}, {"AT-400"}, {"DFT-30"}, {"Huntley"}, {"Stafford"}, {"BF-400"}, {"Newsvan"},
  574. {"Tug"}, {"Trailer 3"}, {"Emperor"}, {"Wayfarer"}, {"Euros"}, {"Hotdog"}, {"Club"}, {"Freight Carriage"},
  575. {"Trailer 3"}, {"Andromada"}, {"Dodo"}, {"RC Cam"}, {"Launch"}, {"Police Car LSPD"},{"Police Car SFPD"},
  576. {"Police _LVPD"}, {"Police Ranger"}, {"Picador"}, {"SWAT. Van"}, {"Alpha"}, {"Phoenix"}, {"Glendale"},
  577. {"Sadler"}, {"Luggage Trailer A"}, {"Luggage Trailer B"}, {"Stair Trailer"},{"Boxville"}, {"Farm Plow"},
  578. {"Utility Trailer"}
  579.  
  580. };
  581. #if USE_RANKS == true
  582.  
  583. new _RankNames[sizeof(_Ranks)][MAX_RANK_LEN];
  584.  
  585. #endif
  586.  
  587.  
  588. public OnPlayerUpdate(playerid)
  589. {
  590. #if STATS_STABILIZER == true
  591.  
  592. if(P_DATA[playerid][Kills] != GetPVarInt((playerid), "0_Kills"))
  593. P_DATA[(playerid)][Kills] = GetPVarInt((playerid), "0_Kills");
  594.  
  595. if(P_DATA[playerid][Deaths] != GetPVarInt((playerid), "0_Deaths"))
  596. P_DATA[(playerid)][Deaths] = GetPVarInt((playerid), "0_Deaths");
  597.  
  598. if(P_DATA[playerid][Level] != GetPVarInt((playerid), "0_Level"))
  599. P_DATA[(playerid)][Level] = GetPVarInt((playerid), "0_Level");
  600.  
  601. if(P_DATA[playerid][Vip] != GetPVarInt((playerid), "0_Vip"))
  602. P_DATA[(playerid)][Vip] = GetPVarInt((playerid), "0_Vip");
  603.  
  604. if(P_DATA[playerid][Cookies] != GetPVarInt((playerid), "0_Cookies"))
  605. P_DATA[(playerid)][Cookies] = GetPVarInt((playerid), "0_Cookies");
  606.  
  607. if(P_DATA[playerid][God] != GetPVarInt((playerid), "0_God"))
  608. P_DATA[(playerid)][God] = GetPVarInt((playerid), "0_God");
  609.  
  610. if(P_DATA[playerid][CarGod] != GetPVarInt((playerid), "0_CarGod"))
  611. P_DATA[(playerid)][CarGod] = GetPVarInt((playerid), "0_CarGod");
  612.  
  613. if(P_DATA[playerid][Positive] != GetPVarInt((playerid), "0_Positive"))
  614. P_DATA[(playerid)][Positive] = GetPVarInt((playerid), "0_Positive");
  615.  
  616. if(P_DATA[playerid][Negative] != GetPVarInt((playerid), "0_Negative"))
  617. P_DATA[(playerid)][Negative] = GetPVarInt((playerid), "0_Negative");
  618.  
  619. if(P_DATA[playerid][Boost] != GetPVarInt((playerid), "0_Boost"))
  620. P_DATA[(playerid)][Boost] = GetPVarInt((playerid), "0_Boost");
  621.  
  622. if(P_DATA[playerid][Rank] != GetPVarInt((playerid), "0_Rank"))
  623. P_DATA[(playerid)][Rank] = GetPVarInt((playerid), "0_Rank");
  624.  
  625. #endif
  626. return 1;
  627. }
  628.  
  629. public OnFilterScriptInit()
  630. {
  631. if(fexist("0Admin/"))
  632. {
  633. #if SAVE_IN_LOGS == true
  634. if(fexist(LOGS_LOC))
  635. {
  636. FileExist(VIPCHAT_LOG);
  637. FileExist(ADMINCHAT_LOG);
  638. FileExist(WARNS_LOG);
  639. FileExist(PMS_LOG);
  640. FileExist(SETRANK_LOG);
  641. FileExist(SETLEVEL_LOG);
  642. FileExist(SETVIP_LOG);
  643. FileExist(KICK_LOG);
  644. FileExist(BAN_LOG);
  645. FileExist(RCON_LOG);
  646. FileExist(REPORT_LOG);
  647. }
  648. else print("MISSING FOLDER: Folder \""#LOGS_LOC"\" doesn't exist! Please create it!"),
  649. Fail = true;
  650.  
  651. #endif
  652.  
  653. FileExist(AKA_FILE);
  654. if(!fexist(USER_ID))
  655. {
  656. printf("MISSING FILE: \""#USER_ID"\" doesn't exist, created by the system");
  657. new File:uFile = fopen(USER_ID, io_append);
  658. if(uFile)
  659. {
  660. fwrite(uFile, "Accounts_Created = 0\r\nLast_Account = None\r\nLast_Account_Date = Never");
  661. fclose(uFile);
  662. }
  663. Fail = true;
  664. }
  665.  
  666. if(!fexist(STATS_LOC))
  667. {
  668. print("MISSING FOLDER: Folder \""#STATS_LOC"\" doesn't exist! Please create it!");
  669. Fail = true;
  670. }
  671. }else print("MISSING FOLDER: The main folder \"/0Admin/\" is missing from the \"scriptfiles\""),
  672. Fail = true;
  673.  
  674. _DB = db_open(DATABASE_LOC);
  675.  
  676. new String[750];
  677. strcat(String, "CREATE TABLE IF NOT EXISTS `Accounts` ", 750);
  678. strcat(String, "(`Key` INTEGER PRIMARY KEY AUTOINCREMENT, \
  679. `IP` TEXT, \
  680. `Name` TEXT, \
  681. `Password` TEXT, \
  682. `Online` TEXT, \
  683. `JoinDate` TEXT, \
  684. `Level` NUMERIC, \
  685. `VIP` NUMERIC, \
  686. `Rank` NUMERIC, \
  687. `Autologin` NUMERIC, \
  688. `Money` NUMERIC, \
  689. `Score` NUMERIC, \
  690. `Kills` NUMERIC, \
  691. `Deaths` NUMERIC, \
  692. `Cookies` NUMERIC, \
  693. `Positive` NUMERIC, \
  694. `Negative` NUMERIC, \
  695. `Messages` NUMERIC, \
  696. `Commands` NUMERIC, \
  697. `fCommands` NUMERIC, \
  698. `Warns` NUMERIC, \
  699. `Kicks` NUMERIC, \
  700. `God` NUMERIC, \
  701. `Cargod` NUMERIC,", 750);
  702.  
  703. strcat(String, " `ACCP` NUMERIC, \
  704. `ACCPSav` TEXT, \
  705. `BlockPM` NUMERIC, \
  706. `Boost` NUMERIC, \
  707. `bSpeed` NUMERIC, \
  708. `RPassword` TEXT, \
  709. `Question` TEXT, \
  710. `Answer` TEXT, \
  711. `WearTAG` NUMERIC, \
  712. `Spin` NUMERIC, \
  713. `Incred` NUMERIC)", 750);
  714.  
  715. DB::Query(_DB, String);
  716. CreateTable(_DB, "Top", "(`Key` INTEGER PRIMARY KEY AUTOINCREMENT, `Name` TEXT,`Kills` NUMERIC,`Deaths` NUMERIC,`Hours` NUMERIC,`Rank` NUMERIC,`Ratio` TEXT,`Negative` NUMERIC,`Positive` NUMERIC)");
  717.  
  718. #if SAVE_MUTE == true
  719. CreateTable(_DB, "Muted", "(`Key` INTEGER PRIMARY KEY AUTOINCREMENT, `IP` TEXT,`Muted` NUMERIC,`Time` NUMERIC,`RealName` TEXT)");
  720. #endif
  721.  
  722. #if SAVE_JAIL == true
  723. CreateTable(_DB, "Jailed", "(`Key` INTEGER PRIMARY KEY AUTOINCREMENT, `IP` TEXT,`Jailed` NUMERIC,`Time` NUMERIC,`RealName` TEXT)");
  724. #endif
  725.  
  726. #if SAVE_FREEZE == true
  727. CreateTable(_DB, "Frozen", "(`Key` INTEGER PRIMARY KEY AUTOINCREMENT, `IP` TEXT,`Frozen` NUMERIC,`RealName` TEXT)");
  728. #endif
  729.  
  730. CreateTable(_DB, "Banlist", "(`IP` TEXT,`Name` TEXT, `Reason` TEXT, `Admin` TEXT, `BanDate` TEXT)");
  731. CreateTable(_DB, "Positive", "(`Key` INTEGER PRIMARY KEY AUTOINCREMENT, `Name` TEXT,`Expiration` TEXT)");
  732. CreateTable(_DB, "Negative", "(`Key` INTEGER PRIMARY KEY AUTOINCREMENT, `Name` TEXT,`Expiration` TEXT)");
  733. CreateTable(_DB, "ServerStats", "(`Key` INTEGER PRIMARY KEY AUTOINCREMENT, `Commands`,`Messages`,`Crashes`,`Quits`,`Kicks/Bans`,`Connections`,`Uptime`)");
  734. CreateTable(_DB, "Record", "(`Players`,`Date`,`Time`,`By`,`DateOLD`,`TimeOLD`,`ByOLD`)");
  735.  
  736. new
  737. DBResult: R1;
  738.  
  739. R1 = DB::Query(_DB, "SELECT `Players`, `Date`, `Time`, `By` FROM `Record`");
  740.  
  741. if(R1)
  742. {
  743. if(DB::Valid(R1))
  744. {
  745. new Field[64];
  746.  
  747. DB::GetField(R1, "Players", Field, 64);
  748. S_DATA[sRecord] = strval(Field);
  749.  
  750. DB::GetField(R1, "Date", Field, 64);
  751. sscanf(Field, "p</>iii", S_DATA[sD], S_DATA[sM], S_DATA[sY]);
  752.  
  753. DB::GetField(R1, "Time", Field, 64);
  754. sscanf(Field, "p<:>iii", S_DATA[sH], S_DATA[sMi], S_DATA[sS]);
  755.  
  756. DB::GetField(R1, "By", Field, 64);
  757. format(S_DATA[RecordBy], MAX_PLAYER_NAME, "%s", Field);
  758.  
  759. DB::Free(R1);
  760. }
  761. else
  762. {
  763. DB::Free(R1);
  764. DB::Query(_DB, "INSERT INTO `Record` VALUES('0','0/0/0','0:0:0','Nobody','0/0/0','0:0:0','Nobody')");
  765. }
  766. }
  767. SetTimer("PingKick", 2000, true);
  768. SetTimer("LowerSpam", LOW_SPAM_RATE, true);
  769. SetTimer("GodLike", GOD_TICK_RATE, true);
  770.  
  771.  
  772. INI_ParseFile(USER_ID, "ParseUserID" );
  773. INI_ParseFile(SERVER_FILE, "LoadServerData");
  774.  
  775. if(S_DATA[Ping] < 100 && S_DATA[Ping] != 0)
  776. {
  777. new RandomPing = 600 + random(300);
  778. printf("WARNING: Ping Kicker was under 100, randomly set to: %d", RandomPing);
  779. S_DATA[Ping] = (RandomPing);
  780. }
  781. #if USE_RANKS == true
  782.  
  783. #if PRINT_RANKS == true
  784.  
  785. print("Ranks created succesfully!\n----------------------------");
  786.  
  787. #endif
  788. for (new r = 0; r < sizeof(_Ranks); r++)
  789. {
  790. format(_RankNames[r], MAX_RANK_LEN, "%s", _Ranks[r][irName]);
  791. #if PRINT_RANKS == true
  792.  
  793. printf("Rank: %s | Kills requiered: %d", _RankNames[r], _Ranks[r][iRank]);
  794.  
  795. #endif
  796. }
  797.  
  798. #endif
  799.  
  800. if(Fail == true)
  801. {
  802. print(#\n\n\nWARNING:);
  803. print(#----------------\n- When a file is missing","# the system will create it.);
  804. print(#- However","# if you get a folder error","# you must create the folder on your own!);
  805. print(#- If a folder or a file is deleted while the server runs","# problems may occur!\n\n);
  806. }
  807. if(fexist("/0Admin/"))
  808. {
  809. if(!fexist(SERVER_FILE))
  810. {
  811. printf("MISSING FILE: \""#SERVER_FILE"\" doesn't exist, created by the system");
  812. print("Thew following atributions have been added to the following features:");
  813.  
  814. new INI:ServerFile = INI_Open(SERVER_FILE),
  815. pStr[512];
  816. print("\n==========================================");
  817. print("||\tFeature\t\tState\tValue\t||");
  818. print("||--------------------------------------||");
  819.  
  820. for(new i = 0; i < sizeof(INI_Server_Info); ++i)
  821. {
  822. INI_WriteInt(ServerFile, INI_Server_Info[i][isName], INI_Server_Info[i][isValue]);
  823. format(pStr, sizeof (pStr), "||\t%s%s| %s%s",
  824. INI_Server_Info[i][isName],
  825. (i == 2 || i == 6 || i == 8 || i == 12 || i == 13 || i == 15) ? ("\t\t") : ("\t"),
  826. (INI_Server_Info[i][isValue]) ? ((i == 2) ? (EX(INI_Server_Info[i][isValue])) : ("Yes")) : ("No"),
  827. (INI_Server_Info[i][isValue]) ? ((i == 2) ? ("\t||") : ("\t\t||")) : ("\t\t||"));
  828. print(pStr);
  829. }
  830.  
  831. print("==================\t\t\t||");
  832. print("\t\t|| Copyright Zh3r0 2011 ||");
  833. print("\t\t==========================\n\n\n");
  834. INI_Close(ServerFile);
  835. INI_ParseFile(SERVER_FILE, "LoadServerData");
  836. }
  837. }
  838. if(!Fail) SetTimer("Display", 800, 0);
  839.  
  840.  
  841. /*new
  842. cmdBuffer[32],
  843. commandCount;
  844.  
  845. for(new it = 0; it < Scripting_GetPublicsCount(); it++) {
  846. Scripting_GetPublic(it, cmdBuffer);
  847.  
  848. if(!strcmp(cmdBuffer, "cmd_", false, 4)) {
  849. strdel(cmdBuffer, 0, 4);
  850. strins(cmdBuffer, "/", 0);
  851. strins(cmdBuffer, "\r\n", strlen(cmdBuffer));
  852. printf(#%d. %s, it - 47, cmdBuffer);
  853. new File:F = fopen("Cmds.txt", io_append);
  854.  
  855. if(F)
  856. {
  857. fwrite(F, cmdBuffer);
  858. fclose(F);
  859. }
  860.  
  861. commandCount++;
  862. }
  863. }
  864. printf(#A total of %d commands, commandCount);*/
  865. return 1;
  866. }
  867. stock CountZCMDCmds() {
  868. new
  869. cmdBuffer[32],
  870. commandCount;
  871.  
  872. for(new it = 0; it < Scripting_GetPublicsCount(); it++) {
  873. Scripting_GetPublic(it, cmdBuffer);
  874.  
  875. if(!strcmp(cmdBuffer, "cmd_", false, 4)) {
  876. commandCount++;
  877. }
  878. }
  879.  
  880. return commandCount;
  881. }
  882. public OnFilterScriptExit()
  883. {
  884.  
  885. db_close(_DB);
  886.  
  887. if(fexist(SERVER_FILE))
  888. {
  889. new INI:ServerFile = INI_Open(SERVER_FILE);
  890.  
  891. INI_WriteInt(ServerFile, INI_Server_Info[0][isName], S_DATA[AntiSpam]);
  892. INI_WriteInt(ServerFile, INI_Server_Info[1][isName], S_DATA[AntiCSpam]);
  893. INI_WriteInt(ServerFile, INI_Server_Info[2][isName], S_DATA[Ping]);
  894. INI_WriteInt(ServerFile, INI_Server_Info[3][isName], S_DATA[RCONProt]);
  895. INI_WriteInt(ServerFile, INI_Server_Info[4][isName], S_DATA[TellPlayer]);
  896. INI_WriteInt(ServerFile, INI_Server_Info[5][isName], S_DATA[Chat]);
  897. INI_WriteInt(ServerFile, INI_Server_Info[6][isName], S_DATA[ReadPM]);
  898. INI_WriteInt(ServerFile, INI_Server_Info[7][isName], S_DATA[ReadCMD]);
  899. INI_WriteInt(ServerFile, INI_Server_Info[8][isName], S_DATA[AKA]);
  900. INI_WriteInt(ServerFile, INI_Server_Info[9][isName], S_DATA[ShowFunction]);
  901. INI_WriteInt(ServerFile, INI_Server_Info[10][isName], S_DATA[AntiRepeat]);
  902. INI_WriteInt(ServerFile, INI_Server_Info[11][isName], S_DATA[AutoLogin]);
  903. INI_WriteInt(ServerFile, INI_Server_Info[12][isName], S_DATA[AnnRank]);
  904. INI_WriteInt(ServerFile, INI_Server_Info[13][isName], S_DATA[AntiAD]);
  905. INI_WriteInt(ServerFile, INI_Server_Info[14][isName], S_DATA[AdminChat]);
  906. INI_WriteInt(ServerFile, INI_Server_Info[15][isName], S_DATA[VipChat]);
  907. INI_Close(ServerFile);
  908. }
  909. return 1;
  910. }
  911. public OnRconCommand(cmd[])
  912. {
  913. new
  914. Player, P2, Reason[129];
  915.  
  916.  
  917. if(!strcmp(cmd, ">", true, .length = 1))
  918. {
  919. if(!sscanf(cmd[1], "s[129]", Reason))
  920. {
  921. FormatMSG(0, Color:BLUE, "Zh3r0: "W"%s", Reason);
  922. }
  923. }
  924. CONSOLE("!stats")
  925. {
  926. if(!sscanf(cmd[6], "uD(0)", Player, P2))
  927. {
  928. if(Player != (0xFFFF))
  929. {
  930. new
  931. Str[24],fStr[500];
  932.  
  933. format(Str, sizeof(Str) + strlen(STATS_LOC), ""#STATS_LOC"%s.ini", Name(Player));
  934.  
  935.  
  936. format(fStr, sizeof (fStr), "Date: %s\r\n------------------------------------------\r\n\
  937. Registration Date: %s\r\n\
  938. IP: %s\r\n\
  939. Account ID: %d\r\n\
  940. Level: %d\r\n\
  941. VIP: %d\r\n\
  942. Rank: %d\r\n\
  943. Commands Used: %d\r\n\
  944. Failed Commands: %d\r\n\
  945. Messages Sent: %d\r\n\
  946. Cookies: %d\r\n\
  947. Online: %s\r\n\
  948. Respect: %d/-%d\r\n\
  949. Money: %d\r\n\
  950. Score: %d\r\n\
  951. Deaths: %d\r\n\
  952. Kills: %d\r\n\
  953. Ratio: %.3f\r\n\
  954. Kicks Received: %d\r\n",
  955. zDate (),
  956. GPVSEx(Player, "AccountDate"),
  957. PlayerIP[Player],
  958. P_DATA[Player][AccID],
  959. P_DATA[Player][Level],
  960. P_DATA[Player][Vip],
  961. P_DATA[Player][Rank],
  962. P_DATA[Player][Cmds],
  963. P_DATA[Player][fCmds],
  964. P_DATA[Player][Msgs],
  965. P_DATA[Player][Cookies],
  966. FormatOnline(Player),
  967. P_DATA[Player][Positive],
  968. P_DATA[Player][Negative],
  969. GetPlayerMoney(Player),
  970. GetPlayerScore(Player),
  971. P_DATA[Player][Deaths],
  972. P_DATA[Player][Kills],
  973. (Float:P_DATA[Player][Deaths] / Float:P_DATA[Player][Kills]),
  974. P_DATA[Player][Kicks]);
  975.  
  976.  
  977.  
  978. if(P2 > 0) print(fStr);
  979. printf("\n---------------------------------------------------------------------\n\
  980. # %s's stats saved inside\n\n# "STATS_LOC"%s.ini\n\n# Open for his account details.\n\
  981. ---------------------------------------------------------------------\n\
  982. Type !stats <id> 1 to see them in the console.", Name(Player), Name(Player));
  983. new
  984. File:Stats = fopen(Str, io_append);
  985.  
  986. if(Stats)
  987. {
  988. if(fexist(Str)) fwrite(Stats, "\r\n\r\n\r\n");
  989. fwrite(Stats, fStr);
  990. fclose(Stats);
  991. }
  992. }
  993. else PrintError("Player not connected!");
  994. }
  995. else PrintError("Invalid Syntax");
  996. }
  997. CONSOLE("!warn")
  998. {
  999. if(!sscanf(cmd[5], "u", Player))
  1000. {
  1001. if(Player != (0xFFFF))
  1002. {
  1003. ++P_DATA[Player][Warns];
  1004.  
  1005. if(P_DATA[Player][Warns] != MAX_P_WARNS){
  1006. printf(" >>> You warned %s. (Warn Level: %d/"#MAX_P_WARNS")", Name(Player), P_DATA[Player][Warns]);}
  1007.  
  1008. else if(P_DATA[Player][Warns] >= MAX_P_WARNS){
  1009. P_DATA[Player][Warns] = 0,
  1010. printf(" >>> You warned %s. (Warn Level: %d/"#MAX_P_WARNS") > Kicked from the server for reaching the Warn Limit.", Name(Player), P_DATA[Player][Warns]);}
  1011.  
  1012. FormatMSG(Player, Color:GREY, "You have been warned by the owner of the server! ("ORAN"%d"GREY"/"ORAN""#MAX_P_WARNS")", P_DATA[Player][Warns]);
  1013. SendAdminCMD(Player, "Owner of the server warned player %s. ("ORAN"%d"GREY"/"ORAN""#MAX_P_WARNS")", Name(Player), P_DATA[Player][Warns]);
  1014. }
  1015. else PrintError("Player not connected!");
  1016. }
  1017. else PrintError("Invalid Syntax");
  1018. }
  1019. CONSOLE("!2012")
  1020. {
  1021. if(!sscanf(cmd[5], "u", Player))
  1022. {
  1023. if(Player != (0xFFFF))
  1024. {
  1025. for (new w = 0; w < 11; w++)
  1026. {SetPlayerSkillLevel(Player, w, 0);}
  1027.  
  1028. SetPlayerHealth(Player, 0.1); SetPlayerArmour(Player, 0.0);
  1029. SetPlayerTime(Player, 0, 0); SetPlayerWeather(Player, -66);
  1030. SetPlayerWantedLevel(Player, 6); SetPlayerSkin(Player, 159);
  1031. ResetPlayerWeapons(Player); GivePlayerWeapon(Player, 10, 1);
  1032. ResetPlayerMoney(Player); SetPlayerScore(Player, 0);
  1033. SetPlayerDrunkLevel(Player, 99999);
  1034.  
  1035. printf(" >>> You fucked up %s's game!.", Name(Player));
  1036. SendClientMessage(Player, Color:GREY, "You have been fucked up by the owner of the server!");
  1037. SendAdminCMD(Player, "Owner of the server fucked up player %s", Name(Player));
  1038.  
  1039. new
  1040. String[MAX_PLAYER_NAME];
  1041.  
  1042. format(String, MAX_PLAYER_NAME, "[NUB]%s", Name(Player));
  1043. if(strfind(Name(Player), "[NUB]", false, 0)) SetPlayerName(Player, String);
  1044. }
  1045. else PrintError("Player not connected!");
  1046. }
  1047. else PrintError("Invalid Syntax");
  1048. }
  1049. CONSOLE("!kill")
  1050. {
  1051. if(!sscanf(cmd[5], "u", Player))
  1052. {
  1053. if(Player != (0xFFFF))
  1054. {
  1055. SetPlayerHealth(Player, 0.0);
  1056.  
  1057. printf(" >>> You killed %s.", Name(Player));
  1058. SendClientMessage(Player, Color:GREY, "You have been killed by the owner of the server!");
  1059. SendAdminCMD(Player, "Owner of the server killed player %s", Name(Player));
  1060. }
  1061. else PrintError("Player not connected!");
  1062. }
  1063. else PrintError("Invalid Syntax");
  1064. }
  1065. CONSOLE("!setonline")
  1066. {
  1067. new
  1068. T[3];
  1069. if(!sscanf(cmd[10], "udD(0)D(0)", Player, T[0], T[1], T[2]))
  1070. {
  1071. if(Player != (0xFFFF))
  1072. {
  1073. if(T[1] > 60 || T[1] < 0) return PrintError("Invalid minutes!");
  1074. if(T[2] > 60 || T[2] < 0) return PrintError("Invalid seconds!");
  1075.  
  1076. P_DATA[Player][Hours] = T[0];
  1077. P_DATA[Player][Minutes] = T[1];
  1078. P_DATA[Player][Seconds] = T[2];
  1079.  
  1080. P_DATA[Player][ConnTime] = gettime();
  1081.  
  1082. printf(" >>> You set %s's online time to %d:%d:%d.",Name(Player), T[0], T[1], T[2]);
  1083. FormatMSG(Player, Color:GREY, "Owner of the server set your online time to: "BLUE"%d"W":"BLUE"%d"W":"BLUE"%d", T[0], T[1], T[2]);
  1084. SendAdminCMD(Player, "Owner of the server set %s's online time to: "BLUE"%d"W":"BLUE"%d"W":"BLUE"%d", Name(Player), T[0], T[1], T[2]);
  1085. }
  1086. else PrintError("Player not connected!");
  1087. }
  1088. else PrintError("Invalid Syntax");
  1089. }
  1090. CONSOLE("!spawn")
  1091. {
  1092. if(!sscanf(cmd[6], "u", Player))
  1093. {
  1094. if(Player != (0xFFFF))
  1095. {
  1096. SpawnPlayer(Player);
  1097.  
  1098. printf(" >>> You spawned %s.", Name(Player));
  1099. SendClientMessage(Player, Color:GREY, "You have been spawned by the owner of the server!");
  1100. SendAdminCMD(Player, "Owner of the server spawned player %s", Name(Player));
  1101. }
  1102. else PrintError("Player not connected!");
  1103. }
  1104. else PrintError("Invalid Syntax");
  1105. }
  1106. CONSOLE("!unfreeze")
  1107. {
  1108. if(!sscanf(cmd[9], "u", Player))
  1109. {
  1110. if(Player != (0xFFFF))
  1111. {
  1112. if(P_DATA[Player][Frozen])
  1113. {
  1114. P_DATA[Player][Frozen] = 0;
  1115. UnFreeze(Player);
  1116.  
  1117. #if SAVE_FREEZE == true
  1118.  
  1119. new Query[256], DBResult:Result;
  1120. format(Query, 256, "SELECT `Key` FROM `Frozen` WHERE `IP` = '%s'", GetPlayerIPEx(Player));
  1121. Result = DB::Query(_DB, Query);
  1122.  
  1123. if(Result)
  1124. {
  1125. if(DB::Valid(Result))
  1126. {
  1127. DB::Free(Result);
  1128. format(Query, 256, "DELETE FROM `Frozen` WHERE `IP` = '%s'", GetPlayerIPEx(Player));
  1129. DB::Query(_DB, Query);
  1130. }
  1131. else DB::Free(Result);
  1132. }
  1133.  
  1134. #endif
  1135.  
  1136. printf(" >>> You unfroze %s.", Name(Player));
  1137. SendClientMessage(Player, Color:GREY, "You have been unfrozen by the owner of the server!");
  1138. SendAdminCMD(Player, "Owner of the server unfrozen player %s", Name(Player));
  1139. }
  1140. else PrintError("Player is is not frozen!");
  1141. }
  1142. else PrintError("Player not connected!");
  1143. }
  1144. else PrintError("Invalid Syntax");
  1145. }
  1146. CONSOLE("!freeze")
  1147. {
  1148. if(!sscanf(cmd[7], "u", Player))
  1149. {
  1150. if(Player != (0xFFFF))
  1151. {
  1152. if(!P_DATA[Player][Frozen])
  1153. {
  1154. P_DATA[Player][Frozen] = 1;
  1155. Freeze(Player);
  1156.  
  1157. #if SAVE_FREEZE == true
  1158.  
  1159. new
  1160. Query[256],
  1161. DBResult:R1;
  1162. format(Query, sizeof(Query), "SELECT `Key` FROM `Frozen` WHERE `IP` = '%s'", GetPlayerIPEx(Player));
  1163. R1 = DB::Query(_DB, Query);
  1164.  
  1165. if(R1)
  1166. {
  1167. if(!DB::Valid(R1))
  1168. {
  1169. DB::Free(R1);
  1170. format(Query, sizeof(Query), "INSERT INTO `Frozen` VALUES(NULL, '%s', '1', '%s')",GetPlayerIPEx(Player), Name(Player));
  1171. DB::Query(_DB, Query);
  1172. }
  1173. else
  1174. {
  1175. DB::Free(R1);
  1176. format(Query, sizeof(Query), "UPDATE `Frozen` SET `Frozen` = '1', `RealName` = '%s' WHERE `IP` = '%s'", Name(Player), GetPlayerIPEx(Player));
  1177. DB::Query(_DB, Query);
  1178. }
  1179. }
  1180.  
  1181. #endif
  1182.  
  1183. printf(" >>> You froze %s.", Name(Player));
  1184. SendClientMessage(Player, Color:GREY, "You have been frozen by the owner of the server!");
  1185. SendAdminCMD(Player, "Owner of the server froze player %s", Name(Player));
  1186. }
  1187. else PrintError("Player is already frozen!");
  1188. }
  1189. else PrintError("Player not connected!");
  1190. }
  1191. else PrintError("Invalid Syntax");
  1192. }
  1193. CONSOLE("!unmute")
  1194. {
  1195. if(!sscanf(cmd[7], "u", Player))
  1196. {
  1197. if(Player != (0xFFFF))
  1198. {
  1199. if(P_DATA[Player][Muted])
  1200. {
  1201. P_DATA[Player][Muted] = 0;
  1202. P_DATA[Player][MutedTime] = 0;
  1203.  
  1204. KillTimer(MuteTimer[Player]);
  1205.  
  1206. #if SAVE_MUTE == true
  1207.  
  1208. new
  1209. Query[256];
  1210. format(Query, 256, "DELETE FROM `Muted` WHERE `IP` = '%s'", GetPlayerIPEx(Player));
  1211. DB::Query(_DB, Query);
  1212.  
  1213. #endif
  1214.  
  1215. printf(" >>> You unmuted %s.", Name(Player));
  1216. SendClientMessage(Player, Color:GREY, "You have been unmuted by the owner of the server!");
  1217. SendAdminCMD(Player, "Owner of the server unmuted player %s", Name(Player));
  1218. }
  1219. else PrintError("Player is not muted!");
  1220. }
  1221. else PrintError("Player not connected!");
  1222. }
  1223. else PrintError("Invalid Syntax");
  1224. }
  1225. CONSOLE("!mute")
  1226. {
  1227. if(!sscanf(cmd[5], "uD(0)", Player, P2))
  1228. {
  1229. if(Player != (0xFFFF))
  1230. {
  1231. if(!P_DATA[Player][Muted])
  1232. {
  1233.  
  1234. if(!P2)
  1235. {
  1236. P_DATA[Player][Muted] = 1;
  1237. P_DATA[Player][MutedTime] = 0;
  1238.  
  1239.  
  1240. #if SAVE_MUTE == true
  1241.  
  1242. new
  1243. pQue[256];
  1244.  
  1245. format(pQue, 256, "SELECT `Key` FROM `Muted` WHERE `IP` = '%s'", GetPlayerIPEx(Player));
  1246. new DBResult:R1 = DB::Query(_DB, pQue);
  1247.  
  1248. if(R1)
  1249. {
  1250. if(!DB::Valid(R1))
  1251. {
  1252. DB::Free(R1);
  1253. format(pQue, sizeof (pQue), "INSERT INTO `Muted` VALUES(NULL, '%s', '1', '0', '%s')", GetPlayerIPEx(Player), Name(Player));
  1254. DB::Query(_DB, pQue);
  1255. }
  1256. else
  1257. {
  1258. DB::Free(R1);
  1259. format(pQue, sizeof (pQue), "UPDATE `Muted` SET `Muted` = '1', `Time` = '0', `RealName` = '%s' WHERE `IP` = '%s'", Name(Player), GetPlayerIPEx(Player));
  1260. DB::Query(_DB, pQue);
  1261. }
  1262. }
  1263.  
  1264. #endif
  1265. printf(" >>> You muted %s forever", Name(Player));
  1266. SendAdminCMD(INVALID_PLAYER_ID, "The owner of the server muted player "ORAN"%s[%i]"GREY" forever.", Name(Player), Player);
  1267. SendClientMessage(Player, Color:GREY, "You have been muted forever by the owner of the server!");
  1268. }
  1269. else
  1270. {
  1271. P_DATA[Player][Muted] = 1;
  1272.  
  1273. SendAdminCMD(INVALID_PLAYER_ID, "The owner of the server muted player "ORAN"%s[%i] "GREY"["ORAN"Time: "W"%d"GREY" seconds]", Name(Player), Player, P2);
  1274. FormatMSG(Player, Color:GREY, "You have been muted by the owner of the server! "W"["GREE"Time: "W"%d"GREY" seconds"W"]", P2);
  1275.  
  1276. #if SAVE_MUTE == true
  1277.  
  1278. new
  1279. pQue[256];
  1280.  
  1281. format(pQue, 256, "SELECT `Key` FROM `Muted` WHERE `IP` = '%s'", GetPlayerIPEx(Player));
  1282. new DBResult:R1 = DB::Query(_DB, pQue);
  1283.  
  1284. if(R1)
  1285. {
  1286. if(!DB::Valid(R1))
  1287. {
  1288. DB::Free(R1);
  1289. format(pQue, sizeof (pQue), "INSERT INTO `Muted` VALUES(NULL, '%s', '1', '%d', '%s')", GetPlayerIPEx(Player), P2, Name(Player));
  1290. DB::Query(_DB, pQue);
  1291. }
  1292. else
  1293. {
  1294. DB::Free(R1);
  1295. format(pQue, sizeof (pQue), "UPDATE `Muted` SET `Muted` = '1', `Time` = '%d', `RealName` = '%s' WHERE `IP` = '%s'", P2, Name(Player), GetPlayerIPEx(Player));
  1296. DB::Query(_DB, pQue);
  1297. }
  1298. }
  1299.  
  1300. #endif
  1301. printf(" >>> You muted %s for %d seconds!", Name(Player), P2);
  1302.  
  1303. KillTimer(MuteTimer[Player]);
  1304. MuteTimer[Player] = SetTimerEx("UnMutePlayer", P2, true, "i", Player);
  1305. P_DATA[Player][MutedTime] = P2;
  1306. }
  1307. }else PrintError("Player is already muted!");
  1308. }
  1309. else PrintError("Player not connected!");
  1310. }
  1311. else PrintError("Invalid Syntax");
  1312. }
  1313. CONSOLE("!ban")
  1314. {
  1315. if(!sscanf(cmd[4], "uS(No Reason)[129]", Player, Reason))
  1316. {
  1317. if(Player != (0xFFFF))
  1318. {
  1319. printf(" >>> You banned %s from the server", Name(Player));
  1320. printf(" >>> REASON: %s", Reason);
  1321. SendClientMessage(Player, Color:GREY, " * You have been banned from the server by the owner. ");
  1322. FormatMSG(Player, Color:BLUE, "REASON: "W"%s", Reason);
  1323. SendAdminCMD(INVALID_PLAYER_ID, ""BLUE"%s"GREY" has been banned from the server by the server owner!", Name(Player));
  1324. BanEx2(Player, "CONSOLE OWNER", Reason);
  1325. }
  1326. else PrintError("Player not connected!");
  1327. }
  1328. else PrintError("Invalid Syntax");
  1329. return 1;
  1330. }
  1331. CONSOLE("!kick")
  1332. {
  1333. if(!sscanf(cmd[5], "uS(No Reason)[129]", Player, Reason))
  1334. {
  1335. if(Player != (0xFFFF))
  1336. {
  1337. printf(" >>> You kicked %s from the server", Name(Player));
  1338. printf(" >>> REASON: %s", Reason);
  1339. SendClientMessage(Player, Color:GREY, " * You have been kicked from the server by the owner. ");
  1340. FormatMSG(Player, Color:BLUE, "REASON: "W"%s", Reason);
  1341. KickEx(Player, "CONSOLE OWNER", Reason, false);
  1342. SendAdminCMD(INVALID_PLAYER_ID, ""BLUE"%s"GREY" has been kicked from the server by the server owner!", Name(Player));
  1343. }
  1344. else PrintError("Player not connected!");
  1345. }
  1346. else PrintError("Invalid Syntax");
  1347. return 1;
  1348. }
  1349. CONSOLE("!setrank")
  1350. {
  1351. if(!sscanf(cmd[8], "ud", Player, P2))
  1352. {
  1353. if(Player != (0xFFFF))
  1354. {
  1355. if(P2 > 0 || P2 < sizeof(_Ranks) - 1)
  1356. {
  1357. #if SAVE_IN_LOGS == true
  1358. SaveInLog(SETRANK_LOG, "Owner of the server %s %s from Rank %d to %d on %s", (P_DATA[Player][Rank] < P2) ? ("promoved") : ("demoted"), Name(Player), P_DATA[Player][Rank], P2, zDate());
  1359. #endif
  1360.  
  1361. FormatMSG(Player, Color:GREY, " * The owner of the server %s you to rank "BLUE"%d"GREY" | "BLUE"%s", (P_DATA[Player][Rank] < P2) ? ("promoved") : ("demoted"), P2, RankName(P2));
  1362.  
  1363. printf(" >>> You %s %s to rank to %d | %s.", (P_DATA[Player][Rank] < P2) ? ("promoved") : ("demoted"), Name(Player), P2, RankName(P2));
  1364.  
  1365. P_DATA[Player][Rank] = P2;
  1366. }
  1367. else PrintErrorEx("Maximu rank level is: %d", sizeof(_Ranks) - 1);
  1368. }
  1369. else PrintError("Player not connected!");
  1370. }
  1371. else PrintError("Invalid Syntax");
  1372. return 1;
  1373. }
  1374. CONSOLE("!setvip")
  1375. {
  1376. if(!sscanf(cmd[7], "ud", Player, P2))
  1377. {
  1378. if(Player != (0xFFFF))
  1379. {
  1380. if(P2 < 5 || P2 > 0)
  1381. {
  1382. #if SAVE_IN_LOGS == true
  1383.  
  1384. SaveInLog(SETVIP_LOG, "Owner of the server %s %s from VIP level %d to %d on %s", (P_DATA[Player][Vip] < P2) ? ("promoved") : ("demoted"),Name(Player), P_DATA[Player][Vip], P2, zDate());
  1385. #endif
  1386. P_DATA[Player][Vip] = P2;
  1387. printf(" >>> You %s %s's VIP level to %d.",(P_DATA[Player][Vip] < P2) ? ("promoved") : ("demoted"), Name(Player), P2);
  1388. FormatMSG(Player, Color:GREY, " * The owner of the server %s you to VIP level "BLUE"%d"GREY"", (P_DATA[Player][Vip] < P2) ? ("promoved") : ("demoted"), P2);
  1389. }
  1390. else PrintError("Min. VIP: 0 | Max. VIP: 3");
  1391. }
  1392. else PrintError("Player not connected!");
  1393. }
  1394. else PrintError("Invalid Syntax");
  1395. return 1;
  1396. }
  1397. CONSOLE("!setlevel")
  1398. {
  1399. if(!sscanf(cmd[9], "ud", Player, P2))
  1400. {
  1401. if(Player != (0xFFFF))
  1402. {
  1403. if(P2 < 5 || P2 > 0)
  1404. {
  1405. #if SAVE_IN_LOGS == true
  1406. SaveInLog(SETLEVEL_LOG, "Owner of the server %s %s from %d to %d on %s", (P_DATA[Player][Level] < P2) ? ("promoved") : ("demoted"), Name(Player), P_DATA[Player][Level], P2, zDate());
  1407. #endif
  1408.  
  1409. printf(" >>> You %s %s as %s of the server! (Level: %d)", (P_DATA[Player][Level] < P2) ? ("promoved") : ("demoted"), Name(Player), LevelName(P2), P2);
  1410.  
  1411. P_DATA[Player][Level] = P2;
  1412. FormatMSG(Player, Color:GREY, " * The owner of the server set you as "BLUE"%s"GREY" of the server. (Admin Level: "BLUE"%d"GREY")", LevelName(P2), P2);
  1413. }
  1414. else PrintError("Min. level: 0 | Max. level: 5");
  1415. }
  1416. else PrintError("Player not connected!");
  1417. }
  1418. else PrintError("Invalid Syntax");
  1419. return 1;
  1420. }
  1421. _0CMD("cmds")
  1422. {
  1423. print("Commands trough console of 0Admin System V"#Version"");
  1424. print("------------------------------------------------------\n");
  1425. print(" !setlevel <id> <level>\t!setvip <id> <vip>" );
  1426. print(" !setrank <id> <rank>\t\t!ranks <no params>");
  1427. print(" !kick <id> <reason>\t\t!ban <id> <reason>");
  1428. print(" ![un]mute <id> <time>\t\t![un]freeze <id>");
  1429. print(" ![un]jail <id> <time>\t\t!spawn <id>" );
  1430. print(" !setonline <id> <h> <m> <s>\t!kill <id>" );
  1431. print(" !2012 <id>\t\t\t!stats <id>" );
  1432. }
  1433. _0CMD("features")
  1434. {
  1435.  
  1436. new
  1437. pStr[1_5];
  1438.  
  1439. if(!S_DATA[Ping]) pStr = "\tN/A"; else format(pStr, 1_5, "\t\t%d", S_DATA[Ping]);
  1440. print ("-------------------------------------------------");
  1441. print ("| Feature\t\tState\t\tValue\t|" );
  1442. print ("-------------------------------------------------");
  1443.  
  1444. printf("| Anti Spam\t\t%s%sN/A\t|\n\
  1445. | Anti CMD Spam\t%s%sN/A\t|\n\
  1446. | Ping Kicker\t\t%s%s\t|\n\
  1447. | RCON Protection\t%s%sN/A\t|\n\
  1448. | Tell Player\t\t%s%sN/A\t|\n\
  1449. | Block Chat\t\t%s%sN/A\t|\n\
  1450. | Read PM\t\t%s%sN/A\t|\n\
  1451. | Read Commands\t%s\tN/A\t|",
  1452. Triadic(S_DATA[AntiSpam] ),
  1453. S_DATA[AntiSpam] ? ("\t\t") :("\t"),
  1454. Triadic(S_DATA[AntiCSpam]),
  1455. S_DATA[AntiCSpam] ? ("\t\t") :("\t"),
  1456. Triadic(S_DATA[Ping] ),pStr,
  1457. Triadic(S_DATA[RCONProt] ),
  1458. S_DATA[RCONProt] ? ("\t\t") :("\t"),
  1459. Triadic(S_DATA[TellPlayer]),
  1460. S_DATA[TellPlayer] ? ("\t\t") :("\t"),
  1461. Triadic(S_DATA[Chat] ),
  1462. S_DATA[Chat] ? ("\t\t") :("\t"),
  1463. Triadic(S_DATA[ReadPM] ),
  1464. S_DATA[ReadPM] ? ("\t\t") :("\t"),
  1465. Triadic(S_DATA[ReadCMD] ));
  1466.  
  1467. printf("| AKA\t\t\t%s%sN/A\t|\n\
  1468. | Show Function\t%s%sN/A\t|\n\
  1469. | Anti Repeat\t\t%s%sN/A\t|\n\
  1470. | Auto Login\t\t%s%sN/A\t|\n\
  1471. | Announce Rank\t%s%sN/A\t|\n\
  1472. | Anti Advertising\t%s%sN/A\t|",
  1473. Triadic(S_DATA[AKA] ),
  1474. S_DATA[AKA] ? ("\t\t") :("\t"),
  1475. Triadic(S_DATA[ShowFunction]),
  1476. S_DATA[ShowFunction] ? ("\t\t") :("\t"),
  1477. Triadic(S_DATA[AntiRepeat] ),
  1478. S_DATA[AntiRepeat] ? ("\t\t") :("\t"),
  1479. Triadic(S_DATA[AutoLogin] ),
  1480. S_DATA[AutoLogin] ? ("\t\t") :("\t"),
  1481. Triadic(S_DATA[AnnRank] ),
  1482. S_DATA[AnnRank] ? ("\t\t") :("\t"),
  1483. Triadic(S_DATA[AntiAD] ),
  1484. S_DATA[AntiAD] ? ("\t\t") :("\t"));
  1485. print ("-------------------------------------------------");
  1486. }
  1487. _0CMD("info")
  1488. {
  1489. print("\n\n\n");
  1490. print("Informations about 0Admin System V"#Version"");
  1491. print("------------------------------------------------------\n");
  1492. print(" - The idea of creating a new and optimised Admin System came\n\
  1493. to me when i was seeing all these new and old fashioned admin\n\
  1494. scripts with the oldest functions and less optimisation.\n\
  1495. So i decided to start working on a new and unique admin script\n\
  1496. that everyone will enjoy no mather what server you own,\n\
  1497. Stunt, RP, Freeroam, Trucking, etc.\n");
  1498. print(" - The system is provided with the fastest functions like sscanf\n\
  1499. ZCMD - the almost fastest command processor and of course\n\
  1500. using Regular Expresions to detect an advertising in chat.\n\n \
  1501. - The system is mostly based on dialogs, for example Control Panel\n\
  1502. which is available for Admins and VIP or regular members to control\n\
  1503. and use them whenever they need with a vast ease.\n");
  1504. print(" - The basic idea was to let all kind of people that don't know\n\
  1505. the basics or it's new into this kind of game. That's the main\n\
  1506. reason for using so many dialogs, because many don't really know\n\
  1507. or forgot commands name, so I decidede to pack everything up\n\
  1508. and insert it into a dialog.\n");
  1509. print(" - The story ends here, main reason was told. ");
  1510. print("------------------------------------------------------\n");
  1511.  
  1512. }
  1513. _0CMD("credits")
  1514. {
  1515. print("\n\n\n");
  1516. print("Credits to those that helped building 0Admin System V"#Version"");
  1517. print("-------------------------------------------------------------------\n");
  1518. print(" > Helpers: " );
  1519. print("\t sOnGoKu - Helped with the major tests and always reliable" );
  1520. print("\t ScEpTyK - Testing." );
  1521. print("\t Rock - Testing the Anti-Mute/Jail/Freeze." );
  1522. print("\t XpLoD - Gave me some ideas for the script." );
  1523. print("\t FarSe - Opened to me the way of SQLite and its magic.\n" );
  1524. print(" > Scipts:" );
  1525. print("\t Y_Less - For Y_Ini, sscanf2 and foreach also optimisation tips.");
  1526. print("\t ZeeX - For ZCMD, the almost fastest command processor");
  1527. print("\t Fro1sha - Regular expressions\n" );
  1528. print("-------------------------------------------------------------------");
  1529. print(" > And the creator is Zh3r0." );
  1530. print("------" );
  1531. }
  1532. if(!strcmp(cmd, "!help", true))
  1533. {
  1534. print("\n\n\n");
  1535. print("Help for 0Admin System V"#Version"");
  1536. print("--------------------------------------------------------");
  1537. print(" # Type !0cmds to use a command inside a server." );
  1538. print(" # Type !0credits to see the credits." );
  1539. print(" # Type !0info to see informations about this system." );
  1540. print(" # Type !0FAQ for answers to your problems." );
  1541. print(" # Type !0svstats to see the stats of the server." );
  1542. print(" # Type !0features to see enabled/disabled features." );
  1543. print("--------------------------------------------------------");
  1544. print(" > Check often the forums for new updates!");
  1545. print("------");
  1546. }
  1547. if(!strcmp(cmd, "reload0", true))
  1548. {
  1549. SendRconCommand("reloadfs 0Admin");
  1550. print("Reloading 0Admin!");
  1551. }
  1552. return 1;
  1553. }
  1554.  
  1555. #if USE_RANKS == true
  1556. CheckRank(killer, rank)
  1557. {
  1558. if(P_DATA[killer][Kills] == _Ranks[rank][iRank])
  1559. return 1;
  1560.  
  1561. return 0;
  1562. }
  1563. AnnounceRank(killer, rank)
  1564. {
  1565. new Str[256];
  1566. format(Str, sizeof (Str), "RANK UP: "GREY" You are now a member with Rank "ORAN"%d"GREY" |"ORAN" %s", rank, RankName(rank));
  1567. SendClientMessage(killer, Color:ORAN, Str);
  1568. SetPVarInt(killer, "0_Rank", rank);
  1569. P_DATA[killer][Rank] = rank;
  1570. if(S_DATA[AnnRank])
  1571. {
  1572. format(Str, sizeof (Str), "*** "ORAN"%s[%i]"GREY" ranked up! With "ORAN"%d"GREY" kills and from now on must be known as "ORAN"%s"GREY" !", Name(killer), killer, P_DATA[killer][Kills], RankName(rank));
  1573. foreach(Player, k){
  1574. if(k != killer){
  1575. SendClientMessage(k, Color:GREY, Str);
  1576. }
  1577. }
  1578. }
  1579. #if UPDATE_TOP_ALWAYS == true
  1580.  
  1581. new
  1582. Query[256],
  1583. DBResult: R1;
  1584.  
  1585.  
  1586. format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(killer));
  1587. R1 = DB::Query(_DB, Query);
  1588.  
  1589. if(R1)
  1590. {
  1591. if(DB::Valid(R1))
  1592. {
  1593. DB::Free(R1);
  1594. format(Query, sizeof(Query), "UPDATE `Top` SET `Rank` = '%d' WHERE `Name` = '%s'", rank, Name(killer));
  1595. DB::Query(_DB, Query);
  1596. }
  1597. else
  1598. {
  1599. DB::Free(R1);
  1600. format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`, `Rank`) VALUES('%s','%d')", Name(killer), rank);
  1601. DB::Query(_DB, Query);
  1602. }
  1603. }
  1604. #endif
  1605. }
  1606. #endif
  1607.  
  1608. public OnPlayerDeath(playerid, killerid, reason)
  1609. {
  1610. if(killerid != INVALID_PLAYER_ID)
  1611. {
  1612. P_DATA[killerid][Kills]++;
  1613. SetPVarInt(killerid, "0_Kills", GetPVarInt(killerid, "0_Kills") + 1);
  1614. }
  1615. P_DATA[playerid][Deaths]++;
  1616. SetPVarInt(playerid, "0_Deaths",GetPVarInt(playerid, "0_Deaths") + 1);
  1617.  
  1618. #if UPDATE_TOP_ALWAYS == true
  1619.  
  1620. new
  1621. Query[256],
  1622. DBResult:R1;
  1623.  
  1624.  
  1625. format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(playerid));
  1626. R1 = DB::Query(_DB, Query);
  1627.  
  1628. if(R1)
  1629. {
  1630. if(DB::Valid(R1))
  1631. {
  1632. DB::Free(R1);
  1633. format(Query, sizeof(Query), "UPDATE `Top` SET `Deaths` = '%d', `Ratio` = '%f' WHERE `Name` = '%s'", P_DATA[playerid][Deaths], (Float:P_DATA[playerid][Kills] / Float:P_DATA[playerid][Deaths]), Name(playerid));
  1634. DB::Query(_DB, Query);
  1635. }
  1636. else
  1637. {
  1638. DB::Free(R1);
  1639. format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`, `Deaths`, `Ratio`) VALUES('%s', '%d', '%f')",Name(playerid), P_DATA[playerid][Deaths], (Float:P_DATA[playerid][Kills] / Float:P_DATA[playerid][Deaths]));
  1640. DB::Query(_DB, Query);
  1641. }
  1642. }
  1643. if(killerid != (0xFFFF))
  1644. {
  1645. format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(killerid));
  1646. R1 = DB::Query(_DB, Query);
  1647.  
  1648. if(R1)
  1649. {
  1650. if(DB::Valid(R1))format(Query, sizeof(Query), "UPDATE `Top` SET `Kills` = '%d', `Ratio` = '%f' WHERE `Name` = '%s'", P_DATA[killerid][Kills], (Float:P_DATA[killerid][Kills] / Float:P_DATA[killerid][Deaths]), Name(killerid));
  1651. else format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`, `Kills`, `Ratio`) VALUES('%s', '%d', '%f')", Name(killerid), P_DATA[killerid][Kills], (Float:P_DATA[killerid][Kills] / Float:P_DATA[killerid][Deaths]));
  1652.  
  1653. DB::Free(R1);
  1654. DB::Query(_DB, Query);
  1655. }
  1656. }
  1657.  
  1658.  
  1659. #endif
  1660.  
  1661. #if USE_RANKS == true
  1662.  
  1663. if (CheckRank(killerid, 1))AnnounceRank(killerid, 1);
  1664. else if(CheckRank(killerid, 2))AnnounceRank(killerid, 2);
  1665. else if(CheckRank(killerid, 3))AnnounceRank(killerid, 3);
  1666. else if(CheckRank(killerid, 4))AnnounceRank(killerid, 4);
  1667. else if(CheckRank(killerid, 5))AnnounceRank(killerid, 5);
  1668. else if(CheckRank(killerid, 6))AnnounceRank(killerid, 6);
  1669. else if(CheckRank(killerid, 7))AnnounceRank(killerid, 7);
  1670. else if(CheckRank(killerid, 8))AnnounceRank(killerid, 8);
  1671.  
  1672. #endif
  1673. return 1;
  1674. }
  1675. CMD:gmx(PARAMS)
  1676. {
  1677. SendRconCommand("gmx");
  1678. return 1;
  1679. }
  1680.  
  1681. Detour<acmds,0cmds>
  1682. Detour<ahelp,0cmds>
  1683. Detour<admincmds,0cmds>
  1684. Detour<ac,0cmds>
  1685.  
  1686.  
  1687. CMD:arules(PARAMS)
  1688. {
  1689. LoginCheck(playerid);
  1690.  
  1691. new String[2_000];
  1692.  
  1693. switch(P_DATA[playerid][Level])
  1694. {
  1695. case 0:
  1696. {
  1697. strcat(String, ""W"["BLUE"0"W"] "BLUE"Member"W"\n\
  1698. - Don't do anything stupid.\n\
  1699. - You are just a player under rules!", 2_000);
  1700. }
  1701. case 1:
  1702. {
  1703. strcat(String, ""W"["BLUE"1"W"] "BLUE"Helper"W"\n\
  1704. - Make sure players have what they need, like time, weather.\n\
  1705. - Make sure when a player asks for help to give them the appropriate response.\n\
  1706. - You are just a helper! Don't act cocky! Act like a helper!\n\
  1707. - Dealing with players that surpass your abillities? Ask for help to the superiors!\n\n", 2_000);
  1708. }
  1709. case 2:
  1710. {
  1711. strcat(String, "["BLUE"2"W"] "BLUE"Mini Moderator"W"\n\
  1712. - You have somewhat control over the players. You can mute/freeze them.\n\
  1713. - If you notice a hacker or someone with illegal weapons, use "BLUE"/disarm"W".\n\
  1714. - When a players asks for something, do it, like change skin, heal car etc..\n\
  1715. - Use "BLUE"/bankrupt"W" to remove player's money if you they hack.\n\n", 2_000);
  1716. }
  1717. case 3:
  1718. {
  1719. strcat(String, "["BLUE"3"W"] "BLUE"Moderator"W"\n\
  1720. - You are a full moderator, your job is to take care of the server while superiors are offline\n\
  1721. - Make sure nobody spams the chat, use "BLUE"/clearchat"W" to clear the chat just in case.\n\
  1722. - You can manipulate player's account, like set his time,skin,cookies,money,score,kills etc..\n\
  1723. - Your abilities are high enough! Use with caution!\n\n", 2_000);
  1724. }
  1725. case 4:
  1726. {
  1727. strcat(String, "["BLUE"4"W"] "BLUE"Administrator"W"\n\
  1728. - No proper rules for you.\n\
  1729. - Do whatever you think it's right.\n\
  1730. - Lower level member may not judge your actions.\n\n", 2_000);
  1731. }
  1732. case 5:
  1733. {
  1734. strcat(String, "["BLUE"5"W"] "BLUE"Owner"W"\n\
  1735. - Lower level member may not judge your actions.\n\
  1736. - Do whatever you want.", 2_000);
  1737. }
  1738. }
  1739.  
  1740. Show(String);
  1741. return 1;
  1742. }
  1743.  
  1744. CMD:0cmds(PARAMS)
  1745. {
  1746. LoginCheck(playerid);
  1747.  
  1748.  
  1749. switch(P_DATA[playerid][Level])
  1750. {
  1751. case 0:
  1752. {
  1753. Show(""BLUE"Normal Member"W"\n\
  1754. /register /login /stats /pm /admins /vips /top /time changepass(/cpass)\n\
  1755. /cookies /buycookies /eatcookie /buycookiesjar /giftcookie /cookieshelp\n\n\
  1756. "BLUE"Remember to read the rules of your level!!");
  1757.  
  1758. }
  1759. case 1:
  1760. {
  1761. Show(""BLUE"Helper"W"\n\
  1762. /goto /gotopos /getip /settime /spawn /acar /jailed /frozen\n\
  1763. /muted /car /acar /accp /unblock /cargod /god\n\n\
  1764. "BLUE"Remember to read the rules at "BLUE"/arules!");
  1765. }
  1766. case 2:
  1767. {
  1768. Show(""BLUE"Mini Moderator"W"\n\
  1769. /disarm /bankrupt /tplayer /eject /heal /spec /show /setskin\n\
  1770. /[un]freeze /[un]mute /aweapons /healcar /setvhealth /carcolor\n\
  1771. /ann /ann2 /aka\n\
  1772. "BLUE"Remember to read the rules at "BLUE"/arules!");
  1773. }
  1774. case 3:
  1775. {
  1776. Show(""BLUE"Moderator"W"\n\
  1777. /giveweapon /warn /healall /heal /aweapons /givecar /write /destroyv\n\
  1778. /[un]jail /slap /clearchat /akill /explode /setalltime /setallweather\n\
  1779. /set(cookies|health|armour|score|cash|skin|time|weather|world|interior|drunk|respect|wanted)\n\n\
  1780. "BLUE"Remember to read the rules at "BLUE"/arules!");
  1781. }
  1782. case 4:
  1783. {
  1784. new Str[600];
  1785. strcat(Str, \
  1786. ""BLUE"Administrator"W"\n\
  1787. /setall(health|armour|score|cash|skin|world|interior|drunk|cookies|respect|wanted)\n\
  1788. /giveall(h(ealth)|armour|score|cash|cookies|wanted|weapon)\n\
  1789. /kick /wcheck /setdeaths /setkills /2012 /resetallrespect /killall\n", 600);
  1790.  
  1791. strcat(Str, \
  1792. "/[un]muteall /[un]freezeall /spawnall /2012all /chat /slapall\n\
  1793. /disarmall /explodeall\n\n\
  1794. "BLUE"Remember to read the rules at "BLUE"/arules!", 600);
  1795.  
  1796. Show(Str);
  1797. }
  1798. case 5:
  1799. {
  1800. Show(""BLUE"Owner"W"\n\
  1801. /setlevel /settemplevel /ban /unban /acp /respawncars /removeacc\n\
  1802. /setonline /setstat /fake /fakechat /fakecmd /fakecon /fakedisc /fakedeath\n\
  1803. /kickall /banall\n\n\
  1804. "BLUE"Remember to read the rules at "BLUE"/arules!");
  1805.  
  1806. }
  1807. }
  1808. return 1;
  1809. }
  1810. CMD:announce2(PARAMS)
  1811. {
  1812. SendClientMessage(playerid, Color:GREY, "Use "BLUE"/ann2"GREY" instead!");
  1813. return 1;
  1814. }
  1815. CMD:announce(PARAMS)
  1816. {
  1817. SendClientMessage(playerid, Color:GREY, "Use "BLUE"/ann"GREY" instead!");
  1818. return 1;
  1819. }
  1820. CMD:changepass(PARAMS)
  1821. {
  1822. SendClientMessage(playerid, Color:GREY, "Use "BLUE"/cpass"GREY" instead!");
  1823. return 1;
  1824. }
  1825. CMD:cpass(PARAMS)
  1826. {
  1827. LoginCheck(playerid);
  1828.  
  1829. new OldPass[MAX_PASS_LEN], NewPass[MAX_PASS_LEN];
  1830. if(sscanf(params, "s[20]s[20]", OldPass, NewPass)) return SendUsage(playerid, "/cpass "GREY"<old pass> <new pass>", "Will change your password.");
  1831. else
  1832. {
  1833. if(strlen(NewPass) < MIN_PASS_LEN || strlen(NewPass) > MAX_PASS_LEN)
  1834. return SendError(playerid, "The new password has an invalid length!");
  1835.  
  1836. new Query[300], DBResult:Result, Buf[129];
  1837. WP_Hash(Buf, 129, OldPass);
  1838. format(Query, 300, "SELECT `Key` FROM `Accounts` WHERE `Name` = '%s' AND `Password` = '%s'", Name(playerid), Buf);
  1839. Result = DB::Query(_DB, Query);
  1840.  
  1841. if(Result)
  1842. {
  1843. if(DB::Valid(Result))
  1844. {
  1845. DB::Free(Result);
  1846. WP_Hash(Buf, 129, NewPass);
  1847. format(Query, 300, "UPDATE `Accounts` SET `Password` = '%s', `RPassword` = '%s' WHERE `Name` = '%s'", Buf, OldPass, Name(playerid));
  1848. DB::Query(_DB, Query);
  1849.  
  1850. FormatMSG(playerid, Color:GREY, "Password changed! New password is: "BLUE"%s", NewPass);
  1851. SendAdminCMD(playerid, "PLayer "ORAN"%s[%i]"GREY" changed his password!", Name(playerid), playerid);
  1852. }
  1853. else
  1854. {
  1855. DB::Free(Result);
  1856. return SendError(playerid, "Old Password doesn't match the current password!");
  1857. }
  1858. }
  1859. }
  1860. return 1;
  1861. }
  1862.  
  1863.  
  1864. CMD:ann2(PARAMS)
  1865. {
  1866. LoginCheck(playerid);
  1867. LevelCheck(playerid, 2);
  1868.  
  1869. new Announce[129], Time, Style;
  1870. if(sscanf(params, "s[129]dd", Announce, Time, Style)) return SendUsage(playerid, "/ann2 "GREY"<text> <time> <style>", "Send a text to the server with style and time. (Time is in ms)");
  1871. else
  1872. {
  1873. if(Style > 6 || Style < 0) return SendError(playerid, "Style: 0-6");
  1874. GameTextForAll(Announce, Time, Style );
  1875. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" used command "ORAN"/ann2", Name(playerid), playerid);
  1876. SendClientMessage(playerid, Color:GREY, "Announce sent!");
  1877. }
  1878. return 1;
  1879. }
  1880. CMD:ann(PARAMS)
  1881. {
  1882. LoginCheck(playerid);
  1883. LevelCheck(playerid, 2);
  1884.  
  1885. new Announce[129];
  1886. if(sscanf(params, "s[129]", Announce)) return SendUsage(playerid, "/ann "GREY"<text>", "Will show a text in the middle of the screen!");
  1887. else
  1888. {
  1889. GameTextForAll(Announce, 7000, 3 );
  1890. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" used command "ORAN"/ann", Name(playerid), playerid);
  1891. SendClientMessage(playerid, Color:GREY, "Announce sent!");
  1892. }
  1893. return 1;
  1894. }
  1895. CMD:aka(PARAMS)
  1896. {
  1897. LoginCheck(playerid);
  1898. LevelCheck(playerid, 2);
  1899.  
  1900. new Player;
  1901. if(sscanf(params, "u", Player)) return SendUsage(playerid, "/aka "GREY"<id>", "Will show the aka list of a player");
  1902. else
  1903. {
  1904. if(Player == 0xFFFF)
  1905. return SendError(playerid, "Player not connected!");
  1906.  
  1907. INI_ParseFile(AKA_FILE, "LoadAKA", .bExtra = true, .extra = Player);
  1908.  
  1909. if(strlen(GPVSEx(Player, "pAKA")) > 3)
  1910. {
  1911. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" is viewing the aka list of "ORAN"%s[%i]", Name(playerid), playerid, Name(Player), Player);
  1912. FormatMSG(playerid, Color:GREY, "Player "ORAN"%s"GREY" has used the following names: "ORAN"%s"GREY".", Name(Player), GPVSEx(Player, "pAKA"));
  1913. }
  1914. else
  1915. {
  1916. SendError(playerid, "An error has occured");
  1917. }
  1918. }
  1919. return 1;
  1920. }
  1921. CMD:unblock(PARAMS)
  1922. {
  1923. LoginCheck(playerid);
  1924. LevelCheck(playerid, 1);
  1925.  
  1926. new Player;
  1927. if(sscanf(params, "u", Player)) return SendUsage(playerid, "/unblock "GREY"<id>", "Will unstuck a player");
  1928. else
  1929. {
  1930. TogglePlayerControllable(Player, true);
  1931.  
  1932. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" unblocked player "ORAN"%s[%i]", Name(playerid), playerid, Name(Player), Player);
  1933. FormatMSG(playerid, Color:GREY, "You unstucked player "ORAN"%s[%i]", Name(Player), Player);
  1934. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" unblocked you", Name(playerid), playerid);
  1935. }
  1936. return 1;
  1937. }
  1938. CMD:time(PARAMS)
  1939. {
  1940. LoginCheck(playerid);
  1941.  
  1942. new T[2], Str[10];
  1943. gettime(T[0], T[1]);
  1944. format(Str, 10, "~r~%d~w~:~r~%d", T[0], T[1]);
  1945. GameTextForPlayer(playerid, Str, 3000, 1);
  1946.  
  1947. return 1;
  1948. }
  1949. CMD:cargod(PARAMS)
  1950. {
  1951. LoginCheck(playerid);
  1952. LevelCheck(playerid, 1);
  1953.  
  1954. switch(P_DATA[playerid][CarGod])
  1955. {
  1956. case false:
  1957. {
  1958. P_DATA[playerid][CarGod] = 1;
  1959. SetPVarInt(playerid, "0_CarGod", 1);
  1960. SendClientMessage(playerid, Color:GREY, "Vehicle God has been activated!");
  1961. }
  1962. case true:
  1963. {
  1964. P_DATA[playerid][CarGod] = 0;
  1965. SetPVarInt(playerid, "0_CarGod", 0);
  1966. SendClientMessage(playerid, Color:GREY, "Vehicle God has been deactivated!");
  1967.  
  1968. }
  1969. }
  1970. return 1;
  1971. }
  1972. CMD:god(PARAMS)
  1973. {
  1974. LoginCheck(playerid);
  1975. LevelCheck(playerid, 1);
  1976.  
  1977. switch(P_DATA[playerid][God])
  1978. {
  1979. case false:
  1980. {
  1981. P_DATA[playerid][God] = 1;
  1982. SetPVarInt(playerid, "0_God", 1);
  1983. SendClientMessage(playerid, Color:GREY, "Godlike has been activated!");
  1984. }
  1985. case true:
  1986. {
  1987. P_DATA[playerid][God] = 0;
  1988. SetPVarInt(playerid, "0_God", 0);
  1989. SendClientMessage(playerid, Color:GREY, "Godlike has been deactivated!");
  1990.  
  1991. }
  1992. }
  1993. return 1;
  1994. }
  1995.  
  1996.  
  1997. CMD:pcp(PARAMS)
  1998. {
  1999. LoginCheck(playerid);
  2000.  
  2001. SPD(playerid, Dialog:PCP, LIST, "Player control panel", PcPanel(playerid), "ON/Select", "OFF/Exit");
  2002. return 1;
  2003. }
  2004.  
  2005. CMD:record(playerid)
  2006. {
  2007. LoginCheck(playerid);
  2008.  
  2009. new
  2010. Str[1024];
  2011. format(Str, sizeof (Str), ""W"Record details:\n\n\
  2012. "GREE"NEW RECORD:\n\
  2013. "GREY"Broken by: "BLUE"%s\n\
  2014. "GREY"Date: "BLUE"%d/%d/%d\n\
  2015. "GREY"Time: "BLUE"%d:%d:%d\n\
  2016. "GREY"Record: "BLUE"%d "GREY"players",
  2017. S_DATA[RecordBy],
  2018. S_DATA[sD], S_DATA[sM], S_DATA[sY],
  2019. S_DATA[sH], S_DATA[sMi], S_DATA[sS],
  2020. S_DATA[sRecord]);
  2021.  
  2022. new
  2023. Field[4][64],
  2024. DBResult: R1;
  2025.  
  2026. R1 = DB::Query(_DB, "SELECT `ByOLD`, `DateOLD`, `TimeOLD` FROM `Record`;");
  2027. if(DB::Valid(R1))
  2028. {
  2029. DB::GetField(R1, "ByOLD", Field[0], 64);
  2030. DB::GetField(R1, "DateOLD", Field[1], 64);
  2031. DB::GetField(R1, "TimeOLD", Field[2], 64);
  2032. DB::Free(R1);
  2033. }
  2034. else
  2035. {
  2036. DB::Free(R1);
  2037. Field[0] = "Nobody"; Field[1] = "Never"; Field[2] = "Never";
  2038. }
  2039. format(Str, sizeof (Str), "%s\n\n{FF0000}OLD RECORD:\n\
  2040. "GREY"Broken by: "ORAN"%s\n\
  2041. "GREY"Date: "ORAN"%s\n\
  2042. "GREY"Time: "ORAN"%s\n\
  2043. "GREY"Record: "ORAN"%d "GREY"players",
  2044. Str,
  2045. Field[0], Field[1], Field[2], S_DATA[sRecord] - 1);
  2046. SPD(playerid, Dialog:Empty, BOX, ""W"Players record!", Str, "Close", "");
  2047. return 1;
  2048. }
  2049.  
  2050. public OnPlayerConnect(playerid)
  2051. {
  2052. if(IsPlayerNPC(playerid)) return 1;
  2053.  
  2054. new DBResult:bResult, bQuery[129];
  2055. format(bQuery, 129, "SELECT `IP`, `Reason`, `Admin`, `BanDate` FROM `Banlist` WHERE `Name` = '%s';", Name(playerid));
  2056. bResult = DB::Query(_DB, bQuery);
  2057.  
  2058. new bField[4][129], Field[50];
  2059. if(bResult)
  2060. {
  2061. if(DB::Valid(bResult))
  2062. {
  2063. DB::GetField(bResult, "Reason", bField[0], 129);
  2064. DB::GetField(bResult, "Admin", bField[1], 129);
  2065. DB::GetField(bResult, "BanDate", bField[2], 129);
  2066.  
  2067. DB::Free(bResult);
  2068. for (new i = 0; i < 10; i++)SendClientMessage(playerid, -1, " ");
  2069.  
  2070. SendClientMessage(playerid, Color:ORAN, "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *");
  2071. SendClientMessage(playerid, Color:ORAN, "BANNED:"W" Sorry to inform you, but this account is "ORAN"banned"W" from this server!");
  2072. FormatMSG(playerid, ~1, "You were banned by Administrator "ORAN"%s"W" on "ORAN"%s"W" with the following reason:", bField[1], bField[2]);
  2073. SendClientMessage(playerid, Color:ORAN, bField[0]);
  2074.  
  2075. KickEx(playerid, "System", "Banned Account", true);
  2076.  
  2077. return 0;
  2078. }
  2079. else
  2080. {
  2081. DB::Free(bResult);
  2082.  
  2083. new DBResult:bResult2;
  2084. format(bQuery, 129, "SELECT `IP`, `Name`, `Reason`, `Admin`, `BanDate` FROM `Banlist` WHERE `IP` = '%s';", GetPlayerIPEx(playerid));
  2085. bResult2 = DB::Query(_DB, bQuery);
  2086.  
  2087. if(bResult2)
  2088. {
  2089. if(DB::Valid(bResult2))
  2090. {
  2091. loop(i, 4){ bField[_i][0] = '\0'; }
  2092. DB::GetField(bResult2, "IP", bField[3], 129);
  2093. if(!strcmp(GetPlayerIPEx(playerid), bField[3]))
  2094. {
  2095. DB::GetField(bResult2, "Reason", bField[0], 129);
  2096. DB::GetField(bResult2, "Admin", bField[1], 129);
  2097. DB::GetField(bResult2, "BanDate", bField[2], 129);
  2098.  
  2099. DB::Free(bResult2);
  2100. loop(o, 10){ SendClientMessage(playerid, -1, " "); }
  2101.  
  2102. SendClientMessage(playerid, Color:ORAN, "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *");
  2103. SendClientMessage(playerid, Color:ORAN, "BANNED:"W" Sorry to inform you, but this account is "ORAN"banned"W" from this server!");
  2104. FormatMSG(playerid, -1, "You were banned by Administrator "ORAN"%s"W" on "ORAN"%s"W" with the following reason:", bField[1], bField[2]);
  2105. SendClientMessage(playerid, Color:ORAN, bField[0]);
  2106.  
  2107. KickEx(playerid, "System", "Banned Account", true);
  2108. return 0;
  2109. }
  2110. }else DB::Free(bResult2);
  2111. }
  2112. }
  2113. }
  2114.  
  2115. S_DATA[sPlayers] ++;
  2116.  
  2117. if(S_DATA[sRecord] < S_DATA[sPlayers])
  2118. {
  2119. new
  2120. Date[6],
  2121. Query[256];
  2122.  
  2123. getdate(Date[2], Date[1], Date[0]);
  2124. gettime(Date[3], Date[4], Date[5]);
  2125.  
  2126. if(!strlen(S_DATA[RecordBy])) format(S_DATA[RecordBy], MAX_PLAYER_NAME, "Nobody");
  2127. format(Query, sizeof (Query), "UPDATE `Record` SET `Players` = '%d', `Date` = '%d/%d/%d', `Time` = '%d:%d:%d', `By` = '%s', `DateOLD` = '%d/%d/%d', `TimeOLD` = '%d:%d:%d', `ByOLD` = '%s'",\
  2128. S_DATA[sPlayers], Date[0], Date[1], Date[2], Date[3], Date[4], Date[5], Name(playerid), S_DATA[sD], S_DATA[sM], S_DATA[sY], S_DATA[sH], S_DATA[sMi], S_DATA[sS], S_DATA[RecordBy]);
  2129.  
  2130. DB::Query(_DB, Query);
  2131.  
  2132. getdate(S_DATA[sY], S_DATA[sM], S_DATA[sD]);
  2133. gettime(S_DATA[sH], S_DATA[sMi], S_DATA[sS]);
  2134.  
  2135.  
  2136. SendClientMessage(playerid, -1, " ");
  2137. SendClientMessage(playerid, -1, " ");
  2138. SendClientMessage(playerid, -1, " ");
  2139. SendClientMessage(playerid, Color:BLUE, "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ");
  2140. FormatMSG(playerid, Color:BLUE, "RECORD BROKEN!! "GREY"You broke "BLUE"%s"GREY"'s record of "BLUE"%d"GREY" most players online!", S_DATA[RecordBy], S_DATA[sRecord]);
  2141. SendClientMessage(playerid, Color:GREY, "Use "BLUE"/record"GREY" to check more details!");
  2142. SendClientMessage(playerid, Color:BLUE, "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ");
  2143. SendClientMessage(playerid, -1, " ");
  2144. SendClientMessage(playerid, -1, " ");
  2145. foreach(Player, i)
  2146. {
  2147. if(i != playerid)
  2148. {
  2149. FormatMSG(i, Color:BLUE, "*** %s "GREY" broke "BLUE"%s"GREY"'s record of "BLUE"%d"GREY" most players online!", Name(playerid), S_DATA[RecordBy], S_DATA[sRecord]);
  2150. SendClientMessage(i, Color:GREY, "Use "BLUE"/record"GREY" to check more details!");
  2151. }
  2152. }
  2153. format(S_DATA[RecordBy], MAX_PLAYER_NAME, "%s", Name(playerid));
  2154. S_DATA[sRecord] = S_DATA[sPlayers];
  2155. }
  2156.  
  2157. format(PlayerIP[playerid], 50, "%s", GetPlayerIPEx(playerid));
  2158.  
  2159. SetPVarInt(playerid, "FirstConnection", 1);
  2160. new String[256];
  2161.  
  2162. if(!S_DATA[AKA])
  2163. {
  2164. format(String, sizeof (String), "%s["W"%i"ORAN"]"W" Has joined the server!", Name(playerid), playerid);
  2165. SendClientMessageToAll(Color:ORAN, String);
  2166. }
  2167. else
  2168. {
  2169. INI_ParseFile(AKA_FILE, "LoadAKA", .bExtra = true, .extra = playerid);
  2170.  
  2171.  
  2172. if(strlen(GPVSEx(playerid, "pAKA")) < 3)
  2173. {
  2174. format(String, sizeof (String), "%s["W"%i"ORAN"]"W" Has joined the server!", Name(playerid), playerid);
  2175. }
  2176. else if(!strcmp(GPVSEx(playerid, "pAKA"), Name(playerid), true))
  2177. {
  2178. format(String, sizeof (String), "%s["W"%i"ORAN"]"W" Has joined the server!", Name(playerid), playerid);
  2179. }
  2180. else format(String, sizeof (String), "%s["W"%i"ORAN"]"W" Has joined the server!"GREY"[AKA:"W" %s"GREY"]",Name(playerid), playerid, GPVSEx(playerid, "pAKA"));
  2181.  
  2182. foreach(Player, i)
  2183. {
  2184. if(P_DATA[i][Level] > 2)
  2185. {
  2186. if(i != playerid)SendClientMessage(i, Color:ORAN, String);
  2187. }
  2188. else
  2189. {
  2190. format(String, sizeof (String),"%s["W"%i"ORAN"]"W" Has joined the server!", Name(playerid), playerid);
  2191. SendClientMessage(i, Color:ORAN, String);
  2192. }
  2193. }
  2194.  
  2195. new pIP[30];
  2196. GetPlayerIp(playerid, pIP, 30);
  2197.  
  2198.  
  2199. //INI_ParseFile(AKA_FILE, "LoadAKA", .bExtra = true, .extra = playerid);
  2200. if(!strlen(GPVSEx(playerid, "pAKA")))
  2201. {
  2202. new INI: pAka = INI_Open(AKA_FILE);
  2203. INI_WriteString(pAka, pIP, Name(playerid));
  2204. INI_Close(pAka);
  2205. }
  2206. else
  2207. {
  2208. if(strfind(GPVSEx(playerid, "pAKA"), Name(playerid), true) == -1)
  2209. {
  2210. new Str[256];
  2211. format (Str, 256, "%s,%s", GPVSEx(playerid, "pAKA"), Name(playerid));
  2212. new INI: pAka = INI_Open(AKA_FILE);
  2213. INI_WriteString(pAka, pIP, Str);
  2214. INI_Close(pAka);
  2215. }
  2216. }
  2217. }
  2218. P_DATA[playerid][ConnTime] = gettime();
  2219. P_DATA[playerid][LogFail] = MAX_PASS_FAIL;
  2220. P_DATA[playerid][Spec_ID] = 0xFFFF;
  2221. P_DATA[playerid][Spec_Type] = ADMIN_SPEC_TYPE_NONE;
  2222.  
  2223. ClearVars(playerid);
  2224.  
  2225.  
  2226. #if SAVE_FREEZE == true
  2227.  
  2228. new Query[256];
  2229.  
  2230. format(Query, sizeof (Query), "SELECT `Key`, `Frozen`, `RealName` FROM `Frozen` WHERE `IP` = '%s';", GetPlayerIPEx(playerid));
  2231. new DBResult:Result1 = DB::Query(_DB, Query);
  2232.  
  2233. if(Result1)
  2234. {
  2235. if(DB::Valid(Result1))
  2236. {
  2237. new xField[64];
  2238.  
  2239. DB::GetField(Result1, "RealName", xField, 64);
  2240. SetPVarString(playerid, "FreezeName", xField);
  2241.  
  2242. DB::GetField(Result1, "Frozen", xField, 64);
  2243. P_DATA[playerid][Frozen] = strval(xField);
  2244.  
  2245. DB::Free(Result1);
  2246. }
  2247. else
  2248. {
  2249. DB::Free(Result1);
  2250. format(Query, 256, "SELECT `IP`, `Frozen`, `RealName` FROM `Frozen` WHERE `RealName` = '%s';", Name(playerid));
  2251. new DBResult:Result2 = DB::Query(_DB, Query);
  2252.  
  2253. if(Result2)
  2254. {
  2255. if(DB::Valid(Result2))
  2256. {
  2257. DB::GetField(Result2, "IP", Field, sizeof (Field));
  2258. SetPVarString(playerid, "FalseIP", Field);
  2259.  
  2260. if(strcmp(GetPlayerIPEx(playerid), Field))
  2261. {
  2262. DB::GetField(Result2, "Frozen", Field, sizeof (Field));
  2263. P_DATA[playerid][Frozen] = strval(Field);
  2264.  
  2265. DB::GetField(Result2, "RealName", Field, sizeof (Field));
  2266. SetPVarString(playerid, "FreezeName", Field);
  2267.  
  2268. DB::GetField(Result2, "IP", Field, sizeof (Field));
  2269. SetPVarString(playerid, "FalseIP", Field);
  2270. }
  2271. DB::Free(Result2);
  2272. }
  2273. else
  2274. {
  2275. DB::Free(Result2);
  2276. SetPVarString(playerid, "FreezeName", "5;6:2:6:*:$:^");
  2277. }
  2278. }
  2279. }
  2280.  
  2281. }
  2282.  
  2283. if(P_DATA[playerid][Frozen])
  2284. {
  2285. if(strcmp(GPVSEx(playerid, "FreezeName"), Name(playerid), false))
  2286. {
  2287. SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
  2288. FormatMSG(playerid, Color:ORAN, "MUTE EVADING:"W" You have received "ORAN" 2 WARNINGS"W" for FREEZE EVADING! "GREY"(Old name: "ORAN"%s"GREY")", GPVSEx(playerid, "FreezeName"));
  2289. SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
  2290.  
  2291. P_DATA[playerid][Warns] += 2;
  2292.  
  2293. SetPlayerName(playerid, GPVSEx(playerid, "FreezeName"));
  2294. }
  2295. else if(strcmp(GPVSEx(playerid, "FalseIP"), GetPlayerIPEx(playerid)))
  2296. {
  2297. SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
  2298. FormatMSG(playerid, Color:ORAN, "MUTE EVADING:"W" You have received "ORAN" 2 WARNINGS"W" for FREEZE EVADING! "GREY"(Old IP: "ORAN"%s"GREY")", GPVSEx(playerid, "FalseIP"));
  2299. SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
  2300.  
  2301. P_DATA[playerid][Warns] += 2;
  2302.  
  2303. SetPlayerName(playerid, GPVSEx(playerid, "FreezeName"));
  2304. }
  2305.  
  2306. format(Query, 256, "UPDATE `Frozen` SET `IP` = '%s', `Frozen` = '1', `RealName` = '%s' WHERE `RealName` = '%s'", GetPlayerIPEx(playerid), Name(playerid), GPVSEx(playerid, "FreezeName"));
  2307. DB::Query(_DB, Query);
  2308.  
  2309. if(P_DATA[playerid][Warns] >= MAX_P_WARNS)
  2310. {
  2311. SendClientMessage(playerid, Color:GREY, "You have been kicked from the server for exceeding warnings!");
  2312. KickEx(playerid, "System", "Exceeding Warnings");
  2313. return 0;
  2314. }
  2315. }
  2316. #endif
  2317.  
  2318. #if SAVE_MUTE == true
  2319.  
  2320. new Query2[256],
  2321. DBResult:Result3;
  2322.  
  2323. format(Query2, sizeof (Query2), "SELECT `Muted`, `Time`, `RealName` FROM `Muted` WHERE `IP` = '%s';", GetPlayerIPEx(playerid));
  2324. Result3 = DB::Query(_DB, Query2);
  2325.  
  2326. if(Result3)
  2327. {
  2328. if(DB::Valid(Result3))
  2329. {
  2330. DB::GetField(Result3, "Muted", Field, sizeof (Field));
  2331. P_DATA[playerid][Muted] = strval(Field);
  2332.  
  2333. DB::GetField(Result3, "Time", Field, sizeof (Field));
  2334. P_DATA[playerid][MutedTime] = strval(Field);
  2335.  
  2336. DB::GetField(Result3, "RealName", Field, sizeof (Field));
  2337. SetPVarString(playerid, "MuteName", Field);
  2338.  
  2339. DB::Free(Result3);
  2340. GameTextForPlayer(playerid, "~r~You have been cought freeze evading the system!~n~You have been punished!", 7600, 3);
  2341. }
  2342. else
  2343. {
  2344. DB::Free(Result3);
  2345. format(Query2, sizeof(Query2), "SELECT `IP`, `Muted`, `RealName`, `Time` FROM `Muted` WHERE `RealName` = '%s';", Name(playerid));
  2346. new DBResult:Result4 = DB::Query(_DB, Query2);
  2347.  
  2348. if(Result4)
  2349. {
  2350. if(DB::Valid(Result4))
  2351. {
  2352. DB::GetField(Result4, "IP", Field, sizeof (Field));
  2353. if(strcmp(GetPlayerIPEx(playerid), Field))
  2354. {
  2355. DB::GetField(Result4, "Muted", Field, sizeof (Field));
  2356. P_DATA[playerid][Muted] = strval(Field);
  2357.  
  2358. DB::GetField(Result4, "Time", Field, sizeof (Field));
  2359. P_DATA[playerid][MutedTime] = strval(Field);
  2360.  
  2361. DB::GetField(Result4, "RealName", Field, sizeof (Field));
  2362. SetPVarString(playerid, "MuteName", Field);
  2363.  
  2364. DB::GetField(Result4, "IP", Field, sizeof (Field));
  2365. SetPVarString(playerid, "FalseIP", Field);
  2366.  
  2367. GameTextForPlayer(playerid, "~r~You have been cought mute evading the system!~n~You have been punished!", 7600, 3);
  2368. }
  2369. DB::Free(Result4);
  2370. }
  2371. else
  2372. {
  2373. DB::Free(Result4);
  2374. SetPVarString(playerid, "MuteName", "5;6:2:6:*:$:^");
  2375. SetPVarString(playerid, "FalseIP", "5;6:2:6:*:$:^");
  2376. }
  2377. }
  2378. }
  2379. }
  2380.  
  2381. if(P_DATA[playerid][MutedTime] > 0)
  2382. {
  2383. if(strcmp(GPVSEx(playerid, "MuteName"), Name(playerid), false))
  2384. {
  2385. SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
  2386. FormatMSG(playerid, Color:ORAN, "MUTE EVADING:"W" You have received an extra "ORAN""#EXTRA_MINUTES""W" minutes for mute evading! "GREY"(Old Name: "ORAN"%s"GREY")", GPVSEx(playerid, "MuteName"));
  2387. SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
  2388.  
  2389. SetPlayerName(playerid, GPVSEx(playerid, "MuteName"));
  2390.  
  2391. P_DATA[playerid][MutedTime] += (EXTRA_MINUTES);
  2392. }
  2393. else if(strcmp(GPVSEx(playerid, "FalseIP"), GetPlayerIPEx(playerid)))
  2394. {
  2395. SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
  2396. FormatMSG(playerid, Color:ORAN, "MUTE EVADING:"W" You have received an extra "ORAN""#EXTRA_MINUTES""W" minutes for mute evading! "GREY"(Old IP: "ORAN"%s"GREY")", GPVSEx(playerid, "FalseIP"));
  2397. SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
  2398.  
  2399. SetPlayerName(playerid, GPVSEx(playerid, "MuteName"));
  2400.  
  2401. P_DATA[playerid][MutedTime] += (EXTRA_MINUTES);
  2402. }
  2403. P_DATA[playerid][Muted] = 1;
  2404.  
  2405. FormatMSG(playerid, Color:ORAN, "SERVER:"W" You are still muted! "ORAN"["GREY"Aprox. "W"%d minutes"ORAN"]", P_DATA[playerid][MutedTime]);
  2406. MuteTimer[playerid] = SetTimerEx("UnMutePlayer", 60_000, true, "i", playerid);
  2407.  
  2408. new pQ[129];
  2409. format(pQ, sizeof (pQ), "UPDATE `Muted` SET `IP` = '%s', `RealName` = '%s' WHERE `RealName` = '%s'", GetPlayerIPEx(playerid), Name(playerid), GPVSEx(playerid, "MuteName"));
  2410. DB::Query(_DB, pQ);
  2411.  
  2412. }
  2413. else if(P_DATA[playerid][Muted] && !P_DATA[playerid][MutedTime])
  2414. {
  2415. if(strcmp(GPVSEx(playerid, "MuteName"), Name(playerid), false))
  2416. {
  2417. SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
  2418. FormatMSG(playerid, Color:ORAN, "MUTE EVADING:"W" You have received"ORAN" 2 WARNINGS"W" for MUTE EVADING! "GREY"(Old Name: "ORAN"%s"GREY")", GPVSEx(playerid, "MuteName"));
  2419. SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
  2420.  
  2421. SetPlayerName(playerid, GPVSEx(playerid, "MuteName"));
  2422.  
  2423. P_DATA[playerid][Warns] += 2;
  2424.  
  2425. new pQ[129];
  2426. format(pQ, sizeof (pQ), "UPDATE `Muted` SET `IP` = '%s', `RealName` = '%s' WHERE `RealName` = '%s'", GetPlayerIPEx(playerid), Name(playerid), GPVSEx(playerid, "MuteName"));
  2427. DB::Query(_DB, pQ);
  2428. }
  2429. else if(strcmp(GPVSEx(playerid, "FalseIP"), GetPlayerIPEx(playerid)))
  2430. {
  2431. SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
  2432. FormatMSG(playerid, Color:ORAN, "MUTE EVADING:"W" You have received"ORAN" 2 WARNINGS"W" for MUTE EVADING! "GREY"(Old IP: "ORAN"%s"GREY")", GPVSEx(playerid, "FalseIP"));
  2433. SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
  2434.  
  2435. SetPlayerName(playerid, GPVSEx(playerid, "MuteName"));
  2436.  
  2437. P_DATA[playerid][Warns] += 2;
  2438.  
  2439. format(Query2, sizeof (Query2), "UPDATE `Muted` SET `IP` = '%s', `RealName` = '%s' WHERE `RealName` = '%s'", GetPlayerIPEx(playerid), Name(playerid), GPVSEx(playerid, "MuteName"));
  2440. DB::Query(_DB, Query2);
  2441. }
  2442. SendClientMessage(playerid, Color:ORAN, "SERVER:"W" You are still muted! "ORAN"["GREY"Mute time: "W"Forever"ORAN"]");
  2443. }
  2444. if(P_DATA[playerid][Warns] == MAX_P_WARNS)
  2445. {
  2446. SendClientMessage(playerid, Color:GREY, "You have been kicked from the server for exceeding warnings!");
  2447. KickEx(playerid, "System", "Exceeding Warnings");
  2448. return 0;
  2449. }
  2450.  
  2451. #endif
  2452.  
  2453.  
  2454. new pQuery[512], DBResult:pResult;
  2455. format(pQuery, 512, "SELECT `Autologin` FROM `Accounts` WHERE `Name` = '%s';", Name(playerid));
  2456. pResult = DB::Query(_DB, pQuery);
  2457. new pField[60];
  2458.  
  2459. if(pResult)
  2460. {
  2461. if(DB::Valid(pResult))
  2462. {
  2463.  
  2464. DB::GetField(pResult, "Autologin", pField, sizeof(pField));
  2465. P_DATA[playerid][pAuto] = strval(pField);
  2466.  
  2467. DB::Free(pResult);
  2468. if(P_DATA[playerid][pAuto])
  2469. {
  2470. new DBResult:pResult2;
  2471. format(pQuery, 512, "SELECT `IP`, `RPassword` FROM `Accounts` WHERE `Name` = '%s';", Name(playerid));
  2472. pResult2 = DB::Query(_DB, pQuery);
  2473.  
  2474. if(pResult2)
  2475. {
  2476. if(DB::Valid(pResult2))
  2477. {
  2478. DB::GetField(pResult2, "IP", pField, sizeof(pField));
  2479. if(!strcmp(pField, GetPlayerIPEx(playerid), false))
  2480. {
  2481. DB::GetField(pResult2, "RPassword", pField, sizeof(pField));
  2482. LoginPlayer(playerid, pField, .pAutoLogin = true);
  2483. }
  2484. else SendLogin(playerid);
  2485. }
  2486. else SendLogin(playerid);
  2487. }
  2488. } else SendLogin(playerid);
  2489. }
  2490. else
  2491. {
  2492. new zStr[256];
  2493. format(zStr, sizeof (zStr), ""W"Welcome "GREE"%s "W"on "GREE"%s."W"\n\nThis server requiers that you register an account\nPlease write your desired password", Name(playerid), GetServerHostName());
  2494. ShowPlayerDialog(playerid, Dialog:Register, DIALOG_STYLE_INPUT, ""W"Register an account", zStr, "Register", "Kick");
  2495. }
  2496. }
  2497. return 1;
  2498. }
  2499. SendLogin(playerid)
  2500. {
  2501. new zStr[150];
  2502. format(zStr, sizeof (zStr), ""W"Welcome back "GREE"%s"W"\n\nPlease login into your account:", Name(playerid));
  2503.  
  2504. #if SECURITY_QUESTION == true
  2505.  
  2506. SPD(playerid, Dialog:Login2, INPUT, ""W"Welcome back", zStr, "Login", "Forg. Pass");
  2507.  
  2508. #else
  2509.  
  2510. SPD(playerid, Dialog:Login2, INPUT, ""W"Welcome back", zStr, "Login", "Kick");
  2511.  
  2512. #endif
  2513.  
  2514. }
  2515. public OnPlayerDisconnect(playerid, reason)
  2516. {
  2517. S_DATA[sPlayers] --;
  2518.  
  2519. DeletePlayer3DTextLabel(playerid, ZaAdminCar[playerid]);
  2520.  
  2521. if(P_DATA[playerid][tLevel])
  2522. {
  2523. P_DATA[playerid][Level] = 0;
  2524. }
  2525.  
  2526. DestroyVehicle(P_DATA[playerid][aCar]);
  2527.  
  2528. new zStr[256];
  2529. switch(reason)
  2530. {
  2531. case 0: format(zStr, sizeof (zStr), "%s["W"%i"ORAN"]"W" Has left the server! "ORAN"[CRASH]", Name(playerid), playerid);
  2532. case 1: format(zStr, sizeof (zStr), "%s["W"%i"ORAN"]"W" Has left the server! "ORAN"[LEAVING]", Name(playerid), playerid);
  2533. case 2: format(zStr, sizeof (zStr), "%s["W"%i"ORAN"]"W" Has left the server! "ORAN"[KICK"W"/"ORAN"BAN]", Name(playerid), playerid);
  2534.  
  2535. }
  2536. SendClientMessageToAll(Color:ORAN, zStr);
  2537.  
  2538. if(P_DATA[playerid][Logged]) { SavePlayerData(playerid); }
  2539.  
  2540. new Query[129];
  2541.  
  2542. #if !SAVE_JAIL && !SAVE_MUTE
  2543. #pragma unused Query
  2544. #endif
  2545.  
  2546. #if SAVE_JAIL == true
  2547.  
  2548. if(P_DATA[playerid][JailTime] > 0 )
  2549. {
  2550. format(Query, 129, "UPDATE `Jailed` SET `Jailed` = '%d', `Time` = '%d', `RealName` = '%s' WHERE `IP` = '%s'", P_DATA[playerid][Jailed], P_DATA[playerid][JailTime], Name(playerid), PlayerIP[playerid]);
  2551. DB::Query(_DB, Query);
  2552. }
  2553. else if(!P_DATA[playerid][JailTime] && P_DATA[playerid][Jailed])
  2554. {
  2555. format(Query, 129, "SELECT `Key` FROM `Jailed` WHERE `IP` = '%s';", PlayerIP[playerid]);
  2556. new DBResult:Result = DB::Query(_DB, Query);
  2557.  
  2558. if(Result)
  2559. {
  2560. if(!DB::Valid(Result))
  2561. {
  2562. DB::Free(Result);
  2563. format(Query, 129, "DELETE FROM `Jailed` WHERE `IP` = '%s'", PlayerIP[playerid]);
  2564. DB::Query(_DB, Query);
  2565. }
  2566. }
  2567. }
  2568.  
  2569. #endif
  2570.  
  2571. #if SAVE_MUTE == true
  2572.  
  2573.  
  2574. if(P_DATA[playerid][MutedTime] > 0)
  2575. {
  2576. format(Query, 129, "UPDATE `Muted` SET `Muted` = '%d', `Time` = '%d', `RealName` = '%s' WHERE `IP` = '%s'", P_DATA[playerid][Muted], P_DATA[playerid][MutedTime], Name(playerid), PlayerIP[playerid]);
  2577. DB::Query(_DB, Query);
  2578. }
  2579. else if(!P_DATA[playerid][MutedTime] && P_DATA[playerid][Muted])
  2580. {
  2581. format(Query, 129, "SELECT `Key` FROM `Muted` WHERE `IP` = '%s'", PlayerIP[playerid]);
  2582. new DBResult:Result = DB::Query(_DB, Query);
  2583.  
  2584. if(Result)
  2585. {
  2586. if(!DB::Valid(Result))
  2587. {
  2588. DB::Free(Result);
  2589. format(Query, 129, "DELETE FROM `Muted` WHERE `IP` = '%s'", PlayerIP[playerid]);
  2590. DB::Query(_DB, Query);
  2591. }
  2592. }
  2593. }
  2594.  
  2595. #endif
  2596. for(new i = 0; i < 5; i++)
  2597. {
  2598. if(IsPlayerAttachedObjectSlotUsed(playerid, i))
  2599. {
  2600. RemovePlayerAttachedObject(playerid, i);
  2601. }
  2602. }
  2603.  
  2604.  
  2605. KillTimer(MuteTimer[playerid] );
  2606. KillTimer(JailTimer[playerid] );
  2607. KillTimer(P_DATA[playerid][NosTimer] );
  2608. P_DATA[playerid][LogFail] = 0;
  2609. ClearVars(playerid);
  2610.  
  2611. return 1;
  2612. }
  2613.  
  2614. public OnPlayerCommandPerformed(playerid, cmdtext[], success)
  2615. {
  2616.  
  2617. if(success)
  2618. {
  2619. P_DATA[playerid][Cmds]++;
  2620. SetPVarInt(playerid, "0_Commands", P_DATA[playerid][Cmds]);
  2621.  
  2622. if(S_DATA[ReadCMD])
  2623. {
  2624. SendAdminCMD(playerid, ""GREY"[CMD] %s[%i] "W"used command{FF0000} %s", Name(playerid), playerid, cmdtext);
  2625. printf(#[%s] %s - %s, zDate(), Name(playerid), cmdtext);
  2626. }
  2627. }
  2628. else
  2629. {
  2630. P_DATA[playerid][fCmds]++;
  2631. SetPVarInt(playerid, "0_Fail_Commands", P_DATA[playerid][fCmds]) ;
  2632. return 0;
  2633. }
  2634. return 1;
  2635. }
  2636. public OnPlayerCommandReceived(playerid, cmdtext[])
  2637. {
  2638. P_DATA[playerid][cSpam]++;
  2639. if(S_DATA[AntiCSpam] && (!IsPlayerAdmin(playerid) || P_DATA[playerid][Level] != 5))
  2640. {
  2641. if(P_DATA[playerid][cSpam] > MAX_CMD_SPAM && !IsPlayerAdmin(playerid))
  2642. {
  2643. BanEx2(playerid, .zReason = "Extreme command spam");
  2644. return 0;
  2645. }
  2646. else if(P_DATA[playerid][cSpam] > MIN_CMD_SPAM)
  2647. {
  2648. KickEx(playerid, .zReason = "Command spam");
  2649. return 0;
  2650. }
  2651. }
  2652. if(P_DATA[playerid][Jailed] && !P_DATA[playerid][JailTime] && P_DATA[playerid][Level] != 5 && !IsPlayerAdmin(playerid))
  2653. {
  2654. SendClientMessage(playerid, Color:ORAN, "SERVER:"W" You are not allowed to use any commands while jailed! "GREY"[Jail Time: "ORAN"Forever"GREY"]");
  2655. return 0;
  2656. }
  2657. else if(P_DATA[playerid][Jailed] && P_DATA[playerid][JailTime] > 0 && P_DATA[playerid][Level] != 5 && !IsPlayerAdmin(playerid))
  2658. {
  2659. FormatMSG(playerid, Color:ORAN, "SERVER:"W" You are not allowed to use any commands while jailed! "GREY"[Jail Time: "ORAN"%d"GREY" minutes]", P_DATA[playerid][JailTime]);
  2660. return 0;
  2661. }
  2662. return 1;
  2663. }
  2664.  
  2665. public OnPlayerSpawn(playerid)
  2666. {
  2667. if(IsPlayerNPC(playerid)) return 1;
  2668. #if SAVE_JAIL == true
  2669.  
  2670. if(GetPVarType(playerid, "FirstConnection"))
  2671. {
  2672. if(P_DATA[playerid][Incred])
  2673. {
  2674. for(new i = 0; i < 5; i++)
  2675. if(IsPlayerAttachedObjectSlotUsed(playerid, i))
  2676. RemovePlayerAttachedObject(playerid, i);
  2677.  
  2678. SetPlayerAttachedObject(playerid, 0, 18693, 5, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
  2679. SetPlayerAttachedObject(playerid, 1, 18693, 6, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
  2680. SetPlayerAttachedObject(playerid, 2, 18703, 6, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
  2681. SetPlayerAttachedObject(playerid, 3, 18703, 5, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
  2682. SetPlayerAttachedObject(playerid, 4, 18965, 2, 0.111052, 0.021643, -0.000846, 92.280899, 92.752510, 358.071044, 1.200000, 1.283168, 1.200000 );
  2683. }
  2684. if(P_DATA[playerid][VIPTag])
  2685. {
  2686. if(P_DATA[playerid][Tag3D])
  2687. {
  2688. Attach3DTextLabelToPlayer(P_DATA[playerid][Tag3D], playerid, 0.0, 0.0, 1.2);
  2689. }
  2690. }
  2691. DeletePVar(playerid, "FirstConnection");
  2692. new Query[256],
  2693. DBResult:Result1;
  2694.  
  2695. format(Query, sizeof (Query), "SELECT `Key`, `Jailed`, `Time`, `RealName` FROM `Jailed` WHERE `IP` = '%s';", GetPlayerIPEx(playerid));
  2696. Result1 = DB::Query(_DB, Query);
  2697.  
  2698. if(Result1)
  2699. {
  2700. if(DB::Valid(Result1))
  2701. {
  2702. new Field[30];
  2703.  
  2704. DB::GetField(Result1, "Jailed", Field, sizeof (Field));
  2705. P_DATA[playerid][Jailed] = strval(Field);
  2706.  
  2707. DB::GetField(Result1, "Time", Field, sizeof (Field));
  2708. P_DATA[playerid][JailTime] = strval(Field);
  2709.  
  2710. DB::GetField(Result1, "RealName", Field, sizeof (Field));
  2711. SetPVarString(playerid, "JailName", Field);
  2712.  
  2713. DB::Free(Result1);
  2714. }
  2715. else
  2716. {
  2717. DB::Free(Result1);
  2718. format(Query, 256, "SELECT `IP` FROM `Jailed` WHERE `RealName` = '%s'", Name(playerid));
  2719. new DBResult:Result2 = DB::Query(_DB, Query);
  2720.  
  2721. if(Result2)
  2722. {
  2723. if(DB::Valid(Result2))
  2724. {
  2725. new Field[64];
  2726. DB::GetField(Result2, "IP", Field, sizeof (Field));
  2727. if(strcmp(GetPlayerIPEx(playerid), Field))
  2728. {
  2729. format(Query, sizeof (Query), "SELECT `Key`, `Jailed`, `Time`, `RealName`, `IP` FROM `Jailed` WHERE `RealName` = '%s';", Name(playerid));
  2730. Result1 = DB::Query(_DB, Query);
  2731.  
  2732. DB::GetField(Result2, "Jailed", Field, sizeof (Field));
  2733. P_DATA[playerid][Jailed] = strval(Field);
  2734.  
  2735. DB::GetField(Result2, "Time", Field, sizeof (Field));
  2736. P_DATA[playerid][JailTime] = strval(Field);
  2737.  
  2738. DB::GetField(Result2, "RealName", Field, sizeof (Field));
  2739. SetPVarString(playerid, "JailName", Field);
  2740.  
  2741. DB::GetField(Result2, "IP", Field, sizeof (Field));
  2742. SetPVarString(playerid, "JFalseIP", Field);
  2743.  
  2744. DB::Free(Result2);
  2745. }
  2746. }
  2747. else DB::Free(Result2);
  2748.  
  2749. }
  2750. }
  2751. }
  2752.  
  2753. if(P_DATA[playerid][JailTime] > 0)
  2754. {
  2755. if(strcmp(GPVSEx(playerid, "JailName"), Name(playerid), false))
  2756. {
  2757. SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
  2758. FormatMSG(playerid, Color:ORAN, "JAIL EVADING:"W" You have received an extra "ORAN""#EXTRA_MINUTES""W" minutes for JAIL EVADING! "GREY"(Old name: "ORAN"%s"GREY")", GPVSEx(playerid, "JailName"));
  2759. SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
  2760.  
  2761. SetPlayerName(playerid, GPVSEx(playerid, "JailName"));
  2762. P_DATA[playerid][JailTime] += (EXTRA_MINUTES);
  2763. }
  2764. else if(strcmp(GPVSEx(playerid, "JFalseIP"), GetPlayerIPEx(playerid), false))
  2765. {
  2766. SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
  2767. FormatMSG(playerid, Color:ORAN, "JAIL EVADING:"W" You have received an extra "ORAN""#EXTRA_MINUTES""W" minutes for JAIL EVADING! "GREY"(Old IP: "ORAN"%s"GREY")", GPVSEx(playerid, "JFalseIP"));
  2768. SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
  2769.  
  2770. SetPlayerName(playerid, GPVSEx(playerid, "JailName"));
  2771. P_DATA[playerid][JailTime] += (EXTRA_MINUTES);
  2772. }
  2773. P_DATA[playerid][Jailed] = 1;
  2774.  
  2775. FormatMSG(playerid, Color:ORAN, "SERVER:"W" You are still jailed! "ORAN"["GREY"Jail time: "W"%d minutes"ORAN"]", P_DATA[playerid][JailTime]);
  2776.  
  2777. SetTimerEx("JailPlayer", 1500, false, "i", playerid);
  2778.  
  2779. new pQ[129];
  2780. format(pQ, sizeof (pQ), "UPDATE `Jailed` SET `IP` = '%s', `RealName` = '%s' WHERE `RealName` = '%s'", GetPlayerIPEx(playerid), Name(playerid), GPVSEx(playerid, "JailName"));
  2781. DB::Query(_DB, pQ);
  2782.  
  2783. }
  2784. else if(P_DATA[playerid][Jailed] && P_DATA[playerid][JailTime] == 0)
  2785. {
  2786. if(strcmp(GPVSEx(playerid, "JailName"), Name(playerid), false))
  2787. {
  2788. SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
  2789. FormatMSG(playerid, Color:ORAN, "JAIL EVADING:"W" You have received an extra "ORAN"2 WARNINGS"W" minutes for JAIL EVADING! "GREY"(Old name: "ORAN"%s"GREY")", GPVSEx(playerid, "JailName"));
  2790. SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
  2791.  
  2792. SetPlayerName(playerid, GPVSEx(playerid, "JailName"));
  2793. P_DATA[playerid][Warns] += 2;
  2794. }
  2795. else if(strcmp(GPVSEx(playerid, "JFalseIP"), GetPlayerIPEx(playerid), false))
  2796. {
  2797. SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
  2798. FormatMSG(playerid, Color:ORAN, "JAIL EVADING:"W" You have received an extra "ORAN"2 WARNINGS"W" minutes for JAIL EVADING! "GREY"(Old IP: "ORAN"%s"GREY")", GPVSEx(playerid, "JFalseIP"));
  2799. SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
  2800.  
  2801. SetPlayerName(playerid, GPVSEx(playerid, "JailName"));
  2802. P_DATA[playerid][Warns] += 2;
  2803. }
  2804. SendClientMessage(playerid, Color:ORAN, "SERVER:"W" You are still jailed! "ORAN"["GREY"Jail time: "W"Forever"ORAN"]");
  2805.  
  2806. SetTimerEx("JailPlayer", 1500, false, "i", playerid);
  2807.  
  2808. new pQ[129];
  2809. format(pQ, sizeof (pQ), "UPDATE `Jailed` SET `IP` = '%s', `RealName` = '%s' WHERE `RealName` = '%s'", GetPlayerIPEx(playerid), Name(playerid), GPVSEx(playerid, "JailName"));
  2810. DB::Query(_DB, pQ);
  2811.  
  2812. if(P_DATA[playerid][Warns] == MAX_P_WARNS)
  2813. {
  2814. SendClientMessage(playerid, Color:GREY, "You have been kicked from the server for exceeding warnings!");
  2815. KickEx(playerid, "System", "Exceeding Warnings");
  2816. return 0;
  2817. }
  2818.  
  2819. }
  2820. }
  2821. #endif
  2822. if(P_DATA[playerid][Frozen])
  2823. {
  2824. Freeze(playerid);
  2825. SendClientMessage(playerid, Color:ORAN, "SERVER:"W" You are still frozen, you cannot move! "GREY"(If this is not true, please "W"/report"GREY" to admins!)");
  2826. }
  2827. return 1;
  2828. }
  2829. public OnRconLoginAttempt(ip[], password[], success)
  2830. {
  2831. if(! success)
  2832. {
  2833. new zStr[180];
  2834. if(S_DATA[RCONProt])
  2835. {
  2836. S_DATA[RconFails] += 1;
  2837. if(S_DATA[RconFails] >= MAX_RCON_ATTEMPTS)
  2838. {
  2839. BadRcon(ip, password);
  2840. S_DATA[RconFails] = 0;
  2841. }
  2842. else
  2843. {
  2844. format(zStr, sizeof (zStr), "*** RCON: "W"RCON Protection turned off, someone tried to break the RCON. (IP: %s| RCON: %s)", ip, password);
  2845. SendMessageToAdmins(Color:GREY, zStr, 4);
  2846. SendMessageToAdmins(Color:GREY, "Enable "ORAN"Rcon Protection"GREY" from the Admin Control Panel!", 4);
  2847. }
  2848. }else return format(zStr, sizeof (zStr), "*** RCON: "W"RCON Protection turned off, someone tried to break the RCON. (IP: %s| RCON: %s)", ip, password),SendMessageToAdmins(Color:ORAN, zStr, 4),SendMessageToAdmins(Color:ORAN, "Enable "W"RCON Protection"ORAN" from "W"/ACP", 4),SendMessageToAdmins(Color:GREY, "Enable "ORAN"Rcon Protection"GREY" from the Admin Control Panel!", 4),0;
  2849. }
  2850. else
  2851. {
  2852. foreach(Player, i)
  2853. {
  2854. new zIP[16];
  2855. GetPlayerIp(i, zIP, 16);
  2856. if(!strcmp (zIP, ip, true))
  2857. {
  2858. SendClientMessage(i, -1, ""BLUE"RCON:"W" Welcome, RCON Admin.");
  2859. }
  2860. }
  2861. }
  2862. return 1;
  2863. }
  2864.  
  2865. ShowTopStats(playerid, stats[], what[], limit = MAX_TOP_LIMIT)
  2866. {
  2867. new Speed = GetTickCount(),
  2868. DialString[3_0_0_0],
  2869. String[2][128],
  2870. Query[2][256],
  2871. DBResult:Result1;
  2872.  
  2873. format(Query[0], 256, "SELECT `Name` FROM `Top` ORDER BY (`%s` * 1) DESC limit %d", stats, limit);
  2874.  
  2875. Result1 = DB::Query(_DB, Query[0]);
  2876.  
  2877. new cColor[12];
  2878. if(!strcmp(stats, "Negative", false)) cColor = "{FF0000}";
  2879. else if(!strcmp(stats, "Positive", false)) cColor = ""GREE"";
  2880. else cColor = "{FFFFFF}";
  2881.  
  2882. format(DialString, sizeof (DialString), "{FFFFFF}Server top "ORAN"%s\n\n\n"W"Pos. Player = %s", what, stats);
  2883. for (new Qr; Qr < DB::Valid(Result1); Qr++)
  2884. {
  2885. db_get_field(Result1, 0, String[0], 128);
  2886.  
  2887. format(Query[1], 256, "SELECT `%s` FROM `Top` WHERE `Name` = '%s'", stats, String[0]);
  2888.  
  2889. new DBResult:Result2 = DB::Query(_DB, Query[1]);
  2890. db_get_field(Result2, 0, String[1], 128);
  2891.  
  2892. if(!strcmp(stats, "Hours"))format(DialString, sizeof (DialString), "%s\n"BLUE"%d."GREY" %s "W": "BLUE"%s"W" Hours", DialString, Qr + 1, String[0], FormatNumber(strval(String[1])));
  2893. else format(DialString, sizeof (DialString), "%s\n"BLUE"%d."GREY" %s "W": %s%s", DialString, Qr + 1, String[0], cColor, FormatNumber(strval(String[1])));
  2894.  
  2895.  
  2896. db_next_row(Result1);
  2897. DB::Free(Result2);
  2898. }
  2899. DB::Free(Result1);
  2900.  
  2901. format(DialString, sizeof (DialString), "%s\n\n"W"Top list generated in "ORAN"%d "W"ms.", DialString, GetTickCount() - Speed);
  2902. SPD(playerid, Dialog:TOP, BOX, ""W"TOP PLAYERS", DialString, "Close", "");
  2903. }
  2904. CMD:top(playerid,params[])
  2905. {
  2906. LoginCheck(playerid);
  2907.  
  2908. SPD(playerid, Dialog:TOP_SELECT, LIST, ""W"TOP PLAYERS", ""W"Top Killers\n\
  2909. "W"Top Deaths\n\
  2910. "W"Top Ranked\n\
  2911. "W"Top Respected\n\
  2912. "W"Top Online\n\
  2913. "W"Kills/Deaths ratio", "Select", "Close");
  2914.  
  2915.  
  2916. return 1;
  2917. }
  2918. CMD:stats(PARAMS)
  2919. {
  2920. LoginCheck(playerid);
  2921.  
  2922. new Player;
  2923. if(sscanf(params, "u", Player))
  2924. {
  2925. WhosStats = "your current stats";
  2926. FormatStats(playerid);
  2927. SendError(playerid, "You can also use "ORAN"/stats "W"<id>"GREY" to see someone else's stats!");
  2928. }
  2929. else
  2930. { if(Player == playerid)
  2931. {
  2932. WhosStats = "your current stats";
  2933. FormatStats(playerid);
  2934. SendError(playerid, "You can also use "ORAN"/stats "W"<id>"GREY" to see someone else's stats!");
  2935. }
  2936. else
  2937. {
  2938. if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
  2939.  
  2940. format(WhosStats, sizeof (WhosStats), ""ORAN"%s{FFFFFF}'s stats", Name(Player));
  2941. FormatStats(Player);
  2942.  
  2943. FormatMSG(Player, Color:GREY, "Player "ORAN"%s[%i]"GREY" is watching your stats!", Name(playerid), playerid);
  2944. }
  2945. }
  2946. SPD(playerid, Dialog:Stats, BOX, ""W"Statistics:", StatsString, "Close", "");
  2947. return 1;
  2948. }
  2949. CMD:specoff(PARAMS)
  2950. {
  2951. LoginCheck(playerid);
  2952. LevelCheck(playerid, 2);
  2953.  
  2954. if(P_DATA[playerid][Spec_Type] == ADMIN_SPEC_TYPE_NONE)
  2955. return SendError(playerid, "You are not spectating!");
  2956.  
  2957. TogglePlayerSpectating(playerid, 0);
  2958. P_DATA[playerid][Spec_ID] = 0xFFFF;
  2959. P_DATA[playerid][Spec_Type] = ADMIN_SPEC_TYPE_NONE;
  2960.  
  2961. foreach(Player, x)
  2962. {
  2963. if(P_DATA[x][Level] > 2)
  2964. {
  2965. FormatMSG(x, Color:GREY, "Admin "ORAN"%s[%i]"GREY" stopped spectating", Name(playerid), playerid);
  2966. }
  2967. }
  2968. SendClientMessage(playerid, Color:GREY, "You stopped spectating");
  2969. return 1;
  2970. }
  2971. CMD:specv(PARAMS)
  2972. {
  2973. LoginCheck(playerid);
  2974. LevelCheck(playerid, 2);
  2975.  
  2976. new VehicleID;
  2977. if(sscanf(params, "u", VehicleID)) return SendUsage(playerid, "/specv "GREY"<vehicleid>", "Will spectatea certain vehicle!");
  2978. else
  2979. {
  2980. if(VehicleID == (0xFFFF)) return SendError(playerid, "Invalid vehicle id");
  2981.  
  2982. if(VehicleID < MAX_VEHICLES)
  2983. {
  2984. TogglePlayerSpectating(playerid, 1);
  2985. PlayerSpectateVehicle(playerid, VehicleID);
  2986. P_DATA[playerid][Spec_ID] = VehicleID;
  2987. P_DATA[playerid][Spec_Type] = ADMIN_SPEC_TYPE_VEHICLE;
  2988. }
  2989. FormatMSG(playerid, Color:GREY, "You are now spectating vehicle id "ORAN"%i"GREY". Use "ORAN"/specoff"GREY" to stop spectating.", VehicleID);
  2990.  
  2991. foreach(Player, x)
  2992. {
  2993. if(P_DATA[x][Level] > 2)
  2994. {
  2995. FormatMSG(x, Color:GREY, "Admin "ORAN"%s[%i]"GREY" is spectating vehicle id "ORAN"%i"GREY".", Name(playerid), playerid, VehicleID);
  2996. }
  2997. }
  2998. }
  2999. return 1;
  3000. }
  3001. CMD:spec(PARAMS)
  3002. {
  3003. LoginCheck(playerid);
  3004. LevelCheck(playerid, 2);
  3005.  
  3006. new Player;
  3007. if(sscanf(params, "u", Player)) return SendUsage(playerid, "/spec "GREY"<id>", "Will spectate a certain player!");
  3008. else
  3009. {
  3010. if(Player == 0xFFFF )
  3011. return SendError(playerid, "Player not connected!");
  3012.  
  3013. if(Player == playerid)
  3014. return SendError(playerid, "You cannot spectate yourself!");
  3015.  
  3016. if(P_DATA[playerid][Level] < P_DATA[Player][Level])
  3017. return SendError(playerid, "You are not allowed to spectate this admin!");
  3018.  
  3019. TogglePlayerSpectating(playerid, 1);
  3020. PlayerSpectatePlayer(playerid, Player);
  3021. SetPlayerInterior(playerid, GetPlayerInterior(Player));
  3022.  
  3023. P_DATA[playerid][Spec_ID] = Player;
  3024. P_DATA[playerid][Spec_Type] = ADMIN_SPEC_TYPE_PLAYER;
  3025.  
  3026. FormatMSG(playerid, Color:GREY, "You are now spectating player "ORAN"%s[%i]"GREY". Use "ORAN"/specoff"GREY" to stop spectating.", Name(Player), Player);
  3027. foreach(Player, x)
  3028. {
  3029. if(P_DATA[x][Level] > 2)
  3030. {
  3031. FormatMSG(x, Color:GREY, "Admin "ORAN"%s[%i]"GREY" is spectating "ORAN"%s[%i]"GREY".", Name(playerid), playerid, Name(Player), Player);
  3032. }
  3033. }
  3034. }
  3035. return 1;
  3036. }
  3037. CMD:2012all(PARAMS)
  3038. {
  3039. LoginCheck(playerid);
  3040. LevelCheck(playerid, 4);
  3041.  
  3042.  
  3043. foreach(Player, Player)
  3044. {
  3045. if(P_DATA[Player][Level] < 1)
  3046. {
  3047. for (new w = 0; w < 11; w++)
  3048. {SetPlayerSkillLevel(Player, w, 0);}
  3049.  
  3050. SetPlayerHealth(Player, 0.1); SetPlayerArmour(Player, 0.0 ); SetPlayerTime(Player, 0, 0);
  3051. SetPlayerWeather(Player, -66); SetPlayerWantedLevel(Player, 6 ); SetPlayerSkin(Player, 159);
  3052. ResetPlayerWeapons(Player ); GivePlayerWeapon(Player, 10, 1); ResetPlayerMoney(Player );
  3053. SetPlayerScore(Player, 0 ); SetPlayerDrunkLevel(Player, 99999);
  3054.  
  3055. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" fucked up your and everyone's game!", Name(playerid), playerid);
  3056. }
  3057. }
  3058. SendClientMessage(playerid, Color:GREY, "You fucked up everyone's game! (Admins are an exception!)");
  3059. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" fucked up everyone's game!", Name(playerid), playerid);
  3060. return 1;
  3061. }
  3062. CMD:2012(PARAMS)
  3063. {
  3064. LoginCheck(playerid);
  3065. LevelCheck(playerid, 4);
  3066.  
  3067. new Player;
  3068. if(sscanf(params, "u", Player)) return SendUsage(playerid, "/2012 "GREY"<id>", "Will remove, player's cash, score, health to 0.1, armour removed! Basically, it's a FUCKUP command");
  3069. else
  3070. {
  3071. if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
  3072. if(Player == playerid) return SendError(playerid, "Player entered is you!");
  3073.  
  3074. for (new w = 0; w < 11; w++)
  3075. {SetPlayerSkillLevel(Player, w, 0);}
  3076.  
  3077. SetPlayerHealth(Player, 0.1); SetPlayerArmour(Player, 0.0 ); SetPlayerTime(Player, 0, 0);
  3078. SetPlayerWeather(Player, -66); SetPlayerWantedLevel(Player, 6 ); SetPlayerSkin(Player, 159);
  3079. ResetPlayerWeapons(Player ); GivePlayerWeapon(Player, 10, 1); ResetPlayerMoney(Player );
  3080. SetPlayerScore(Player, 0 ); SetPlayerDrunkLevel(Player, 99999);
  3081.  
  3082. new String[MAX_PLAYER_NAME];
  3083.  
  3084. format(String, MAX_PLAYER_NAME, "[NUB]%s", Name(Player));
  3085. if(strfind(Name(Player), "[NUB]", false, 0)) SetPlayerName(Player, String);
  3086.  
  3087. FormatMSG(playerid, Color:GREY, "You fucked up "ORAN"%s[%i]"GREY"'s game!", Name(Player), Player);
  3088. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" fucked up your game!", Name(playerid), playerid);
  3089. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" fucked up "ORAN"%s[%i]"GREY"'s game!", Name(playerid), playerid ,Name(Player), Player);
  3090. }
  3091. return 1;
  3092. }
  3093. CMD:eject(PARAMS)
  3094. {
  3095. LoginCheck(playerid);
  3096. LevelCheck(playerid, 2);
  3097.  
  3098. new Player;
  3099. if(sscanf(params, "u", Player)) return SendUsage(playerid, "/eject "GREY"<id>", "Will eject player from vehicle");
  3100. else
  3101. {
  3102. if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
  3103. if(Player == playerid) return SendError(playerid, "Player entered is you!");
  3104. if(!IsPlayerInAnyVehicle(Player)) return SendError(playerid, "Player is not in a vehicle!");
  3105.  
  3106. RemovePlayerFromVehicle(Player);
  3107.  
  3108. FormatMSG(playerid, Color:GREY, "You ejected "ORAN"%s[%i]"GREY" from vehicle!", Name(Player), Player);
  3109. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" ejected you from vehicle!", Name(playerid), playerid);
  3110. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" ejected "ORAN"%s[%i]"GREY" from vehicle!", Name(playerid), playerid ,Name(Player), Player);
  3111. }
  3112. return 1;
  3113. }
  3114. CMD:setonline(PARAMS)
  3115. {
  3116. LoginCheck(playerid);
  3117. LevelCheck(playerid, 5);
  3118.  
  3119. new Player, Time[3];
  3120. if(sscanf(params, "uiD(0)D(0)", Player, Time[0], Time[1], Time[2])) return SendUsage(playerid, "/warn "GREY"<id> <hours> <minutes> <seconds>", "Will set player's online time");
  3121. else
  3122. {
  3123. if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
  3124. if(Time[1] > 60 || Time[1] < 0) return SendError(playerid, "Invalid minutes inserted!");
  3125. if(Time[2] > 60 || Time[2] < 0) return SendError(playerid, "Invalid seconds inserted!");
  3126.  
  3127. P_DATA[Player][Hours] = Time[0]; P_DATA[Player][Minutes] = Time[1]; P_DATA[Player][Seconds] = Time[2];
  3128. if(Player == playerid)
  3129. {
  3130. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his time spent on server to "W"%d"GREY":"W"%d"GREY":"W"%d", Name(playerid), playerid, Time[0], Time[1], Time[2]);
  3131. FormatMSG(playerid, Color:GREY, "You set your time spent on server to "W"%d"GREY":"W"%d"GREY":"W"%d", Time[0], Time[1], Time[2]);
  3132. }
  3133. else
  3134. {
  3135. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"%s[%i]"GREY"'s time spent on server to "W"%d:%d:%d", Name(playerid), playerid ,Name(Player), Player, Time[0], Time[1], Time[2]);
  3136. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s time spent on server to "W"%d"GREY":"W"%d"GREY":"W"%d",Name(Player), Player, Time[0], Time[1], Time[2]);
  3137. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your time spent on server to "W"%d"GREY":"W"%d"GREY":"W"%d",Name(playerid), playerid, Time[0], Time[1], Time[2]);
  3138. }
  3139.  
  3140. P_DATA[Player][ConnTime] = gettime();
  3141. }
  3142. return 1;
  3143. }
  3144. CMD:warn(PARAMS)
  3145. {
  3146. LoginCheck(playerid);
  3147. LevelCheck(playerid, 3);
  3148.  
  3149. new Player, Reason[80];
  3150. if(sscanf(params, "us[80]", Player, Reason)) return SendUsage(playerid, "/warn "GREY"<id> [reason]", "Will warn a player! At "ORAN"3"GREY" warns he will be kicked!");
  3151. else
  3152. {
  3153. if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
  3154. if(Player == playerid) return SendError(playerid, "Player entered is you!");
  3155.  
  3156. CheckImune(playerid, Player);
  3157.  
  3158. P_DATA[Player][Warns] += 1;
  3159.  
  3160. if(P_DATA[Player][Warns] != MAX_P_WARNS)
  3161. {
  3162. #if SAVE_IN_LOGS == true
  3163. SaveInLog(WARNS_LOG, "Admin %s warned %s (%d/"#MAX_P_WARNS") for %s on %s",Name(playerid), Name(Player), P_DATA[Player][Warns], Reason, zDate ());
  3164. #endif
  3165. FormatMSG(playerid, Color:GREY, "You have warned "ORAN"%s[%i]"GREY" for"ORAN" %s "GREY"Warn: "W"%d"ORAN"/"W""#MAX_P_WARNS"", Name(Player), Player, Reason, P_DATA[Player][Warns]);
  3166. FormatMSG(Player, Color:GREY, "You have been warned by admin "ORAN"%s[%i]"GREY" for"ORAN" %s "GREY"Warn: "W"%d"ORAN"/"W""#MAX_P_WARNS"", Name(playerid), playerid, Reason, P_DATA[Player][Warns]);
  3167. GameTextForPlayer(Player, "~r~WARNED!", 3000, 3);
  3168. }
  3169. else if(P_DATA[Player][Warns] >= MAX_P_WARNS)
  3170. {
  3171. #if SAVE_IN_LOGS == true
  3172. SaveInLog(WARNS_LOG, "Admin %s warned %s (%d/"#MAX_P_WARNS") for %s on %s and has been kicked from the server.",Name(playerid), Name(Player), P_DATA[Player][Warns], Reason, zDate ());
  3173. #endif
  3174. P_DATA[Player][Warns] = 0;
  3175. FormatMSG(Player, Color:GREY, "You have been warned by admin "ORAN"%s[%i]"GREY" for "ORAN" %s", Name(playerid), playerid, Reason);
  3176. SendError(Player, "You have reached the maximum warns per player! "ORAN""#MAX_P_WARNS""W"/"#MAX_P_WARNS"");
  3177. SendError(Player, "Kicked from the server!");
  3178. KickEx(Player, Name(playerid), "Exceeding Warnings!", true);
  3179. }
  3180.  
  3181. }
  3182. return 1;
  3183. }
  3184. CMD:show(PARAMS)
  3185. {
  3186. LoginCheck(playerid);
  3187. LevelCheck(playerid, 2);
  3188.  
  3189. new Player, Show[129];
  3190. if(sscanf(params, "us[129]", Player, Show)) return SendUsage(playerid, "/show <id> [text]", "Will show a text in the middle of the screen for the specified player"), SendClientMessage(playerid, Color:ORAN, "Warning: "GREY" Don't forget to finish a color! If you start ~ end it with w~, It might result in a crash for that player!");
  3191. else
  3192. {
  3193. if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
  3194. if(Player == playerid) return SendError(playerid, "Player entered is you!");
  3195. CheckImune(playerid, Player);
  3196.  
  3197. GameTextForPlayer(Player, Show, 6000, 3);
  3198.  
  3199. FormatMSG(playerid, Color:GREY, "Screen text sent to "ORAN"%s[%i]", Name(Player), Player);
  3200. }
  3201. return 1;
  3202. }
  3203. CMD:cookies(PARAMS)
  3204. {
  3205. LoginCheck(playerid);
  3206.  
  3207. if(!P_DATA[playerid][Cookies] )
  3208. SendClientMessage(playerid, Color:GREY, "You currently have no cookies! Buy some with "ORAN"/buycookies");
  3209. else if(P_DATA[playerid][Cookies] > 1)
  3210. FormatMSG(playerid, Color:GREY, "You have "ORAN"%d"GREY" cookies! Eat them or gift them to somebody!", P_DATA[playerid][Cookies]);
  3211. else if(P_DATA[playerid][Cookies] == 1)
  3212. SendClientMessage(playerid, Color:GREY, "You have "ORAN"1"GREY" cookie! Eat it or gift it to somebody!");
  3213. return 1;
  3214. }
  3215.  
  3216. CMD:cookieshelp(PARAMS)
  3217. {
  3218. LoginCheck(playerid);
  3219.  
  3220. new bStr[512];
  3221. format(bStr, sizeof(bStr), "%s%s",\
  3222. ""ORAN"Cookies Center!\n\n\
  3223. "GREY"Use "ORAN"/cookies"GREY" to check how many cookies you have!\n\
  3224. "GREY"Use "ORAN"/buycookies"GREY" to buy cookies.\n\
  3225. "GREY"Use "ORAN"/buycookiesjar"GREY" to buy a jar of "ORAN"600"GREY" cookies!\n",
  3226. ""GREY"Use "ORAN"/eatcookie"GREY" you will eat one cookie and gain 25 health!\n\
  3227. "GREY"Use "ORAN"/giftcookies"GREY" you will gift cookies to your friends.\n\n\
  3228. {FFFFFF}--------------------\nBe the cookie monster!");
  3229.  
  3230. SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Cookies!", bStr, "Close", "");
  3231. return 1;
  3232. }
  3233. CMD:setcookies(PARAMS)
  3234. {
  3235. LoginCheck(playerid);
  3236. LevelCheck(playerid, 3);
  3237.  
  3238. new Player, Cookiz;
  3239. if(sscanf(params, "ud", Player, Cookiz)) return SendUsage(playerid, "/setcookies <id> <cookies>", "Will set player's cookies!!");
  3240. else
  3241. {
  3242. if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
  3243.  
  3244. P_DATA[Player][Cookies] = Cookiz;
  3245.  
  3246. if(playerid != Player)
  3247. {
  3248. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY" cookies to "ORAN"%d",Name(Player), Player, Cookiz);
  3249. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"%s[%i]"GREY"'s cookies to "ORAN"%d", Name(playerid), playerid, Name(Player), Player, Cookiz);
  3250. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your cookies to "ORAN"%d"GREY"!", Name(playerid), playerid, Cookiz);
  3251. }
  3252. else
  3253. {
  3254. FormatMSG(playerid, Color:GREY, "You set your cookies to "ORAN"%d" ,Cookiz);
  3255. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his cookies to "ORAN"%d", Name(playerid), playerid, Cookiz);
  3256. }
  3257. }
  3258. return 1;
  3259. }
  3260. CMD:giftcookies(PARAMS)
  3261. {
  3262. LoginCheck(playerid);
  3263.  
  3264. new Player, Cookiz;
  3265. if(sscanf(params, "ud", Player, Cookiz)) return SendUsage(playerid, "/giftcookies <id> <cookies>", "Will gift cookies to specified player!");
  3266. else
  3267. {
  3268. if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
  3269. if(Player == playerid) return SendError(playerid, "Player entered is you!");
  3270. if(P_DATA[playerid][Cookies] < Cookiz) return SendError(playerid, "You don't have enough cookies to gift!");
  3271.  
  3272. P_DATA[playerid][Cookies] -= Cookiz;
  3273. P_DATA[Player][Cookies] += Cookiz;
  3274.  
  3275. FormatMSG(playerid, Color:GREY, "You gifted "ORAN"%d"GREY" cookies to "ORAN"%s[%i]"GREY"",Cookiz, Name(Player), Player);
  3276. FormatMSG(Player, Color:GREY, "Player "ORAN"%s[%i]"GREY" gifted you "ORAN"%d"GREY" cookies!", Name(playerid), playerid, Cookiz);
  3277.  
  3278. new Str[60];
  3279. format(Str, sizeof (Str), "~w~Cookies left:~n~~w~%d", P_DATA[playerid][Cookies]);
  3280. GameTextForPlayer(playerid, Str, 4000, 1);
  3281. format(Str, sizeof (Str), "~w~Cookies:~n~~w~%d", P_DATA[Player][Cookies]);
  3282. GameTextForPlayer(Player, Str, 4000, 1);
  3283. }
  3284. return 1;
  3285. }
  3286.  
  3287. CMD:eatcookie(PARAMS)
  3288. {
  3289. LoginCheck(playerid);
  3290.  
  3291. if(!P_DATA[playerid][Cookies])
  3292. return SendClientMessage(playerid, Color:GREY, "You don't have any cookies! Buy some with "ORAN"/buycookies");
  3293.  
  3294. P_DATA[playerid][Cookies]-= 1;
  3295. GameTextForPlayer(playerid, "~r~+~w~25~r~ Health", 5000, 1);
  3296.  
  3297. new Float:Health;
  3298. GetPlayerHealth(playerid, Health );
  3299. SetPlayerHealth(playerid,(Health + 25));
  3300. FormatMSG(playerid, Color:GREY, "Cookies left: "ORAN"%d", P_DATA[playerid][Cookies]);
  3301. return 1;
  3302. }
  3303.  
  3304. CMD:buycookiesjar(PARAMS)
  3305. {
  3306. LoginCheck(playerid);
  3307.  
  3308. new Yes[4];
  3309. if(sscanf(params, "s[4]", Yes)) return SendUsage(playerid, "/buycookiesjar <yes>", "Will buy a jar of 600 cookies. "ORAN"("GREY"600 * "GREE"$"#MAX_COOKIE_COST""ORAN")");
  3310. else
  3311. {
  3312. if(!strcmp(Yes, "yes"))
  3313. {
  3314. if(GetPlayerMoney(playerid) <= 600 * MAX_COOKIE_COST)
  3315. {
  3316. FormatMSG(playerid, Color:GREY, "Insufficient moneys! ("ORAN" 600 Cookies * "#MAX_COOKIE_COST" = "GREE"$%s"GREY")", FormatNumber(600 * MAX_COOKIE_COST));
  3317. return 0;
  3318. }
  3319. else
  3320. {
  3321. GivePlayerMoney(playerid, - (600 * MAX_COOKIE_COST));
  3322. P_DATA[playerid][Cookies] += 600;
  3323. FormatMSG(playerid, Color:GREY, "You bought a jar of "ORAN"600"GREY" cookies and costed you "GREE"$%s", FormatNumber(600 * MAX_COOKIE_COST));
  3324. }
  3325. }else return SendUsage(playerid, "/buycookiesjar <yes>", "Will buy a jar of 600 cookies. "ORAN"("GREY"600 * "GREE"$"#MAX_COOKIE_COST""ORAN")");
  3326. }
  3327. return 1;
  3328. }
  3329.  
  3330. CMD:buycookies(PARAMS)
  3331. {
  3332. LoginCheck(playerid);
  3333.  
  3334. new Cookiz;
  3335. if(sscanf(params, "i", Cookiz)) return SendUsage(playerid, "/buycookies <cookies>", "Will buy specified amount of cookies. One cookie = "GREE"$"#MAX_COOKIE_COST"");
  3336. else
  3337. {
  3338. if(Cookiz < 1 ) return SendUsage(playerid, "/buycookies <cookies>");
  3339. if(Cookiz > 600) return SendError(playerid, "You can't buy more than "ORAN"600"GREY" cookies at once! YOU COOKIE MONSTER!!!!");
  3340. if(GetPlayerMoney(playerid) <= Cookiz * MAX_COOKIE_COST)
  3341. {
  3342. FormatMSG(playerid, Color:GREY, "Insufficient moneys! ("ORAN" %d Cookies * "#MAX_COOKIE_COST" = "GREE"$%s"GREY")", Cookiz, FormatNumber(Cookiz * MAX_COOKIE_COST));
  3343. return 0;
  3344. }
  3345. else
  3346. {
  3347. GivePlayerMoney(playerid, - (Cookiz * MAX_COOKIE_COST));
  3348. P_DATA[playerid][Cookies] += Cookiz;
  3349. FormatMSG(playerid, Color:GREY, "You bought "ORAN"%d"GREY" cookies and costed you "GREE"$%s", Cookiz, FormatNumber(Cookiz * MAX_COOKIE_COST));
  3350. }
  3351. }
  3352. return 1;
  3353. }
  3354. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  3355. {
  3356. new _X = 0;
  3357. while (_X != MAX_PLAYERS)
  3358. {
  3359. if(IsPlayerConnected(_X) &&
  3360. GetPlayerState(_X) == PLAYER_STATE_SPECTATING &&
  3361. P_DATA[_X][Spec_ID] == playerid &&
  3362. P_DATA[_X][Spec_Type] == ADMIN_SPEC_TYPE_PLAYER)
  3363. {
  3364. SetPlayerInterior(_X, newinteriorid);
  3365. }
  3366. _X++;
  3367. }
  3368. }
  3369. public OnPlayerStateChange(playerid, newstate, oldstate)
  3370. {
  3371.  
  3372. return 1;
  3373. }
  3374. public OnPlayerEnterVehicle(playerid, vehicleid)
  3375. {
  3376. if(vehicleid == P_DATA[playerid][aCar])
  3377. return SendClientMessage(playerid, Color:GREY, " "GREY"Welcome back to your "ORAN"Admin Vehicle"GREY"!");
  3378.  
  3379. return 1;
  3380. }
  3381.  
  3382. CreateVehicleEx(playerid, model, Float:x, Float:z, Float:y, Float:rot, color1, color2, respawn_time, inveh = true)
  3383. {
  3384. DestroyVehicle(P_DATA[playerid][GiveCar]);
  3385. P_DATA[playerid][GiveCar] = CreateVehicle(model, Float:x, Float:z, Float:y, Float:rot, color1, color2, respawn_time);
  3386. if(inveh)PutPlayerInVehicle(playerid, P_DATA[playerid][GiveCar], 0);
  3387. }
  3388.  
  3389. CMD:accp(PARAMS)
  3390. {
  3391. LoginCheck(playerid);
  3392. LevelCheck(playerid, 1);
  3393.  
  3394. if(P_DATA[playerid][aCar] == -1)
  3395. return SendError(playerid, "You didn't spawn any admin vehicle! Spawn it with "ORAN"/acar");
  3396.  
  3397. if(!IsPlayerInVehicle(playerid, P_DATA[playerid][aCar]))
  3398. return SendError(playerid, "You must be in your "ORAN"Admin Vehicle"GREY" to use this command!");
  3399.  
  3400. SPD(playerid, Dialog:ACCP, LIST, ""W"Tune: "ORAN"Admin Car", ""GREY"Add nos\n\
  3401. "GREY"Change colors\n\
  3402. "GREY"Components\n\
  3403. "BLUE"Save Changes\n\
  3404. "GREE"Load Changes\n\
  3405. "ORAN"Discard Changes", "Select", "Close");
  3406. return 1;
  3407. }
  3408. CMD:acar(PARAMS)
  3409. {
  3410. LoginCheck(playerid);
  3411. LevelCheck(playerid, 1);
  3412.  
  3413. new Float:Pos[4];
  3414. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  3415.  
  3416. if(IsPlayerInAnyVehicle(playerid))
  3417. {
  3418. GetVehicleZAngle(GetPlayerVehicleID(playerid), Pos[3]);
  3419. GetPlayerFacingAngle(playerid, Pos[3]);
  3420. SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]+2);
  3421. }else GetPlayerFacingAngle(playerid, Pos[3]);
  3422.  
  3423. if(P_DATA[playerid][aCar] == -1)
  3424. {
  3425. DestroyVehicle(P_DATA[playerid][aCar]);
  3426. P_DATA[playerid][aCar] = CreateVehicle(415, Pos[0], Pos[1], Pos[2], Pos [3], 0, 0, 90000);
  3427. PutPlayerInVehicle(playerid, P_DATA[playerid][aCar], 0);
  3428. SetVehicleHealth(P_DATA[playerid][aCar], 99999.0);
  3429.  
  3430. GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~~h~Admin car created!", 3000, 3);
  3431. ZaAdminCar[playerid] = CreatePlayer3DTextLabel(playerid, "Your Admin Car", Color:ORAN, 0.0, 0.0, 0.0, 120.0, (0xFFFF), P_DATA[playerid][aCar], 1);
  3432. }
  3433. else
  3434. {
  3435. GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~~h~Admin car called!", 3000, 3);
  3436.  
  3437. SetVehiclePos(P_DATA[playerid][aCar], Pos[0], Pos[1], Pos[2]);
  3438. SetVehicleZAngle(P_DATA[playerid][aCar], Pos[3]);
  3439. PutPlayerInVehicle(playerid, P_DATA[playerid][aCar], 0);
  3440. }
  3441. SendClientMessage(playerid, Color:GREY, "Use "ORAN"/accp"GREY" to tune your admin vehicle!!");
  3442.  
  3443. return 1;
  3444. }
  3445. CMD:vips(PARAMS)
  3446. {
  3447. LoginCheck(playerid);
  3448.  
  3449. new C, S[1024], cString[150];
  3450.  
  3451. foreach(Player, i){
  3452. if(P_DATA[i][Vip] > 0){
  3453. C++;
  3454. }
  3455. }
  3456.  
  3457. format(cString, sizeof (cString), "%s", (C) ? (OnlineCheck("Vips", C)) : ("{FF0000}No VIP members online!")) ;
  3458.  
  3459. if(C == 1){
  3460. foreach(Player, i){
  3461. if(P_DATA[i][Vip] > 0){
  3462. format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"L:%d|ID:%d"W"]",cString, Name(i), P_DATA[i][Vip],i);
  3463. }
  3464. }
  3465. }
  3466.  
  3467. if(C > 1){
  3468. foreach(Player, i){
  3469. if(P_DATA[i][Vip] > 0){
  3470. format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"L:%d|ID:%d"W"], ",S, Name(i), P_DATA[i][Vip],i);
  3471.  
  3472. if(!(i % MAX_SHOW_PER_ROW)){
  3473. if(i != 0){
  3474. strdel(S, strlen(S) - 2, strlen(S));
  3475. strins(S, "\n", strlen(S));
  3476. //S[0] = EOS;
  3477. }
  3478. }
  3479. }
  3480. }
  3481. }
  3482. if(!C) memcpy(S, cString, 0, 1024 );
  3483. if(strlen(S) < 1024) SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Online VIP members!", S, "Close", "");
  3484. if(strlen(S) > 1024) SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Online VIP members!", "{FF0000}An error has occured while trying to show the online VIP Members!\n{FFFFFF}Please contact the owner and inform him about this problem!", "Close", "");
  3485. return 1;
  3486. }
  3487. CMD:muted(PARAMS)
  3488. {
  3489. LoginCheck(playerid);
  3490.  
  3491. new C, S[1024], cString[150];
  3492.  
  3493. foreach(Player, i){
  3494. if(P_DATA[i][Muted] > 0){
  3495. C++;
  3496. }
  3497. }
  3498.  
  3499. format(cString, sizeof (cString), "%s", (C) ? (OnlineCheck("Muted", C)) : (""W"--------------\n{FF0000}No Muted players online!\n"W"--------------\n")) ;
  3500.  
  3501. if(C == 1){
  3502. foreach(Player, i){
  3503. if(P_DATA[i][Muted] > 0){
  3504. if(!P_DATA[i][MutedTime]){
  3505. format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"TIME:Forever|ID:%d"W"]",cString, Name(i), i);
  3506. }else{
  3507. format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"TIME:%d|ID:%d"W"]",cString, Name(i), P_DATA[i][MutedTime],i);}
  3508. }
  3509. }
  3510. }
  3511.  
  3512. if(C > 1){
  3513. foreach(Player, i){
  3514. if(P_DATA[i][Muted] > 0){
  3515. if(!P_DATA[i][MutedTime]){
  3516. format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"TIME:Forever|ID:%d"W"]",cString, Name(i), i);
  3517. }else{
  3518. format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"TIME:%s|ID:%d"W"]",cString, Name(i), P_DATA[i][MutedTime] ? (MiniFormat(P_DATA[i][MutedTime], " {FFFFFF}seconds")) : (" {FF0000}Forever"),i);}
  3519. if(!(i % MAX_SHOW_PER_ROW)){
  3520. if(i != 0){
  3521. strdel(S, strlen(S) - 2, strlen(S));
  3522. strins(S, "\n", strlen(S));
  3523. }
  3524. }
  3525. }
  3526. }
  3527. }
  3528. if(!C) format(S, sizeof (S), "%s", cString);
  3529. if(strlen(S) < 1024) SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Muted players!", S, "Close", "");
  3530. if(strlen(S) > 1024) SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Muted players!", "{FF0000}An error has occured while trying to show the online players!\n{FFFFFF}Please contact the owner and inform him about this problem!", "Close", "");
  3531. return 1;
  3532. }
  3533. CMD:jailed(PARAMS)
  3534. {
  3535. LoginCheck(playerid);
  3536.  
  3537. new C, S[1024], cString[150];
  3538.  
  3539. foreach(Player, i){
  3540. if(P_DATA[i][Jailed] > 0){
  3541. C++;
  3542. }
  3543. }
  3544.  
  3545. format(cString, sizeof (cString), "%s", (C) ? (OnlineCheck("Jailed", C)) : (""W"--------------\n{FF0000}No Jailed players online!\n"W"--------------\n")) ;
  3546.  
  3547. if(C == 1){
  3548. foreach(Player, i){
  3549. if(P_DATA[i][Jailed] > 0){
  3550. if(!P_DATA[i][JailTime]){
  3551. format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"TIME:Forever|ID:%d"W"]",cString, Name(i), i);
  3552. }else{
  3553. format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"TIME:%d|ID:%d"W"]",cString, Name(i), P_DATA[i][JailTime],i);}
  3554. }
  3555. }
  3556. }
  3557.  
  3558. if(C > 1){
  3559. foreach(Player, i){
  3560. if(P_DATA[i][Jailed] > 0){
  3561. if(!P_DATA[i][JailTime]){
  3562. format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"TIME:Forever|ID:%d"W"]",cString, Name(i), i);
  3563. }else{
  3564. format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"TIME:%s|ID:%d"W"]",cString, Name(i), P_DATA[i][JailTime] ? (MiniFormat(P_DATA[i][JailTime], " {FFFFFF}seconds")) : (" {FF0000}Forever"),i);}
  3565. if(!(i % MAX_SHOW_PER_ROW)){
  3566. if(i != 0){
  3567. strdel(S, strlen(S) - 2, strlen(S));
  3568. strins(S, "\n", strlen(S));
  3569. }
  3570. }
  3571. }
  3572. }
  3573. }
  3574. if(!C) format(S, sizeof (S), "%s", cString);
  3575. if(strlen(S) < 1024) SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Jailed players!", S, "Close", "");
  3576. if(strlen(S) > 1024) SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Jailed players!", "{FF0000}An error has occured while trying to show the online players!\n{FFFFFF}Please contact the owner and inform him about this problem!", "Close", "");
  3577. return 1;
  3578. }
  3579. CMD:frozen(PARAMS)
  3580. {
  3581. LoginCheck(playerid);
  3582. LevelCheck(playerid, 1);
  3583.  
  3584. new C, S[1024], cString[150];
  3585.  
  3586. foreach(Player, i){
  3587. if(P_DATA[i][Vip] > 0){
  3588. C++;
  3589. }
  3590. }
  3591.  
  3592. format(cString, sizeof (cString), "%s", (C) ? (OnlineCheck("Frozen", C)) : ("{FF0000}No VIP members online!")) ;
  3593.  
  3594. if(C == 1){
  3595. foreach(Player, i){
  3596. if(P_DATA[i][Vip] > 0){
  3597. format(S, sizeof (S), "%s"BLUE"%s",cString, Name(i));
  3598. }
  3599. }
  3600. }
  3601.  
  3602. if(C > 1){
  3603. foreach(Player, i){
  3604. if(P_DATA[i][Vip] > 0){
  3605. format(S, sizeof (S), "%s"BLUE"%s, ",S, Name(i));
  3606.  
  3607. if(!(i % MAX_SHOW_PER_ROW)){
  3608. if(i != 0){
  3609. strdel(S, strlen(S) - 2, strlen(S));
  3610. strins(S, "\n", strlen(S));
  3611. //S[0] = EOS;
  3612. }
  3613. }
  3614. }
  3615. }
  3616. }
  3617. if(!C) format(S, sizeof (S), "%s", cString);
  3618. if(strlen(S) < 1024) SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Frozen Players!", S, "Close", "");
  3619. if(strlen(S) > 1024) SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Frozen Players!", "{FF0000}An error has occured while trying to show the Frozen Players!\n{FFFFFF}Please contact the owner and inform him about this problem!", "Close", "");
  3620. return 1;
  3621. }
  3622. CMD:admins(PARAMS)
  3623. {
  3624. LoginCheck(playerid);
  3625.  
  3626. new C, S[1024], cString[150];
  3627.  
  3628. foreach(Player, i){
  3629. if(P_DATA[i][Level] > 0){
  3630. C++;
  3631. }
  3632. }
  3633.  
  3634. format(cString, sizeof (cString), "%s", (C) ? (OnlineCheck("Admins", C)) : ("{FF0000}No VIP members online!")) ;
  3635.  
  3636. if(C == 1){
  3637. foreach(Player, i){
  3638. if(P_DATA[i][Level] > 0){
  3639. format(S, sizeof (S), "%s"GREE"%s"W"["GREE"L:%d|ID:%d"W"]",cString, Name(i), P_DATA[i][Level],i);
  3640. }
  3641. }
  3642. }
  3643.  
  3644. if(C > 1){
  3645. foreach(Player, i){
  3646. if(P_DATA[i][Level] > 0){
  3647. format(S, sizeof (S), "%s"GREE"%s"W"["GREE"L:%d|ID:%d"W"], ",S, Name(i), P_DATA[i][Level],i);
  3648.  
  3649. if(!(i % MAX_SHOW_PER_ROW)){
  3650. if(i != 0){
  3651. strdel(S, strlen(S) - 2, strlen(S));
  3652. strins(S, "\n", strlen(S));
  3653. //S[0] = EOS;
  3654. }
  3655. }
  3656. }
  3657. }
  3658. }
  3659. if(!C) format(S, sizeof (S), "%s", cString);
  3660. if(strlen(S) < 1024) SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Online Administrators!", S, "Close", "");
  3661. if(strlen(S) > 1024) SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Online Administrators!", "{FF0000}An error has occured while trying to show the online administrators!\n{FFFFFF}Please contact the owner and inform him about this problem!", "Close", "");
  3662. return 1;
  3663. }
  3664.  
  3665. CMD:wcheck(PARAMS)
  3666. {
  3667. LoginCheck(playerid);
  3668. LevelCheck(playerid, 4);
  3669.  
  3670. new Player;
  3671. if(sscanf(params, "u", Player)) return SendUsage(playerid, "/wcheck <id>", "Will check player's weapon and ammo");
  3672. else
  3673. {
  3674. if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
  3675.  
  3676. new Weapon, Ammo, WeaponName[20], String[715];
  3677.  
  3678. if(Player != playerid) format(String, sizeof String, ""ORAN"%s"GREY"'s weapons:\n\n", Name(Player));
  3679. else String = "{FFFFFF}Checking your weapons\n";
  3680.  
  3681. for (new w = 0; w < 9; w++)
  3682. {
  3683. GetPlayerWeaponData(Player, w, Weapon, Ammo);
  3684.  
  3685. if(Ammo < 0) Ammo = 9999;
  3686. if(Weapon != 0)
  3687. {
  3688. GetWeaponName(Weapon, WeaponName[w], 20);
  3689. format(String, sizeof String, "%s"GREY"Weapon: "ORAN"%s"GREY" Ammo: "ORAN"%d\n", String, WeaponName[w], Ammo);
  3690. }
  3691. }
  3692. SPD(playerid, Dialog:Empty, BOX, ""GREY"Checking Weapons!", String, "Close", "");
  3693. }
  3694. return 1;
  3695. }
  3696. CMD:fake(PARAMS)
  3697. {
  3698. LoginCheck(playerid);
  3699. LevelCheck(playerid, 5);
  3700.  
  3701. SendClientMessage(playerid, Color:GREY, "/fakechat /fakecmd /fakedeath /fakecon /fakedisc");
  3702. return 1;
  3703. }
  3704. CMD:fakedisc(PARAMS)
  3705. {
  3706. LoginCheck(playerid);
  3707. LevelCheck(playerid, 5);
  3708.  
  3709. new Player, Reason;
  3710. if(sscanf(params, "uD(1)", Player, Reason)) return SendUsage(playerid, "/fakedisc "GREY"<id> <!reason>", "Will send a fake disconnection of the player!("ORAN"0 - Crash | 1 - Leaving | 2 - Kick/Ban "GREY")");
  3711. else
  3712. {
  3713. if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
  3714. if(Reason > 3 || Reason < 0) return SendError(playerid, "Invalid reason! ("ORAN" 0 - Crash | 1 - Leaving | 2 - Kick/Ban "GREY")");
  3715. SendClientMessage(playerid, Color:GREY, "Fake command sent!");
  3716.  
  3717. new zStr[129];
  3718. switch(Reason)
  3719. {
  3720. case 0: format(zStr, sizeof (zStr), "%s["W"%i"ORAN"]"W" Has left the server! "ORAN"[CRASH]", Name(playerid), playerid);
  3721. case 1: format(zStr, sizeof (zStr), "%s["W"%i"ORAN"]"W" Has left the server! "ORAN"[LEAVING]", Name(playerid), playerid);
  3722. case 2: format(zStr, sizeof (zStr), "%s["W"%i"ORAN"]"W" Has left the server! "ORAN"[KICK"W"/"ORAN"BAN]", Name(playerid), playerid);
  3723. }
  3724.  
  3725. SendClientMessageToAll(Color:ORAN, zStr);
  3726. }
  3727. return 1;
  3728. }
  3729. CMD:fakecon(PARAMS)
  3730. {
  3731. LoginCheck(playerid);
  3732. LevelCheck(playerid, 5);
  3733.  
  3734. new Player;
  3735. if(sscanf(params, "u",Player)) return SendUsage(playerid, "/fakecon "GREY"<id>", "Will send a fake connection of the player!");
  3736. else
  3737. {
  3738. if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
  3739.  
  3740. SendClientMessage(playerid, Color:GREY, "Fake command sent!");
  3741.  
  3742. new String[256];
  3743. format(String, sizeof (String), "%s["W"%i"ORAN"]"W" Has joined the server!", Name(Player), Player);
  3744. SendClientMessageToAll(Color:ORAN, String);
  3745. }
  3746. return 1;
  3747. }
  3748. CMD:fakecmd(PARAMS)
  3749. {
  3750. LoginCheck(playerid);
  3751. LevelCheck(playerid, 5);
  3752.  
  3753. new Player, Command[129];
  3754. if(sscanf(params, "us[129]",Player, Command)) return SendUsage(playerid, "/fakecmd "GREY"<id> <command>", "Will send a fake command! The command must include the /.");
  3755. else
  3756. {
  3757. if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
  3758.  
  3759. SendClientMessage(playerid, Color:GREY, "Fake command sent!");
  3760.  
  3761. CallRemoteFunction("OnPlayerCommandText", "is", Player, Command);
  3762. }
  3763. return 1;
  3764. }
  3765. CMD:fakemsg(PARAMS)
  3766. {
  3767. LoginCheck(playerid);
  3768. LevelCheck(playerid, 5);
  3769.  
  3770. new Player, xChat[129];
  3771. if(sscanf(params, "us[129]",Player, xChat)) return SendUsage(playerid, "/fakemsg "GREY"<id> [message]", "Will send a fake message of the specified player!");
  3772. else
  3773. {
  3774. if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
  3775.  
  3776. SendClientMessage(playerid, Color:GREY, "Fake chat sent!");
  3777.  
  3778. SendPlayerMessageToAll(Player, xChat);
  3779. }
  3780. return 1;
  3781. }
  3782. CMD:fakechat(PARAMS)
  3783. {
  3784. LoginCheck(playerid);
  3785. LevelCheck(playerid, 5);
  3786.  
  3787. new Player, xChat[129];
  3788. if(sscanf(params, "us[129]",Player, xChat)) return SendUsage(playerid, "/fakechat "GREY"<id> [message]", "Will send a fake message of the specified player!");
  3789. else
  3790. {
  3791. if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
  3792.  
  3793. SendClientMessage(playerid, Color:GREY, "Fake chat sent!");
  3794.  
  3795. SendPlayerMessageToAll(Player, xChat);
  3796. }
  3797. return 1;
  3798. }
  3799. CMD:fakedeath(PARAMS)
  3800. {
  3801. LoginCheck(playerid);
  3802. LevelCheck(playerid, 5);
  3803.  
  3804. #define Killer 0
  3805. #define Killed 1
  3806.  
  3807. new Fake[2], Weapon;
  3808. if(sscanf(params, "uuD(-1)", Fake[Killer], Fake[Killed], Weapon))
  3809. return SendUsage(playerid, "/fakedeath "GREY"<killer> <killed> <!weapon id>", "Will show an icon on the right, a fake death! (! Means it's optional, will be random!)");
  3810. else
  3811. {
  3812. if(Fake[Killer] == 0xFFFF) return SendError(playerid, "Killer is not connected!");
  3813. if(Fake[Killed] == 0xFFFF) return SendError(playerid, "Killed is not connected!");
  3814. if(Fake[Killer] == 0xFFFF && Fake[Killed] == 0xFFFF) return SendError(playerid, "Killer and Killed are both offline!");
  3815.  
  3816. if(Weapon == -1)
  3817. {
  3818. new rWeapon;
  3819. switch (random(2))
  3820. {
  3821. case 0: rWeapon = random(19);
  3822. case 1: rWeapon = 21 + random(26);
  3823. default: rWeapon = 0;
  3824. }
  3825. Weapon = rWeapon;
  3826. return SendDeathMessage(Fake[Killer], Fake[Killed], Weapon),
  3827. SendClientMessage(playerid, Color:GREY, "Fake death sent!");
  3828. }
  3829.  
  3830. if(!IsValidWeapon(Weapon))
  3831. return SendError(playerid, "Invalid Weapon ID!");
  3832.  
  3833. SendDeathMessage(Fake[Killer], Fake[Killed], Weapon);
  3834.  
  3835. SendClientMessage(playerid, Color:GREY, "Fake death sent!");
  3836. }
  3837. return 1;
  3838. }
  3839. CMD:removeacc(PARAMS)
  3840. {
  3841. LoginCheck(playerid);
  3842. LevelCheck(playerid, 5);
  3843.  
  3844. new Account[MAX_PLAYER_NAME], Reason[100];
  3845. if(sscanf(params, "s["#MAX_PLAYER_NAME"]s[100]", Account, Reason)) return SendUsage(playerid, "/removeacc [account] [reason]", "Will remove the specified account from the folder");
  3846. else
  3847. {
  3848. if(AccountExist(Account))
  3849. {
  3850. if(!strcmp(Name(playerid), Account, false))
  3851. return SendError(playerid, "You cannot delete your own account!");
  3852.  
  3853. new Query[100];
  3854. format(Query, 200, "DELETE FROM `Accounts` WHERE `Name` = '%s'", Account);
  3855. DB::Query(_DB, Query);
  3856.  
  3857. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" has deleted account: "ORAN"%s"GREY"["ORAN"Reason: %s"GREY"]", Name(playerid), playerid, Account, Reason);
  3858. FormatMSG(playerid, Color:GREY, "Account "ORAN"%s"GREY" has been deleted!", Account);
  3859. FormatMSG(playerid, Color:ORAN, "Reason: "GREY"%s", Reason);
  3860. }
  3861. else
  3862. {
  3863. SendError(playerid, "Account does not exist in the database!");
  3864. return 1;
  3865. }
  3866. }
  3867. return 1;
  3868. }
  3869. CMD:aweapons(PARAMS)
  3870. {
  3871. LoginCheck(playerid);
  3872. LevelCheck(playerid, 2);
  3873.  
  3874. GivePlayerWeapon(playerid, 24, 99999);
  3875. GivePlayerWeapon(playerid, 26, 99999);
  3876. GivePlayerWeapon(playerid, 29, 99999);
  3877. GivePlayerWeapon(playerid, 31, 99999);
  3878. GivePlayerWeapon(playerid, 33, 99999);
  3879. GivePlayerWeapon(playerid, 38, 99999);
  3880. GivePlayerWeapon(playerid, 9, 1);
  3881. SendClientMessage(playerid, Color:GREY, ""ORAN"*"GREY" Admin weapons received!");
  3882. return 1;
  3883. }
  3884. CMD:car(PARAMS)
  3885. {
  3886. LoginCheck(playerid);
  3887. LevelCheck(playerid, 1);
  3888.  
  3889. new Car[30], Color[2];
  3890. if(sscanf(params, "s[30]D(-1)D(-1)", Car, Color[0], Color[1])) return SendUsage(playerid, "/car "GREY"<name/model> <!color1> <!color2>", "Will give you a vehicle! ("ORAN"!"GREY" means that it's Optional)");
  3891. else
  3892. {
  3893. if(IsPlayerInAnyVehicle(playerid)) return SendError(playerid, "You are already in a vehicle!");
  3894.  
  3895. new CarModel;
  3896. if(IsNumeric(Car)) CarModel = strval(Car);
  3897. else CarModel = GetVModelFromName(Car);
  3898.  
  3899. if(CarModel < 400 || CarModel > 611) return SendError(playerid, "Invalid vehicle model/name!");
  3900.  
  3901. if(Color[0] == -1) Color[0] = random(250);
  3902. if(Color[1] == -1) Color[1] = random(250);
  3903.  
  3904. new Float: Pos[4];
  3905. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  3906. GetPlayerFacingAngle(playerid, Pos[3]);
  3907. CreateVehicleEx(playerid, CarModel, Pos[0], Pos[1], Pos[2], Pos[3], Color[0], Color[1], 900000);
  3908.  
  3909. FormatMSG(playerid, Color:GREY, "You spawned "ORAN"%s"GREY" ("ORAN"Model: %d"GREY").", GetVehicleName(CarModel), CarModel);
  3910. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" spawned a "ORAN"%s"GREY" ("ORAN"Model: %d"GREY").", Name(playerid), playerid, GetVehicleName(CarModel), CarModel);
  3911. }
  3912. return 1;
  3913. }
  3914. CMD:givecar(PARAMS)
  3915. {
  3916. LoginCheck(playerid);
  3917. LevelCheck(playerid, 3);
  3918.  
  3919. new Player, Car[30];
  3920. if(sscanf(params, "uS(415)[30]", Player, Car)) return SendUsage(playerid, "/givecar "GREY"<id> <name/model>", "Will give the specified vehicle to the player"W" If vehicleid is not set, default car is a Cheetah!");
  3921. else
  3922. {
  3923. if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
  3924. if(Player == playerid) return SendError(playerid, "Player entered is you! You can use "ORAN"/car"GREY" instead!");
  3925. if(IsPlayerInAnyVehicle(Player)) return SendError(playerid, "Player is already driving a vehicle!");
  3926.  
  3927. CheckImune(playerid, Player);
  3928.  
  3929. new CarModel;
  3930. if(IsNumeric(Car)) CarModel = strval(Car);
  3931. else CarModel = GetVModelFromName(Car);
  3932.  
  3933. if(CarModel < 400 || CarModel > 611) return SendError(playerid, "Invalid vehicle model/name!");
  3934. new Float: Pos[4];
  3935.  
  3936. GetPlayerPos(Player, Pos[0], Pos[1], Pos[2]);
  3937. GetPlayerFacingAngle(Player, Pos[3]);
  3938. CreateVehicleEx(Player, CarModel, Pos[0], Pos[1], Pos[2], Pos[3], random(250), random(250), 900000);
  3939.  
  3940. FormatMSG(playerid, Color:GREY, "You gave "ORAN"%s[%i] "GREY"an"ORAN" %s"GREY" ("ORAN"Model: %d"GREY").", Name(Player), Player, GetVehicleName(CarModel), CarModel);
  3941. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i] "GREY"gave you an"ORAN" %s"GREY" ("ORAN"Model: %d"GREY").", Name(playerid), playerid, GetVehicleName(CarModel), CarModel);
  3942. }
  3943. return 1;
  3944. }
  3945. CMD:giveallweapon(PARAMS)
  3946. {
  3947. LoginCheck(playerid);
  3948. LevelCheck(playerid, 4);
  3949.  
  3950. new Weapon[10], Ammo;
  3951. if(sscanf(params, "s[10]D(9999)", Weapon, Ammo)) return SendUsage(playerid, "/giveallweapon "GREY"<weaponid/name> <ammo>", "It will give a weapon to a player with the specified ammo!");
  3952. else
  3953. {
  3954. if(Ammo <= 0) return SendError(playerid, "Invalid ammo entered!");
  3955.  
  3956.  
  3957. new WeaponID;
  3958. if(IsNumeric(Weapon)) WeaponID = strval(Weapon);
  3959. else WeaponID = GetWeaponIDFromName(Weapon);
  3960.  
  3961. if(!IsValidWeapon(WeaponID))
  3962. return SendError(playerid, "Invalid weapon id/name inserted!");
  3963.  
  3964. new WeaponName[30];
  3965.  
  3966.  
  3967. GetWeaponName(WeaponID, WeaponName, 30);
  3968. foreach(Player, i)
  3969. {
  3970. if(P_DATA[i][Level] != 5)GivePlayerWeapon(i, WeaponID, Ammo);GameTextForPlayer(i, "~w~Weapon received!",3000,1);
  3971. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave everyone a "ORAN"%s(WID:%d)"GREY" with "ORAN"%d"GREY" ammo", Name(playerid), playerid, WeaponName, WeaponID, Ammo);
  3972. }
  3973. FormatMSG(playerid, Color:GREY, "You gave everyone a "ORAN"%s(WID:%d)"GREY" with "ORAN"%d"GREY" ammo", WeaponName, WeaponID, Ammo);
  3974. }
  3975. return 1;
  3976. }
  3977. CMD:giveweapon(PARAMS)
  3978. {
  3979. LoginCheck(playerid);
  3980. LevelCheck(playerid, 3);
  3981.  
  3982. new Player, Weapon[10], Ammo;
  3983. if(sscanf(params, "us[10]D(9999)", Player, Weapon, Ammo)) return SendUsage(playerid, "/giveweapon "GREY"<id> <weaponid/name> <ammo>", "It will give a weapon to a player with the specified ammo!");
  3984. else
  3985. {
  3986. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  3987. if(Ammo <= 0) return SendError(playerid, "Invalid ammo entered!");
  3988. CheckImune(playerid, Player);
  3989.  
  3990. new WeaponID;
  3991. if(IsNumeric(Weapon)) WeaponID = strval(Weapon);
  3992. else WeaponID = GetWeaponIDFromName(Weapon);
  3993.  
  3994. if(!IsValidWeapon(WeaponID))
  3995. return SendError(playerid, "Invalid weapon id/name inserted!");
  3996.  
  3997. new WeaponName[30];
  3998. GetWeaponName(WeaponID, WeaponName, 30);
  3999. GivePlayerWeapon(Player, WeaponID, Ammo);
  4000.  
  4001. if(Player == playerid)
  4002. {
  4003. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" gave himself a "ORAN"%s(WID:%d)"GREY" with "ORAN"%d"GREY" ammo", Name(playerid), playerid, WeaponName, WeaponID, Ammo);
  4004. FormatMSG(playerid, Color:GREY, "You gave yourself a "ORAN"%s(WID:%d)"GREY" with "ORAN"%d"GREY" ammo", WeaponName, WeaponID, Ammo);
  4005. }
  4006. else
  4007. {
  4008. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" gave "ORAN"%s[%i]"GREY" "ORAN"%s(WID:%d)"GREY" with "ORAN"%d"GREY" ammo", Name(playerid), playerid, Name(Player), Player, WeaponName, WeaponID, Ammo);
  4009. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave you a "ORAN"%s(WID:%d)"GREY" with "ORAN"%d"GREY" ammo", Name(playerid), playerid, WeaponName, WeaponID, Ammo);
  4010. FormatMSG(playerid, Color:GREY, "You gave "ORAN"%s[%i]"GREY" a "ORAN"%s(WID:%d)"GREY" with "ORAN"%d"GREY" ammo", Name(Player), Player, WeaponName, WeaponID, Ammo);
  4011. }
  4012. GameTextForPlayer(Player, "~w~Weapon received!",3000,1);
  4013. }
  4014. return 1;
  4015. }
  4016.  
  4017. CMD:gotopos(PARAMS)
  4018. {
  4019. LoginCheck(playerid);
  4020. LevelCheck(playerid, 1);
  4021.  
  4022. new Float: Pos[3];
  4023. if(sscanf(params, "fff", Pos[0], Pos[1], Pos[2])) return SendUsage(playerid, "/gotopos "GREY"<x.x> <y.y> <z.z>", "Will teleport you to the entered coords!");
  4024. else
  4025. {
  4026. if(IsPlayerInAnyVehicle(playerid))SetVehiclePos(GetPlayerVehicleID(playerid), Pos[0], Pos[1], Pos[2]);
  4027. else SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  4028.  
  4029. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" teleported to coords: "ORAN"%.1f %.1f %.1f", Name(playerid), playerid, Pos[0], Pos[1], Pos[2]);
  4030. FormatMSG(playerid, Color:GREY, "You teleported to coords: "ORAN"%.1f %.1f %.1f", Pos[0], Pos[1], Pos[2]);
  4031. }
  4032. return 1;
  4033. }
  4034.  
  4035. CMD:akill(PARAMS)
  4036. {
  4037. LoginCheck(playerid);
  4038. LevelCheck(playerid, 3);
  4039.  
  4040. new Player;
  4041. if(sscanf(params, "u", Player)) return SendUsage(playerid, "/akill "GREY"<id>", "Will kill the specified player");
  4042. else
  4043. {
  4044. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  4045. if(Player == playerid ) return SendError(playerid, "Player entered is you!");
  4046. CheckImune(playerid, Player);
  4047.  
  4048. SetPlayerHealth(Player, 0.0);
  4049.  
  4050. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" killed "ORAN"%s[%i]", Name(playerid), playerid, Name(Player), Player);
  4051. FormatMSG(playerid, Color:GREY, "You killed "ORAN"%s[%i]", Name(Player), Player);
  4052. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" killed you!", Name(playerid), playerid);
  4053. }
  4054. return 1;
  4055. }
  4056.  
  4057. CMD:spawn(PARAMS)
  4058. {
  4059. LoginCheck(playerid);
  4060. LevelCheck(playerid, 1);
  4061.  
  4062. new Player;
  4063. if(sscanf(params, "u", Player)) return SendUsage(playerid, "/spawn "GREY"<id>", "It will spawn the player on the server's spawn points!");
  4064. else
  4065. {
  4066. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  4067. if(Player == playerid ) return SendError(playerid, "Player entered is you!");
  4068. CheckImune(playerid, Player);
  4069.  
  4070. SpawnPlayer(Player);
  4071.  
  4072. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" spawned "ORAN"%s[%i]", Name(playerid), playerid, Name(Player), Player);
  4073. FormatMSG(playerid, Color:GREY, "You spawned "ORAN"%s[%i]", Name(Player), Player);
  4074. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" spawned you!", Name(playerid), playerid);
  4075. }
  4076. return 1;
  4077. }
  4078. CMD:explodeall(PARAMS)
  4079. {
  4080. LoginCheck(playerid);
  4081. LevelCheck(playerid, 4);
  4082.  
  4083. new
  4084. Float:_P[3];
  4085. foreach(Player, i)
  4086. {
  4087. if(P_DATA[i][Level] != 5)
  4088. {
  4089. if(i != playerid)
  4090. {
  4091. GetPlayerPos(i,_P[0], _P[1], _P[2]);CreateExplosion(_P[0], _P[1], _P[2], 7, 10.0);
  4092. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" exploded you and everyone else!", Name(playerid), playerid);
  4093. }
  4094. }
  4095. }
  4096. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" exploded everyone!", Name(playerid), playerid);
  4097. FormatMSG(playerid, Color:GREY, "You exploded everyone!",0);
  4098.  
  4099. return 1;
  4100. }
  4101.  
  4102. CMD:disarmall(PARAMS)
  4103. {
  4104. LoginCheck(playerid);
  4105. LevelCheck(playerid, 4);
  4106.  
  4107. foreach(Player, i)
  4108. {
  4109. if(P_DATA[i][Level] != 5)
  4110. {
  4111. if(i != playerid)
  4112. {
  4113. ResetPlayerWeapons(i);
  4114. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" disarmed you and everyone else!", Name(playerid), playerid);
  4115. }
  4116. }
  4117. }
  4118. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" disarmed everyone!", Name(playerid), playerid);
  4119. FormatMSG(playerid, Color:GREY, "You disarmed everyone!",0);
  4120.  
  4121. return 1;
  4122. }
  4123. CMD:disarm(PARAMS)
  4124. {
  4125. LoginCheck(playerid);
  4126. LevelCheck(playerid, 2);
  4127.  
  4128. new Player;
  4129. if(sscanf(params, "u", Player)) return SendUsage(playerid, "/disarm "GREY"<id>", "Will remove all player's weapons.");
  4130. else
  4131. {
  4132. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  4133. if(Player == playerid ) return SendError(playerid, "Player entered is you!");
  4134. CheckImune(playerid, Player);
  4135. ResetPlayerWeapons(Player);
  4136.  
  4137. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" removed "ORAN"%s[%i]"GREY"'s weapons!", Name(playerid), playerid, Name(Player), Player);
  4138. FormatMSG(playerid, Color:GREY, "You disarmed "ORAN"%s[%i]", Name(Player), Player);
  4139. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" disarmed you!", Name(playerid), playerid);
  4140. }
  4141. return 1;
  4142. }
  4143. CMD:setstats(PARAMS)
  4144. {
  4145. LoginCheck(playerid);
  4146. LevelCheck(playerid, 5);
  4147.  
  4148. new Player;
  4149. if(sscanf(params, "u", Player))
  4150. {
  4151. SetPVarInt(playerid, "StatsOf", playerid);
  4152. ShowPlayerDialog(playerid, Dialog:SetStatsSure, BOX, "{FFFFFF}Information:", ""GREY"You are on your way to edit your stats!\n"W"Proceed?", "Yes", "Exit");
  4153. return SendUsage(playerid, "/setstats "GREY"<id>", "Will open a dialog where you can set player's stats to the desired ones!");
  4154. }
  4155. else
  4156. {
  4157. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  4158. if(Player == playerid ) SetPVarInt(playerid, "StatsOf", playerid),
  4159. ShowPlayerDialog(playerid, Dialog:SetStatsSure, BOX, "{FFFFFF}Information:", ""GREY"You are on your way to edit your stats!\n"W"Proceed?", "Yes", "Exit");
  4160. else
  4161. {
  4162. new zStr[160];
  4163. format(zStr, 160, ""GREY"You are on your way to edit "ORAN"%s"GREY"'s stats!\n"W"Proceed?", Name(Player));
  4164. ShowPlayerDialog(playerid, Dialog:SetStatsSure, BOX, "{FFFFFF}Information:", zStr, "Yes", "Exit");
  4165. SetPVarInt(playerid, "StatsOf", Player);
  4166. }
  4167. }
  4168. return 1;
  4169. }
  4170. CMD:getip(PARAMS)
  4171. {
  4172. LoginCheck(playerid);
  4173. LevelCheck(playerid, 1);
  4174.  
  4175. new Player;
  4176. if(sscanf(params, "u", Player)) return SendUsage(playerid, "/getip "GREY"<id>", "Will get the IP of the specified player!");
  4177. else
  4178. {
  4179. CheckImune(playerid, Player);
  4180. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  4181. if(Player == playerid )
  4182. {
  4183. FormatMSG(playerid, Color:GREY, "Your IP is: "ORAN"%s"GREY" !", GetPlayerIPEx(playerid));
  4184. return 1;
  4185. }
  4186. else
  4187. {
  4188. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" used command "ORAN"\"/getip\""GREY" on "ORAN"%s[%i]"GREY"", Name(playerid), playerid, Name(Player), Player);
  4189. FormatMSG(playerid, Color:GREY, "Player: "ORAN"%s[%i]"GREY" IP: "ORAN"\"%s\"", Name(Player), Player, GetPlayerIPEx(Player));
  4190. }
  4191. }
  4192. return 1;
  4193. }
  4194.  
  4195. CMD:bankrupt(PARAMS)
  4196. {
  4197. LoginCheck(playerid);
  4198. LevelCheck(playerid, 2);
  4199.  
  4200. new Player;
  4201. if(sscanf(params, "u", Player)) return SendUsage(playerid, "/bankrupt "GREY"<id>", "Will remove player's cash!");
  4202. else
  4203. {
  4204. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  4205. if(Player == playerid ) return SendError(playerid, "Player entered is you!");
  4206. CheckImune(playerid, Player);
  4207.  
  4208. ResetPlayerMoney(Player);
  4209.  
  4210. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" removed "ORAN"%s[%i]"GREY"'s cash!", Name(playerid), playerid, Name(Player), Player);
  4211. FormatMSG(playerid, Color:GREY, "You removed"ORAN"%s[%i]"GREY"'s cash!", Name(Player), Player);
  4212. }
  4213. return 1;
  4214. }
  4215.  
  4216. CMD:get(PARAMS)
  4217. {
  4218. LoginCheck(playerid);
  4219. LevelCheck(playerid, 3);
  4220.  
  4221. new Player;
  4222. if(sscanf(params, "u", Player)) return SendUsage(playerid, "/get "GREY"<id>", "Will teleport the specified player to your position");
  4223. else
  4224. {
  4225. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  4226. if(Player == playerid ) return SendError(playerid, "Player entered is you!");
  4227. CheckImune(playerid, Player);{}
  4228.  
  4229. new Float: Pos[4];
  4230.  
  4231. if(IsPlayerInAnyVehicle(Player))
  4232. {
  4233. LinkVehicleToInterior(GetPlayerVehicleID(Player), GetPlayerInterior(playerid));
  4234. SetVehicleVirtualWorld(GetPlayerVehicleID(Player), GetPlayerVirtualWorld(playerid));
  4235.  
  4236. SetVehiclePos(GetPlayerVehicleID(Player), Pos[0] + 2, Pos[1] + 2, Pos[2] + 1);
  4237. SetVehicleZAngle(GetPlayerVehicleID(Player), Pos[3]);
  4238. }
  4239. else
  4240. {
  4241. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  4242. GetPlayerFacingAngle(playerid, Pos[3]);
  4243.  
  4244. SetPlayerPos(Player, Pos[0], Pos[1] + 2, Pos[2] + 0.5);
  4245. SetPlayerFacingAngle(Player, Pos[3]);
  4246. }
  4247. SetPlayerVirtualWorld(Player, GetPlayerVirtualWorld(playerid));
  4248. SetPlayerInterior(Player, GetPlayerInterior(playerid));
  4249. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" teleported "ORAN"%s[%i]"GREY" to his location!", Name(playerid), playerid, Name(Player), Player);
  4250. FormatMSG(playerid, Color:GREY, "You teleported to "ORAN"%s[%i]"GREY" to your location!", Name(Player), Player);
  4251. }
  4252. return 1;
  4253. }
  4254.  
  4255. CMD:tplayer(PARAMS)
  4256. {
  4257. LoginCheck(playerid);
  4258. LevelCheck(playerid, 2);
  4259.  
  4260. new Player, Player2;
  4261. if(sscanf(params, "uu", Player)) return SendUsage(playerid, "/tplayer "GREY"<id1> <id2>", "Will teleport a player to another player");
  4262. else
  4263. {
  4264. if(Player == (0xFFFF)) return SendError(playerid, "Player1 not connected!");
  4265. if(Player2 == (0xFFFF)) return SendError(playerid, "Player2 not connected!");
  4266. if(Player == playerid ) return SendError(playerid, "Player1 entered is you!");
  4267. if(Player2 == playerid ) return SendError(playerid, "Player2 entered is you!");
  4268.  
  4269. if(P_DATA[playerid][Level] < P_DATA[Player][Level])
  4270. return SendError(playerid, "You are not allowed to use this command on this admin!");
  4271.  
  4272. if(P_DATA[playerid][Level] < P_DATA[Player2][Level])
  4273. return SendError(playerid, "You are not allowed to use this command on this admin!");
  4274.  
  4275. new Float: Pos[4];
  4276.  
  4277. GetPlayerPos(Player2, Pos[0], Pos[1], Pos[2]);
  4278. GetPlayerFacingAngle(Player2, Pos[3]);
  4279. if(IsPlayerInAnyVehicle(Player))
  4280. {
  4281. LinkVehicleToInterior(GetPlayerVehicleID(Player), GetPlayerInterior(Player2));
  4282. SetVehicleVirtualWorld(GetPlayerVehicleID(Player), GetPlayerVirtualWorld(Player2));
  4283.  
  4284. SetVehiclePos(GetPlayerVehicleID(Player), Pos[0] + 2, Pos[1] + 2, Pos[2] + 1);
  4285. SetVehicleZAngle(GetPlayerVehicleID(Player), Pos[3]);
  4286. }
  4287. else
  4288. {
  4289. SetPlayerPos(Player, Pos[0], Pos[1] + 2, Pos[2] + 0.5);
  4290. SetPlayerFacingAngle(Player, Pos[3]);
  4291. }
  4292.  
  4293. SetPlayerVirtualWorld(Player, GetPlayerVirtualWorld(Player2));
  4294. SetPlayerInterior(Player, GetPlayerInterior(Player2));
  4295.  
  4296. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" teleported to "ORAN"%s[%i]"GREY" to "ORAN"%s[%i]", Name(playerid), playerid, Name(Player), Player, Name(Player2), Player2);
  4297. FormatMSG(playerid, Color:GREY, "You teleported "ORAN"%s[%i]"GREY" to "ORAN"%s[%i]", Name(Player), Player ,Name(Player2), Player2);
  4298.  
  4299. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" teleported you to "ORAN"%s[%i]"GREY"", Name(playerid), playerid ,Name(Player2), Player2);
  4300. FormatMSG(Player2, Color:GREY, "Admin "ORAN"%s[%i]"GREY" teleported "ORAN"%s[%i]"GREY" to your position", Name(playerid), playerid ,Name(Player), Player);
  4301. }
  4302. return 1;
  4303. }
  4304.  
  4305. CMD:goto(PARAMS)
  4306. {
  4307. LoginCheck(playerid);
  4308. LevelCheck(playerid, 1);
  4309.  
  4310. new Player;
  4311. if(sscanf(params, "u", Player)) return SendUsage(playerid, "/goto "GREY"<id>", "Will teleport you to the specified player");
  4312. else
  4313. {
  4314. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  4315. if(Player == playerid ) return SendError(playerid, "Player entered is you!");
  4316. CheckImune(playerid, Player);
  4317.  
  4318. new Float: Pos[4];
  4319.  
  4320. GetPlayerPos(Player, Pos[0], Pos[1], Pos[2]);
  4321. GetPlayerFacingAngle(Player, Pos[3]);
  4322.  
  4323. if(IsPlayerInAnyVehicle(playerid))
  4324. {
  4325. LinkVehicleToInterior(GetPlayerVehicleID(playerid), GetPlayerInterior(Player));
  4326. SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), GetPlayerVirtualWorld(Player));
  4327.  
  4328. SetVehiclePos(GetPlayerVehicleID(playerid), Pos[0] + 2, Pos[1] + 2, Pos[2] + 1);
  4329. SetVehicleZAngle(GetPlayerVehicleID(playerid), Pos[3]);
  4330. }
  4331. else
  4332. {
  4333. SetPlayerPos(playerid, Pos[0], Pos[1] + 2, Pos[2] + 0.5);
  4334. SetPlayerFacingAngle(playerid, Pos[3]);
  4335. }
  4336. SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(Player));
  4337. SetPlayerInterior(playerid, GetPlayerInterior(Player));
  4338. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" teleported to "ORAN"%s[%i]", Name(playerid), playerid, Name(Player), Player);
  4339. FormatMSG(playerid, Color:GREY, "You teleported to "ORAN"%s[%i]", Name(Player), Player);
  4340. }
  4341. return 1;
  4342. }
  4343.  
  4344.  
  4345. CMD:write(PARAMS)
  4346. {
  4347. LoginCheck(playerid);
  4348. LevelCheck(playerid, 3);
  4349.  
  4350. new Message[129];
  4351. if(sscanf(params, "s[129]", Message)) return SendUsage(playerid, "/write "GREY"[message]", "Will send a message in the chat with grey color");
  4352. else
  4353. {
  4354. SendClientMessageToAll(Color:GREY, Message);
  4355. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" sent a message to the server.", Name(playerid), playerid);
  4356. GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~g~~h~Message sent!", 3000, 3);
  4357. }
  4358. return 1;
  4359. }
  4360. CMD:giveallcash(PARAMS)
  4361. {
  4362. LoginCheck(playerid);
  4363. LevelCheck(playerid, 4);
  4364.  
  4365. new Cash;
  4366. if(sscanf(params, "i", Cash)) return SendUsage(playerid, "/giveallcash "GREY"<cash>", "Will give everyone money("GREY"You can use negative numbers to take money! "W")");
  4367. else
  4368. {
  4369. foreach(Player, i)
  4370. {
  4371. if(P_DATA[i][Level] != 5)GivePlayerMoney(i, Cash);
  4372. if(Cash > 0)
  4373. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave everyone "ORAN"$%d"GREY" cash!", Name(playerid), playerid, Cash);
  4374. else FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" removed "ORAN"$%d"GREY" cash from everyone!", Name(playerid), playerid, Cash);
  4375. }
  4376. }
  4377. return 1;
  4378. }
  4379. CMD:setallcash(PARAMS)
  4380. {
  4381. LoginCheck(playerid);
  4382. LevelCheck(playerid, 4);
  4383.  
  4384. new Cash;
  4385. if(sscanf(params, "i", Cash)) return SendUsage(playerid, "/setallcash "GREY"<cash>", "Will set everyone's cash to the amount set");
  4386. else
  4387. {
  4388. foreach(Player, i)
  4389. {
  4390. if(P_DATA[i][Level] != 5)
  4391. {
  4392. ResetPlayerMoney(i);
  4393. GivePlayerMoney(i, Cash);
  4394. }
  4395. if(Cash > 0)
  4396. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's cash to "ORAN"%d", Name(playerid), playerid, Cash);
  4397. else FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" removed everyone's cash!", Name(playerid), playerid);
  4398. }
  4399. }
  4400. return 1;
  4401. }
  4402. CMD:giveallarmour(PARAMS)
  4403. {
  4404. LoginCheck(playerid);
  4405. LevelCheck(playerid, 4);
  4406.  
  4407. new Armour;
  4408. if(sscanf(params, "i", Armour)) return SendUsage(playerid, "/giveallarmour "GREY"<armour>", "Will give everyone armour("GREY"Negative numbers are not allowed! "W")");
  4409. else
  4410. {
  4411. if(Armour < 1) return SendUsage(playerid, "/giveallarmour "GREY"<armour>", "Will give everyone armour("GREY"Negative numbers are not allowed! "W")");
  4412. foreach(Player, i)
  4413. {
  4414. if(P_DATA[i][Level] != 5)
  4415. {
  4416. new Float:a;
  4417. GetPlayerArmour(i, a);
  4418. SetPlayerArmour(i, a + Armour);
  4419. }
  4420. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave everyone "ORAN"%d"GREY" armour!", Name(playerid), playerid, Armour);
  4421. }
  4422. }
  4423. return 1;
  4424. }
  4425. CMD:setallarmour(PARAMS)
  4426. {
  4427. LoginCheck(playerid);
  4428. LevelCheck(playerid, 4);
  4429.  
  4430. new Armour;
  4431. if(sscanf(params, "i", Armour)) return SendUsage(playerid, "/setallarmour "GREY"<armour>", "Will set everyone's armour");
  4432. else
  4433. {
  4434. foreach(Player, i)
  4435. {
  4436. if(P_DATA[i][Level] != 5)
  4437. {
  4438. SetPlayerArmour(i, Armour);
  4439. }
  4440. if(Armour > 0)
  4441. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's Armour to "ORAN"%d", Name(playerid), playerid, Armour);
  4442. else FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" removed everyone's armour!", Name(playerid), playerid);
  4443. }
  4444. }
  4445. return 1;
  4446. }
  4447. CMD:giveallh(PARAMS)
  4448. {
  4449. LoginCheck(playerid);
  4450. LevelCheck(playerid, 4);
  4451.  
  4452. new Health;
  4453. if(sscanf(params, "i", Health)) return SendUsage(playerid, "/giveallh "GREY"<health>", "Will give everyone health("GREY"Negative numbers are not allowed! "W")");
  4454. else
  4455. {
  4456. if(Health < 1) return SendUsage(playerid, "/ah "GREY"<health>", "Will give everyone health("GREY"Negative numbers are not allowed! "W")");
  4457. foreach(Player, i)
  4458. {
  4459. if(P_DATA[i][Level] != 5)
  4460. {
  4461. new Float:he;
  4462. GetPlayerHealth(i, he),
  4463. SetPlayerHealth(i, he + Health);
  4464. }
  4465. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave everyone "ORAN"%d"GREY" health!", Name(playerid), playerid, Health);
  4466. }
  4467. }
  4468. return 1;
  4469. }
  4470. CMD:setallhealth(PARAMS)
  4471. {
  4472. LoginCheck(playerid);
  4473. LevelCheck(playerid, 4);
  4474.  
  4475. new Health;
  4476. if(sscanf(params, "i", Health)) return SendUsage(playerid, "/setallhealth "GREY"<health>", "Will set everyone's health");
  4477. else
  4478. {
  4479. foreach(Player, i)
  4480. {
  4481. if(P_DATA[i][Level] != 5)
  4482. {
  4483. SetPlayerHealth(i, Health);
  4484. }
  4485. if(Health > 0)
  4486. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's health to "ORAN"%d", Name(playerid), playerid, Health);
  4487. else FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" killed everyone!", Name(playerid), playerid);
  4488. }
  4489. }
  4490. return 1;
  4491. }
  4492.  
  4493. CMD:setalldrunk(PARAMS)
  4494. {
  4495. LoginCheck(playerid);
  4496. LevelCheck(playerid, 4);
  4497.  
  4498. new Drunk;
  4499. if(sscanf(params, "i", Drunk)) return SendUsage(playerid, "/setalldrunk "GREY"<level>", "Will make players get drunk! Use "ORAN"0"W" to remove drunkenness");
  4500. else
  4501. {
  4502. foreach(Player, i)
  4503. {
  4504. if(P_DATA[i][Level] != 5)
  4505. {
  4506. if(Drunk != 0) SetPlayerDrunkLevel(i, 9999 + Drunk);
  4507. else SetPlayerDrunkLevel(i, 0);
  4508. }
  4509. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's drunk level to "ORAN"%d", Name(playerid), playerid, Drunk);
  4510. }
  4511. }
  4512. return 1;
  4513. }
  4514.  
  4515. CMD:setallint(PARAMS)
  4516. {
  4517. LoginCheck(playerid);
  4518. LevelCheck(playerid, 4);
  4519.  
  4520. new Interior;
  4521. if(sscanf(params, "i", Interior)) return SendUsage(playerid, "/setallint "GREY"<interior>", "Will set everyone's interior id to the sapecified interior");
  4522. else
  4523. {
  4524. foreach(Player, i)
  4525. {
  4526. if(P_DATA[i][Level] != 5)
  4527. {
  4528. SetPlayerInterior(i, Interior);
  4529. }
  4530. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's interior to "ORAN"%d", Name(playerid), playerid, Interior);
  4531. }
  4532. }
  4533. return 1;
  4534. }
  4535.  
  4536. CMD:setallworld(PARAMS)
  4537. {
  4538. LoginCheck(playerid);
  4539. LevelCheck(playerid, 4);
  4540.  
  4541. new World;
  4542. if(sscanf(params, "i", World)) return SendUsage(playerid, "/setallworld "GREY"<world>", "Will set everyone's Virtual World to the specified world");
  4543. else
  4544. {
  4545. foreach(Player, i)
  4546. {
  4547. if(P_DATA[i][Level] != 5)
  4548. {
  4549. SetPlayerVirtualWorld(i, World);
  4550. }
  4551. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's virtual world to "ORAN"%d", Name(playerid), playerid, World);
  4552. }
  4553. }
  4554. return 1;
  4555. }
  4556. CMD:giveallscore(PARAMS)
  4557. {
  4558. LoginCheck(playerid);
  4559. LevelCheck(playerid, 4);
  4560.  
  4561. new zScore;
  4562. if(sscanf(params, "i", zScore)) return SendUsage(playerid, "/giveallscore "GREY"<score>", "Will give everyone score("GREY"You can use negative numbers to take score! "W")");
  4563. else
  4564. {
  4565. foreach(Player, i)
  4566. {
  4567. if(P_DATA[i][Level] != 5)SetPlayerScore(i, (zScore) ? (GetPlayerScore(i) + zScore) : (GetPlayerScore(i) - zScore));
  4568. if(zScore > 0)
  4569. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave everyone "ORAN"%d"GREY" score!", Name(playerid), playerid, zScore);
  4570. else FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" removed "ORAN"%d"GREY" score from everyone!", Name(playerid), playerid, zScore);
  4571. }
  4572. }
  4573. return 1;
  4574. }
  4575. CMD:setallscore(PARAMS)
  4576. {
  4577. LoginCheck(playerid);
  4578. LevelCheck(playerid, 4);
  4579.  
  4580. new aScore;
  4581. if(sscanf(params, "i", aScore)) return SendUsage(playerid, "/setallscore "GREY"<score>", "Will set everyone's score to the specified score");
  4582. else
  4583. {
  4584. foreach(Player, i)
  4585. {
  4586. if(P_DATA[i][Level] != 5)
  4587. {
  4588. SetPlayerScore(i, aScore);
  4589. }
  4590. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's score to "ORAN"%d", Name(playerid), playerid, aScore);
  4591. }
  4592. }
  4593. return 1;
  4594. }
  4595. CMD:giveallwanted(PARAMS)
  4596. {
  4597. LoginCheck(playerid);
  4598. LevelCheck(playerid, 4);
  4599.  
  4600. new Wanted;
  4601. if(sscanf(params, "i", Wanted)) return SendUsage(playerid, "/giveallwanted "GREY"<stars>", "Will give everyone wanted stars("GREY"You can use negative numbers to take wanted stars! "W")");
  4602. else
  4603. {
  4604. foreach(Player, i)
  4605. {
  4606. if(P_DATA[i][Level] != 5)
  4607. {
  4608. if(GetPlayerWantedLevel(i) >= 0)
  4609. {
  4610. SetPlayerWantedLevel(i, (Wanted) ? (GetPlayerWantedLevel(i) + Wanted) : (GetPlayerWantedLevel(i) - Wanted));
  4611. if(GetPlayerWantedLevel(i) < 0) SetPlayerWantedLevel(i, 0);
  4612. }
  4613. }
  4614. if(Wanted > 0) FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave everyone "ORAN"%d"GREY" wanted stars!", Name(playerid), playerid, Wanted);
  4615. else FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" removed "ORAN"%d"GREY" wanted stars from everyone!", Name(playerid), playerid, Wanted);
  4616. }
  4617. }
  4618. return 1;
  4619. }
  4620. CMD:giveallcookies(PARAMS)
  4621. {
  4622. LoginCheck(playerid);
  4623. LevelCheck(playerid, 4);
  4624.  
  4625. new Cookiz;
  4626. if(sscanf(params, "i", Cookiz)) return SendUsage(playerid, "/giveallcookies "GREY"<cookies>", "Will give everyone cookies("GREY"You can use negative numbers to take cookies! "W")");
  4627. else
  4628. {
  4629. new String[10];
  4630. if(Cookiz < 0)
  4631. {
  4632. format(String, sizeof String, "%d", Cookiz);
  4633. strdel(String, 0, 1);
  4634. }
  4635. foreach(Player, i)
  4636. {
  4637. if(P_DATA[i][Level] != 5)
  4638. {
  4639. if(Cookiz < 0)P_DATA[i][Cookies] -= strval(String);
  4640. else P_DATA[i][Cookies] += Cookiz;
  4641.  
  4642.  
  4643. if(P_DATA[i][Cookies] < 0) P_DATA[i][Cookies] = 0;
  4644. }
  4645. if(Cookiz > 0) FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave everyone "ORAN"%d"GREY" cookies!", Name(playerid), playerid, Cookiz);
  4646. else FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" removed "ORAN"%d"GREY" cookies from everyone!", Name(playerid), playerid, Cookiz);
  4647. }
  4648. }
  4649. return 1;
  4650. }
  4651.  
  4652. CMD:setrespect(PARAMS)
  4653. {
  4654. LoginCheck(playerid);
  4655. LevelCheck(playerid, 3);
  4656.  
  4657. new Player, rType[2],Respect;
  4658. if(sscanf(params, "us[2]i", Player, rType, Respect)) return SendUsage(playerid, "/setrespect "GREY"<id> <-/+> <respect>", "Will change player's negative/positive respect!");
  4659. else
  4660. {
  4661. if(Respect < 0) return SendUsage(playerid, "/setrespect "GREY"<id> <-/+> <respect>", "Will change player's negative/positive respect!");
  4662. if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
  4663. CheckImune(playerid, Player);
  4664.  
  4665. if(!strcmp(rType, "+", false)) SetPVarInt(Player, "0_Positive", Respect);
  4666. else if(!strcmp(rType, "-", false))SetPVarInt(Player, "0_Negative", Respect);
  4667. else return SendError(playerid, "The first parameter must contain either '+' or '-' without '. (+ Positive respect | - Negative respect)");
  4668.  
  4669. if(playerid != Player)
  4670. {
  4671. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed "ORAN"%s[%i]"GREY"'s %s respect to %d!", Name(playerid), playerid ,Name(Player), Player, (strcmp(rType, "+", false)) ? ("Positive") : ("Negative"), Respect);
  4672. FormatMSG(playerid, Color:GREY,"You set "ORAN"%s[%i]"GREY"'s %s respect to "ORAN"%d", Name(Player), Player, (strcmp(rType, "+", false)) ? ("Positive") : ("Negative"), Respect);
  4673. FormatMSG(Player, Color:GREY,"Admin "ORAN"%s[%i]"GREY" set your %s respect to "ORAN"%d", Name(playerid), Player, (strcmp(rType, "+", false)) ? ("Positive") : ("Negative"), Respect);
  4674. }
  4675. else
  4676. {
  4677. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed his %s respect to "ORAN"%d!", Name(playerid), playerid, (strcmp(rType, "+", false)) ? ("Positive") : ("Negative"), Respect);
  4678. FormatMSG(playerid, Color:GREY,"You set your %s respect to "ORAN"%d", (strcmp(rType, "+", false)) ? ("Positive") : ("Negative"), Respect);
  4679. }
  4680. #if UPDATE_TOP_ALWAYS == true
  4681. new
  4682. Query[256],
  4683. DBResult: R1;
  4684.  
  4685. format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(Player));
  4686. R1 = DB::Query(_DB, Query);
  4687.  
  4688. if(R1)
  4689. {
  4690. if(DB::Valid(R1))
  4691. {
  4692. DB::Free(R1);
  4693. format(Query, sizeof(Query), "UPDATE `Top` SET `%s` = '%d' WHERE `Name` = '%s'", (!strcmp(rType, "+", false)) ? ("Positive") : ("Negative"), Respect, Name(Player));
  4694. DB::Query(_DB, Query);
  4695. }
  4696. else
  4697. {
  4698. DB::Free(R1);
  4699. format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`, `%s`) VALUES('%s','%d')", (!strcmp(rType, "+", false)) ? ("Positive") : ("Negative"), Name(Player), Respect);
  4700. DB::Query(_DB, Query);
  4701. }
  4702. }
  4703. #endif
  4704. }
  4705. return 1;
  4706. }
  4707. CMD:giveallrespect(PARAMS)
  4708. {
  4709. LoginCheck(playerid);
  4710. LevelCheck(playerid, 4);
  4711.  
  4712. new rType[2],Respect;
  4713. if(sscanf(params, "s[2]i", rType, Respect)) return SendUsage(playerid, "/giveallrespect "GREY"<-/+> <respect>", "Will give everyone respect(Either negative respect that even positive respect)");
  4714. else
  4715. {
  4716. if(Respect < 0) return SendUsage(playerid, "/giveallrespect "GREY"<-/+> <respect>", "Will give everyone respect(Either negative respect that even positive respect)");
  4717. if(!strcmp(rType, "+", false))
  4718. {
  4719. foreach(Player, i)
  4720. {
  4721. if(P_DATA[i][Level] != 5)
  4722. {
  4723. SetPVarInt(i, "0_Positive", GetPVarInt(i, "0_Positive") + Respect);
  4724. #if UPDATE_TOP_ALWAYS == true
  4725. new
  4726. Query[256],
  4727. DBResult: R1;
  4728.  
  4729. format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(i));
  4730. R1 = DB::Query(_DB, Query);
  4731.  
  4732. if(R1)
  4733. {
  4734. if(DB::Valid(R1))
  4735. {
  4736. DB::Free(R1);
  4737. format(Query, sizeof(Query), "UPDATE `Top` SET `Positive` = '%d' WHERE `Name` = '%s'", GetPVarInt(i, "0_Positive"), Name(i));
  4738. DB::Query(_DB, Query);
  4739. }
  4740. }
  4741. #endif
  4742. }
  4743. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave everyone "ORAN"%d"GREY" positive respect!", Name(playerid), playerid, Respect);
  4744. }
  4745. }
  4746. else if(!strcmp(rType, "-", false))
  4747. {
  4748. foreach(Player, i)
  4749. {
  4750. if(P_DATA[i][Level] != 5)
  4751. {
  4752. SetPVarInt(i, "0_Negative", GetPVarInt(i, "0_Negative") + Respect);
  4753. #if UPDATE_TOP_ALWAYS == true
  4754. new
  4755. Query[256],
  4756. DBResult: R1;
  4757.  
  4758. format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(i));
  4759. R1 = DB::Query(_DB, Query);
  4760.  
  4761. if(R1)
  4762. {
  4763. if(DB::Valid(R1))
  4764. {
  4765. DB::Free(R1);
  4766. format(Query, sizeof(Query), "UPDATE `Top` SET `Negative` = '%d' WHERE `Name` = '%s'", GetPVarInt(i, "0_Negative"), Name(i));
  4767. DB::Query(_DB, Query);
  4768. }else DB::Free(R1);
  4769. }
  4770. #endif
  4771. }
  4772. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave everyone "ORAN"%d"GREY" negative respect!", Name(playerid), playerid, Respect);
  4773. }
  4774. }
  4775. else return SendError(playerid, "The first parameter must contain either '+' or '-' without '. (+ Positive respect | - Negative respect)");
  4776. }
  4777. return 1;
  4778. }
  4779. CMD:resetallrespect(PARAMS)
  4780. {
  4781. LoginCheck(playerid);
  4782. LevelCheck(playerid, 4);
  4783.  
  4784. new rType[2];
  4785. if(sscanf(params, "s[2]", rType)) return SendUsage(playerid, "/resetallrespect "GREY" <-/+>", "Will reset everyone's positive/negative respect!");
  4786. else
  4787. {
  4788. if(!strcmp(rType, "+", false))
  4789. {
  4790. foreach(Player, i)
  4791. {
  4792. if(P_DATA[i][Level] != 5)
  4793. {
  4794. #if UPDATE_TOP_ALWAYS == true
  4795. new
  4796. Query[256],
  4797. DBResult: R1;
  4798.  
  4799. format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(i));
  4800. R1 = DB::Query(_DB, Query);
  4801.  
  4802. if(R1)
  4803. {
  4804. if(DB::Valid(R1))
  4805. {
  4806. DB::Free(R1);
  4807. format(Query, sizeof(Query), "UPDATE `Top` SET `Positive` = '0' WHERE `Name` = '%s'", Name(i));
  4808. DB::Query(_DB, Query);
  4809. }
  4810. }
  4811. #endif
  4812. SetPVarInt(i, "0_Positive", 0);
  4813. }
  4814. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" reseted everyone's positive respect!", Name(playerid), playerid);
  4815. }
  4816. }
  4817. else if(!strcmp(rType, "-", false))
  4818. {
  4819. foreach(Player, i)
  4820. {
  4821. if(P_DATA[i][Level] != 5)
  4822. {
  4823. #if UPDATE_TOP_ALWAYS == true
  4824. new
  4825. Query[256],
  4826. DBResult: R1;
  4827.  
  4828. format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(i));
  4829. R1 = DB::Query(_DB, Query);
  4830.  
  4831. if(R1)
  4832. {
  4833. if(DB::Valid(R1))
  4834. {
  4835. DB::Free(R1);
  4836. format(Query, sizeof(Query), "UPDATE `Top` SET `Negative` = '0' WHERE `Name` = '%s'", Name(i));
  4837. DB::Query(_DB, Query);
  4838. }
  4839. }
  4840. #endif
  4841. SetPVarInt(i, "0_Negative", 0);
  4842. }
  4843. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" reseted everyone's negative respect!", Name(playerid), playerid);
  4844. }
  4845. }
  4846. }
  4847. return 1;
  4848. }
  4849. CMD:setallrespect(PARAMS)
  4850. {
  4851. LoginCheck(playerid);
  4852. LevelCheck(playerid, 4);
  4853.  
  4854. new rType[2],Respect;
  4855. if(sscanf(params, "s[2]i", rType, Respect)) return SendUsage(playerid, "/setallrespect "GREY"<-/+> <respect>", "Will set everyone's respect(Either negative respect that even positive respect)");
  4856. else
  4857. {
  4858. if(Respect < 0) return SendUsage(playerid, "/setallrespect "GREY"<-/+> <respect>", "Will set everyone's respect(Either negative respect that even positive respect)");
  4859. if(!strcmp(rType, "+", false))
  4860. {
  4861. foreach(Player, i)
  4862. {
  4863. if(P_DATA[i][Level] != 5)
  4864. {
  4865. #if UPDATE_TOP_ALWAYS == true
  4866. new
  4867. Query[256],
  4868. DBResult: R1;
  4869.  
  4870. format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(i));
  4871. R1 = DB::Query(_DB, Query);
  4872.  
  4873. if(R1)
  4874. {
  4875. if(DB::Valid(R1))
  4876. {
  4877. DB::Free(R1);
  4878. format(Query, sizeof(Query), "UPDATE `Top` SET `Positive` = '%d' WHERE `Name` = '%s'", Respect, Name(i));
  4879. DB::Query(_DB, Query);
  4880. }else DB::Free(R1);
  4881. }
  4882. #endif
  4883. SetPVarInt(i, "0_Positive", Respect);
  4884. }
  4885. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's positive respect to "ORAN"%d", Name(playerid), playerid, Respect);
  4886. }
  4887. }
  4888. else if(!strcmp(rType, "-", false))
  4889. {
  4890. foreach(Player, i)
  4891. {
  4892. if(P_DATA[i][Level] != 5)
  4893. {
  4894. #if UPDATE_TOP_ALWAYS == true
  4895. new
  4896. Query[256],
  4897. DBResult: R1;
  4898.  
  4899. format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(i));
  4900. R1 = DB::Query(_DB, Query);
  4901.  
  4902. if(R1)
  4903. {
  4904. if(DB::Valid(R1))
  4905. {
  4906. DB::Free(R1);
  4907. format(Query, sizeof(Query), "UPDATE `Top` SET `Negative` = '%d' WHERE `Name` = '%s'", Respect, Name(i));
  4908. DB::Query(_DB, Query);
  4909. }else DB::Free(R1);
  4910. }
  4911.  
  4912. #endif
  4913. SetPVarInt(i, "0_Negative", Respect);
  4914. }
  4915. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's negative respect to "ORAN"%d", Name(playerid), playerid, Respect);
  4916. }
  4917. }
  4918. else return SendError(playerid, "The first parameter must contain either '+' or '-' without '. (+ Positive respect | - Negative respect)");
  4919. }
  4920. return 1;
  4921. }
  4922. CMD:setallwanted(PARAMS)
  4923. {
  4924. LoginCheck(playerid);
  4925. LevelCheck(playerid, 4);
  4926.  
  4927. new Wanted;
  4928. if(sscanf(params, "i", Wanted)) return SendUsage(playerid, "/setallwanted "GREY"<level>", "Will make a player wanted of the specified level");
  4929. else
  4930. {
  4931. foreach(Player, i)
  4932. {
  4933. if(P_DATA[i][Level] != 5)
  4934. {
  4935. SetPlayerWantedLevel(i, Wanted);
  4936. }
  4937. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's wanted level to "ORAN"%d", Name(playerid), playerid, Wanted);
  4938. }
  4939. }
  4940. return 1;
  4941. }
  4942. CMD:healcar(PARAMS)
  4943. {
  4944. LoginCheck(playerid);
  4945. LevelCheck(playerid, 2);
  4946.  
  4947. new Player;
  4948. if(sscanf(params, "u", Player)) return SendUsage(playerid, "/healcar "GREY"<id>", "Will heal a player's car!");
  4949. else
  4950. {
  4951. if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
  4952. if(Player == playerid) return SendError(playerid, "You can use "ORAN"/cargod"W" if you want!");
  4953. if(!IsPlayerInAnyVehicle(Player)) return SendError(playerid, "Player is not in a vehicle!");
  4954.  
  4955. SetVehicleHealth(GetPlayerVehicleID(Player), 1200);
  4956.  
  4957. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" healed "ORAN"%s[%i]'s"GREY" vehicle!", Name(playerid), playerid, Name(Player), Player);
  4958. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" healed your vehicle!", Name(playerid), playerid);
  4959. FormatMSG(Player, Color:GREY, "You healed "ORAN"%s[%i]"GREY"'s vehicle!", Name(Player), Player);
  4960. }
  4961. return 1;
  4962. }
  4963. CMD:destroyv(PARAMS)
  4964. {
  4965. LevelCheck(playerid, 3);
  4966.  
  4967. new Player;
  4968.  
  4969. if(sscanf(params, "u", Player)) return SendUsage(playerid, "/destroyv "GREY"<id>", "Will destroy player's vehicle!");
  4970. else
  4971. {
  4972. if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
  4973. if(Player == playerid) return SendError(playerid, "Player entered is you!");
  4974. if(!IsPlayerInAnyVehicle(Player)) return SendError(playerid, "Player is not in a vehicle!");
  4975.  
  4976. P_DATA[Player][CarGod] = 0;
  4977. SetVehicleHealth(GetPlayerVehicleID(Player), 0);
  4978.  
  4979. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" destroyed "ORAN"%s[%i]'s"GREY" vehicle!", Name(playerid), playerid, Name(Player), Player);
  4980. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" destroyed your vehicle!", Name(playerid), playerid);
  4981. FormatMSG(Player, Color:GREY, "You destroyed "ORAN"%s[%i]"GREY"'s vehicle!", Name(Player), Player);
  4982. }
  4983. return 1;
  4984. }
  4985.  
  4986. CMD:setvhealth(PARAMS)
  4987. {
  4988. LoginCheck(playerid);
  4989. LevelCheck(playerid, 2);
  4990.  
  4991. new Player, vHealth;
  4992. if(sscanf(params, "ui", Player, vHealth)) return SendUsage(playerid, "/setvh "GREY"<id> <health>", "Will set player's vehicle health!");
  4993. else
  4994. {
  4995. if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
  4996. if(Player == playerid) return SendError(playerid, "Player entered is you!");
  4997. if(!IsPlayerInAnyVehicle(Player)) return SendError(playerid, "Player is not in a vehicle!");
  4998.  
  4999. SetVehicleHealth(GetPlayerVehicleID(Player), vHealth);
  5000.  
  5001. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"%s[%i]'s"GREY" vehicle health to"ORAN"%d!", Name(playerid), playerid, Name(Player), Player, vHealth);
  5002. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your vehicle's health to"ORAN"%d!", Name(playerid), playerid, vHealth);
  5003. FormatMSG(Player, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s vehicle health to"ORAN"%d!", Name(Player), Player, vHealth);
  5004. }
  5005. return 1;
  5006. }
  5007. CMD:carcolor(PARAMS)
  5008. {
  5009. LoginCheck(playerid);
  5010. LevelCheck(playerid, 2);
  5011.  
  5012. new Player, vColor[2];
  5013. if(sscanf(params, "uD(0)D(0)", Player, vColor[0], vColor[1])) return SendUsage(playerid, "/carcolor <id> <!color1> <!color2>", "Will change player's vehicle colors! (! means it's optional, if not set, returns random)");
  5014. {
  5015. if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
  5016. if(Player == playerid) return SendError(playerid, "Player entered is you!");
  5017. if(!IsPlayerInAnyVehicle(Player)) return SendError(playerid, "Player is not in a vehicle!");
  5018.  
  5019. if(!vColor[0]) vColor[0] = random(255);
  5020. if(!vColor[1]) vColor[1] = random(255);
  5021.  
  5022. ChangeVehicleColor(GetPlayerVehicleID(Player), vColor[0], vColor[1]);
  5023.  
  5024. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed "ORAN"%s[%i]'s"GREY" vehicle colors", Name(playerid), playerid, Name(Player), Player);
  5025. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" changed your vehicle's colors", Name(playerid), playerid);
  5026. FormatMSG(Player, Color:GREY, "You changed "ORAN"%s[%i]"GREY"'s vehicle colors", Name(Player), Player);
  5027. }
  5028. return 1;
  5029. }
  5030.  
  5031. CMD:heal(PARAMS)
  5032. {
  5033. LoginCheck(playerid);
  5034.  
  5035. new Player;
  5036. if(sscanf(params, "u", Player))
  5037. {
  5038. if(P_DATA[playerid][Level] == 2)
  5039. {
  5040. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" healed himself!", Name(playerid), playerid);
  5041. SendClientMessage(playerid, Color:GREY, "You healed yourself!");
  5042. }
  5043. else if(P_DATA[playerid][Level] > 2)
  5044. {
  5045. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" healed himself!", Name(playerid), playerid);
  5046. SendClientMessage(playerid, Color:GREY, "You healed yourself!");
  5047. return SendUsage(playerid, "/heal"GREY" <id>", "Will heal a specified player!");
  5048. }
  5049. }
  5050. else
  5051. {
  5052. if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
  5053. SetPlayerHealth(Player, 100.0);
  5054.  
  5055. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" healed "ORAN"%s[%i]", Name(playerid), playerid, Name(Player), Player);
  5056. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" healed you!", Name(playerid), playerid);
  5057. FormatMSG(playerid, Color:GREY, "You healed player "ORAN"%s[%i]", Name(Player), Player);
  5058. }
  5059. return 1;
  5060. }
  5061.  
  5062. CMD:healall(PARAMS)
  5063. {
  5064. LoginCheck(playerid);
  5065. LevelCheck(playerid, 3);
  5066.  
  5067. foreach(Player, i)
  5068. {
  5069. if(P_DATA[i][Level] != 5)
  5070. {
  5071. SetPlayerHealth(i, 100.0);
  5072. }
  5073. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" healed everyone", Name(playerid), playerid);
  5074. }
  5075. return 1;
  5076. }
  5077. CMD:setallskin(PARAMS)
  5078. {
  5079. LoginCheck(playerid);
  5080. LevelCheck(playerid, 4);
  5081.  
  5082. new Skin;
  5083. if(sscanf(params, "i", Skin)) return SendUsage(playerid, "/setallskin "GREY"<skin>", "Will set everyone's skin to the specified ID");
  5084. else
  5085. {
  5086. if(!IsValidSkin(Skin)) return SendError(playerid, "Invalid skin ID!");
  5087.  
  5088. foreach(Player, i)
  5089. {
  5090. if(P_DATA[i][Level] != 5)
  5091. {
  5092. SetPlayerSkin(i, Skin);
  5093. }
  5094. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's skin to "ORAN"%d", Name(playerid), playerid, Skin);
  5095. }
  5096. }
  5097. return 1;
  5098. }
  5099.  
  5100. CMD:setalltime(PARAMS)
  5101. {
  5102. LoginCheck(playerid);
  5103. LevelCheck(playerid, 3);
  5104.  
  5105. new Time;
  5106. if(sscanf(params, "i", Time)) return SendUsage(playerid, "/setalltime "GREY"<hour>", "Will change everyone's in-game time");
  5107. else
  5108. {
  5109. foreach(Player, i)
  5110. {
  5111. if(P_DATA[i][Level] != 5)
  5112. {
  5113. SetPlayerTime(i, Time, 0);
  5114. }
  5115. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's time to "ORAN"%d:00", Name(playerid), playerid, Time);
  5116. }
  5117. }
  5118. return 1;
  5119. }
  5120. CMD:setallweather(PARAMS)
  5121. {
  5122. LoginCheck(playerid);
  5123. LevelCheck(playerid, 3);
  5124.  
  5125. new Weather;
  5126. if(sscanf(params, "i", Weather)) return SendUsage(playerid, "/setallweather "GREY"<weather id>", "Will change everyone's weather");
  5127. else
  5128. {
  5129. foreach(Player, i)
  5130. {
  5131. if(P_DATA[i][Level] != 5)
  5132. {
  5133. SetPlayerWeather(i, Weather);
  5134. }
  5135. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's weather to "ORAN"%d", Name(playerid), playerid, Weather);
  5136. }
  5137. }
  5138. return 1;
  5139. }
  5140.  
  5141. CMD:setdrunk(PARAMS)
  5142. {
  5143. LoginCheck(playerid);
  5144. LevelCheck(playerid, 3);
  5145.  
  5146. new Player, Drunk;
  5147. if(sscanf(params, "ui", Player, Drunk)) return SendUsage(playerid, "/setdrunk "GREY"<id> <level>", "Will set a player drunk of the specified level");
  5148. else
  5149. {
  5150. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  5151. CheckImune(playerid, Player);
  5152.  
  5153. SetPlayerDrunkLevel(Player, Drunk);
  5154.  
  5155. if(Player != playerid)
  5156. {
  5157. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"\"%s[%i]"GREY"'s drunk level to "ORAN"%d", Name(playerid), playerid, Name(Player), Player, Drunk);
  5158. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s drunk level to "ORAN"%d", Name(Player), Player, Drunk);
  5159. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your drunk level to "ORAN"%d", Name(playerid), playerid, Drunk);
  5160. }
  5161. else
  5162. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set drunk level to "ORAN"%d", Name(playerid), playerid, Drunk);
  5163. }
  5164. return 1;
  5165. }
  5166. CMD:setwanted(PARAMS)
  5167. {
  5168. LoginCheck(playerid);
  5169. LevelCheck(playerid, 3);
  5170.  
  5171. new Player, Wanted;
  5172. if(sscanf(params, "ui", Player, Wanted)) return SendUsage(playerid, "/setwanted "GREY"<id> <level>", "Will set the specified player wanted of the specified level");
  5173. else
  5174. {
  5175. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  5176. CheckImune(playerid, Player);
  5177.  
  5178. SetPlayerWantedLevel(Player, Wanted);
  5179.  
  5180. if(Player != playerid)
  5181. {
  5182. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"\"%s[%i]"GREY"'s wanted level to "ORAN"%d", Name(playerid), playerid, Name(Player), Player, Wanted);
  5183. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s wanted level to "ORAN"%d", Name(Player), Player, Wanted);
  5184. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your wanted level to "ORAN"%d", Name(playerid), playerid, Wanted);
  5185. }
  5186. else
  5187. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his wanted level to "ORAN"%d", Name(playerid), playerid, Wanted);
  5188. }
  5189. return 1;
  5190. }
  5191. CMD:setinterior(PARAMS)
  5192. {
  5193. LoginCheck(playerid);
  5194. LevelCheck(playerid, 3);
  5195.  
  5196. new Player, Interior;
  5197. if(sscanf(params, "ui", Player, Interior)) return SendUsage(playerid, "/setinterior "GREY"<id> <interior>", "Will set player's interior");
  5198. else
  5199. {
  5200. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  5201. CheckImune(playerid, Player);
  5202.  
  5203. SetPlayerInterior(Player, Interior);
  5204.  
  5205. if(Player != playerid)
  5206. {
  5207. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"\"%s[%i]"GREY"'s virtual world to "ORAN"%d", Name(playerid), playerid, Name(Player), Player, Interior);
  5208. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s interior to "ORAN"%d", Name(Player), Player, Interior);
  5209. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your interior to "ORAN"%d", Name(playerid), playerid, Interior);
  5210. }
  5211. else
  5212. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his interior to "ORAN"%d", Name(playerid), playerid, Interior);
  5213. }
  5214. return 1;
  5215. }
  5216. CMD:setworld(PARAMS)
  5217. {
  5218. LoginCheck(playerid);
  5219. LevelCheck(playerid, 3);
  5220.  
  5221. new Player, World;
  5222. if(sscanf(params, "ui", Player, World)) return SendUsage(playerid, "/setworld "GREY"<id> <world>", "Will change player's virtual world");
  5223. else
  5224. {
  5225. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  5226. CheckImune(playerid, Player);
  5227.  
  5228. SetPlayerVirtualWorld(Player, World);
  5229.  
  5230. if(Player != playerid)
  5231. {
  5232. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"\"%s[%i]"GREY"'s virtual world to "ORAN"%d", Name(playerid), playerid, Name(Player), Player, World);
  5233. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s virtual world to "ORAN"%d", Name(Player), Player, World);
  5234. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your virtual world to "ORAN"%d", Name(playerid), playerid, World);
  5235. }
  5236. else
  5237. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his virtual world to "ORAN"%d", Name(playerid), playerid, World);
  5238. }
  5239. return 1;
  5240. }
  5241. CMD:setcash(PARAMS)
  5242. {
  5243. LoginCheck(playerid);
  5244. LevelCheck(playerid, 3);
  5245.  
  5246. new Player, Cash;
  5247. if(sscanf(params, "ui", Player, Cash)) return SendUsage(playerid, "/setcash "GREY"<id> <cash>", "Will set player's cash to the amount inserted");
  5248. else
  5249. {
  5250. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  5251. CheckImune(playerid, Player);
  5252.  
  5253. ResetPlayerMoney(Player);
  5254. GivePlayerMoney(Player, Cash);
  5255.  
  5256. if(Player != playerid)
  5257. {
  5258. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"\"%s[%i]"GREY"'s cash to "GREE"$%d", Name(playerid), playerid, Name(Player), Player, Cash);
  5259. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s cash to "GREE"$%d", Name(Player), Player, Cash);
  5260. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your cash to "GREE"$%d", Name(playerid), playerid, Cash);
  5261. }
  5262. else
  5263. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his cash to "GREE"$%d", Name(playerid), playerid, Cash);
  5264. }
  5265. return 1;
  5266. }
  5267. CMD:setscore(PARAMS)
  5268. {
  5269. LoginCheck(playerid);
  5270. LevelCheck(playerid, 3);
  5271.  
  5272. new Player, aScore;
  5273. if(sscanf(params, "ui", Player, aScore)) return SendUsage(playerid, "/setscore "GREY"<id> <score>", "Will set player's score to the specified score");
  5274. else
  5275. {
  5276. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  5277. CheckImune(playerid, Player);
  5278.  
  5279. SetPlayerScore(Player, aScore);
  5280.  
  5281. if(Player != playerid)
  5282. {
  5283. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"\"%s[%i]"GREY"'s score to "ORAN"%d", Name(playerid), playerid, Name(Player), Player, aScore);
  5284. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s score to "ORAN"%d", Name(Player), Player, aScore);
  5285. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your score to "ORAN"%d", Name(playerid), playerid, aScore);
  5286. }
  5287. else
  5288. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his score to "ORAN"%d", Name(playerid), playerid, aScore);
  5289. }
  5290. return 1;
  5291. }
  5292. CMD:setdeaths(PARAMS)
  5293. {
  5294. LoginCheck(playerid);
  5295. LevelCheck(playerid, 4);
  5296.  
  5297. new Player, zDeaths;
  5298. if(sscanf(params, "ui", Player, zDeaths) || zDeaths < 0) return SendUsage(playerid, "/setdeaths "GREY"<id> <deaths>", "Will change player's deaths");
  5299. else
  5300. {
  5301. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  5302. CheckImune(playerid, Player);
  5303.  
  5304. SetPVarInt(Player, "0_Deaths", zDeaths);
  5305. P_DATA[Player][Deaths] = zDeaths;
  5306. if(Player != playerid)
  5307. {
  5308. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"\"%s[%i]"GREY"'s deaths to "ORAN"%d", Name(playerid), playerid, Name(Player), Player, zDeaths);
  5309. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s deaths to "ORAN"%d", Name(Player), Player, zDeaths);
  5310. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your deaths to "ORAN"%d", Name(playerid), playerid, zDeaths);
  5311. }
  5312. else
  5313. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed his deaths to "ORAN"%d", Name(playerid), playerid, zDeaths);
  5314.  
  5315. #if UPDATE_TOP_ALWAYS
  5316.  
  5317. new
  5318. Query[256],
  5319. DBResult: R1;
  5320.  
  5321. format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(Player));
  5322. R1 = DB::Query(_DB, Query);
  5323.  
  5324. if(R1)
  5325. {
  5326. if(DB::Valid(R1))
  5327. {
  5328. DB::Free(R1);
  5329. format(Query, sizeof(Query), "UPDATE `Top` SET `Deaths` = '%d' WHERE `Name` = '%s'", zDeaths, Name(Player));
  5330. DB::Query(_DB, Query);
  5331. }
  5332. else
  5333. {
  5334. DB::Free(R1);
  5335. format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`,`Deaths`) VALUES('%s','%d')", Name(Player), zDeaths);
  5336. DB::Query(_DB, Query);
  5337. }
  5338. }
  5339. #endif
  5340. }
  5341. return 1;
  5342. }
  5343. CMD:setkills(PARAMS)
  5344. {
  5345. LoginCheck(playerid);
  5346. LevelCheck(playerid, 4);
  5347.  
  5348. new Player, zKills;
  5349. if(sscanf(params, "ui", Player, zKills) || zKills < 0) return SendUsage(playerid, "/setkills "GREY"<id> <kills>", "Will change player's kills");
  5350. else
  5351. {
  5352. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  5353. CheckImune(playerid, Player);
  5354.  
  5355. SetPVarInt(Player, "0_Kills", zKills);
  5356. P_DATA[Player][Kills] = zKills;
  5357.  
  5358. if(Player != playerid)
  5359. {
  5360. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"\"%s[%i]"GREY"'s kills to "ORAN"%d", Name(playerid), playerid, Name(Player), Player, zKills);
  5361. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s kills to "ORAN"%d", Name(Player), Player, zKills);
  5362. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your kills to "ORAN"%d", Name(playerid), playerid, zKills);
  5363. }
  5364. else
  5365. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed his kills to "ORAN"%d", Name(playerid), playerid, zKills);
  5366.  
  5367. #if UPDATE_TOP_ALWAYS == true
  5368.  
  5369. new
  5370. Query[256],
  5371. DBResult: R1;
  5372.  
  5373. format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(Player));
  5374. R1 = DB::Query(_DB, Query);
  5375.  
  5376. if(R1)
  5377. {
  5378. if(DB::Valid(R1))
  5379. {
  5380. DB::Free(R1);
  5381. format(Query, sizeof(Query), "UPDATE `Top` SET `Kills` = '%d' WHERE `Name` = '%s'", zKills, Name(Player));
  5382. DB::Query(_DB, Query);
  5383. }
  5384. else
  5385. {
  5386. DB::Free(R1);
  5387. format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`,`Kills`) VALUES('%s','%d')", Name(Player), zKills);
  5388. DB::Query(_DB, Query);
  5389. }
  5390. }
  5391.  
  5392. #endif
  5393. }
  5394. return 1;
  5395. }
  5396. CMD:setweather(PARAMS)
  5397. {
  5398. LoginCheck(playerid);
  5399. LevelCheck(playerid, 3);
  5400.  
  5401. new Player, Weather;
  5402. if(sscanf(params, "ui", Player, Weather)) return SendUsage(playerid, "/setweather "GREY"<id> <weather id>", "Will change player's weather to the specified weather ID");
  5403. else
  5404. {
  5405. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  5406. CheckImune(playerid, Player);
  5407.  
  5408. SetPlayerWeather(Player, Weather);
  5409.  
  5410. if(Player != playerid)
  5411. {
  5412. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed "ORAN"\"%s[%i]"GREY"'s weather to "ORAN"%d", Name(playerid), playerid, Name(Player), Player, Weather);
  5413. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s weather to "ORAN"%d", Name(Player), Player, Weather);
  5414. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your weather to "ORAN"%d", Name(playerid), playerid, Weather);
  5415. }
  5416. else
  5417. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed his weather to "ORAN"%d", Name(playerid), playerid, Weather);
  5418. }
  5419. return 1;
  5420. }
  5421. CMD:settime(PARAMS)
  5422. {
  5423. LoginCheck(playerid);
  5424. LevelCheck(playerid, 1);
  5425.  
  5426. new Player, Time;
  5427. if(sscanf(params, "ui", Player, Time)) return SendUsage(playerid, "/settime "GREY"<id> <hour>", "Will change player's time");
  5428. else
  5429. {
  5430. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  5431. CheckImune(playerid, Player);
  5432. if(Time < 0 || Time > 24) return SendError(playerid, "Invalid hour! (0 - 24)");
  5433. SetPlayerTime(Player, Time, 0);
  5434.  
  5435. if(Player != playerid)
  5436. {
  5437. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed "ORAN"\"%s[%i]"GREY"'s time to "ORAN"%d:00", Name(playerid), playerid, Name(Player), Player, Time);
  5438. FormatMSG(Player, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s time to "ORAN"%d:00", Name(Player), Player, Time);
  5439. }
  5440. else
  5441. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed his time to "ORAN"%d:00", Name(playerid), playerid, Time);
  5442. }
  5443. return 1;
  5444. }
  5445. CMD:setskin(PARAMS)
  5446. {
  5447. LoginCheck(playerid);
  5448. LevelCheck(playerid, 2);
  5449.  
  5450. new Player, Skin;
  5451. if(sscanf(params, "ui", Player, Skin)) return SendUsage(playerid, "/setskin "GREY"<id> <skin>", "Will change player's skin to the specified skin ID");
  5452. else
  5453. {
  5454. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  5455. CheckImune(playerid, Player);
  5456. if(!IsValidSkin(Skin)) return SendError(playerid, "Invalid skin!");
  5457. SetPlayerSkin(Player, Skin);
  5458.  
  5459. if(Player != playerid)
  5460. {
  5461. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed "ORAN"\"%s[%i]"GREY"'s skin to "ORAN"%d", Name(playerid), playerid, Name(Player), Player, Skin);
  5462. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s skin to "ORAN"%d", Name(Player), Player, Skin);
  5463. }
  5464. else
  5465. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed his skin to "ORAN"%d", Name(playerid), playerid, Skin);
  5466. }
  5467. return 1;
  5468. }
  5469. CMD:setarmour(PARAMS)
  5470. {
  5471. LoginCheck(playerid);
  5472. LevelCheck(playerid, 3);
  5473.  
  5474. new Player, Float: Armour;
  5475. if(sscanf(params, "uf", Player, Armour)) return SendUsage(playerid, "/setarmour "GREY"<id> <armour>", "Will set player's armour to the specified armour");
  5476. else
  5477. {
  5478. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  5479. CheckImune(playerid, Player);
  5480.  
  5481. SetPlayerArmour(Player, Float: Armour);
  5482.  
  5483. if(Player != playerid)
  5484. {
  5485. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"\"%s[%i]"GREY"'s armour to "ORAN"%.1f", Name(playerid), playerid, Name(Player), Player, Armour);
  5486. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s armour to "ORAN"%.1f", Name(Player), Player, Armour);
  5487. }
  5488. else
  5489. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his armour to "ORAN"%.1f", Name(playerid), playerid, Armour);
  5490. }
  5491. return 1;
  5492. }
  5493. CMD:sethealth(PARAMS)
  5494. {
  5495. LoginCheck(playerid);
  5496. LevelCheck(playerid, 3);
  5497.  
  5498. new Player, Float: Health;
  5499. if(sscanf(params, "uf", Player, Health)) return SendUsage(playerid, "/sethealth "GREY"<id> <health>", "Will set player's health to the specified health");
  5500. else
  5501. {
  5502. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  5503. CheckImune(playerid, Player);
  5504.  
  5505. SetPlayerHealth(Player, Float: Health);
  5506.  
  5507. if(Player != playerid)
  5508. {
  5509. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"\"%s[%i]"GREY"'s health to "ORAN"%.1f", Name(playerid), playerid, Name(Player), Player, Health);
  5510. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s health to "ORAN"%.1f", Name(Player), Player, Health);
  5511. }
  5512. else
  5513. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his health to "ORAN"%.1f", Name(playerid), playerid, Health);
  5514. }
  5515. return 1;
  5516. }
  5517. CMD:pm(PARAMS)
  5518. {
  5519. LoginCheck(playerid);
  5520.  
  5521. if((P_DATA[playerid][Muted] || P_DATA[playerid][Muted]) && P_DATA[playerid][Level] != 5 && !IsPlayerAdmin(playerid))
  5522. return SendError(playerid, "You are not allowed to send personal message while muted!");
  5523.  
  5524. new Player, Message[129];
  5525. if(sscanf(params, "us[129]", Player, Message)) return SendUsage(playerid, "/pm "GREY"<id> [message]", "Sends a personal message to the specified id");
  5526. else
  5527. {
  5528. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  5529. if(Player == playerid ) return SendError(playerid, "You cannot PM yourself!");
  5530.  
  5531. FormatMSG(Player, Color:ORAN, "PM Received: {FFD48A}%s[%i] says: "W"%s", Name(playerid), playerid, Message);
  5532. FormatMSG(playerid, Color:ORAN, "PM Sent: {FFD48A}to %s[%i]: %s", Name(Player), Player, Message);
  5533.  
  5534. if(S_DATA[ReadPM])
  5535. {
  5536. SendAdminCMD(playerid, "PM Detected: {FFD48A}%s[%i] "GREY"to %s[%i]", Name(playerid), playerid, Name(Player), Player);
  5537. SendAdminCMD(playerid, "Message: {FFD48A}%s", Message);
  5538. }
  5539. #if SAVE_IN_LOGS == true
  5540. SaveInLog(PMS_LOG, "---------------------------\r\n\
  5541. Sender %s\r\n\
  5542. Receiver %s\r\n\
  5543. Message: %s\r\n\
  5544. Date: %s\r\n\
  5545. ---------------------------\r\n\\r\n", Name(playerid), Name(Player), Message, zDate());
  5546. #endif
  5547. }
  5548. return 1;
  5549. }
  5550. CMD:register(PARAMS)
  5551. {
  5552. if(P_DATA[playerid][Logged])
  5553. return SendClientMessage(playerid, -1, ""ORAN"ACCOUNT: "W"You are already registered and logged in! ");
  5554.  
  5555. new zStr[100];
  5556. if(AccountExist(Name(playerid)))
  5557. {
  5558. format(zStr, sizeof (zStr), ""GREY"Hello "GREE"%s"GREY", you already have an account!\n\nPlease login into your account:", Name(playerid));
  5559. SPD(playerid, Dialog:Login3, INPUT, ""W"Welcome back", zStr, "Login", "Exit");
  5560. }
  5561. else
  5562. {
  5563. format(zStr, sizeof (zStr), ""GREY"Hello "ORAN"%s"GREY"\n\nPlease write your desired password:", Name(playerid));
  5564. ShowPlayerDialog(playerid, Dialog:Register1, DIALOG_STYLE_INPUT, ""W"Register an account", zStr, "Register", "Exit");
  5565.  
  5566. }
  5567. return 1;
  5568. }
  5569. CMD:login(PARAMS)
  5570. {
  5571. if(P_DATA[playerid][Logged])
  5572. return SendClientMessage(playerid, -1, ""ORAN"ACCOUNT: "W"You are already registered and logged in! ");
  5573.  
  5574. new zStr[100];
  5575. if(AccountExist(Name(playerid)))
  5576. {
  5577. format(zStr, sizeof (zStr), ""GREY"Hello "GREE"%s"GREY"!\n\nPlease login into your account:", Name(playerid));
  5578. SPD(playerid, Dialog:Login3, INPUT, ""W"Welcome back", zStr, "Login", "Exit");
  5579. }
  5580. else
  5581. {
  5582. format(zStr, sizeof (zStr), ""GREY"Hello "ORAN"%s"GREY", you don't have an account!\n\nPlease write your desired password:", Name(playerid));
  5583. ShowPlayerDialog(playerid, Dialog:Register1, DIALOG_STYLE_INPUT, ""W"Register an account", zStr, "Register", "Exit");
  5584. }
  5585. return 1;
  5586. }
  5587. CMD:t(p){FormatMSG(p, -1, "%d", P_DATA[p][Logged]);return 1;}
  5588. CMD:acp(PARAMS)
  5589. {
  5590. LoginCheck(playerid);
  5591. LevelCheck(playerid, 5);
  5592.  
  5593. SPD(playerid, Dialog:cPanel, LIST, ""ORAN"Server Control Panel", cPanel(), "Enable", "Disable");
  5594. return 1;
  5595. }
  5596. CMD:clearchat(PARAMS)
  5597. {
  5598. LoginCheck(playerid);
  5599. LevelCheck(playerid, 3);
  5600.  
  5601. new Yes[3];
  5602. if(sscanf(params, "s[3]", Yes)) return SendUsage(playerid, "/clearchat "GREY"[yes]", "Will clear the chat");
  5603. else
  5604. {
  5605. if(!strcmp(Yes, "yes"))
  5606. {
  5607. for(new m = 0; m < 10; m ++) { SendClientMessage(m, -1, " "); }
  5608. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" cleared the chat", Name(playerid), playerid);
  5609. SendClientMessage(playerid, Color:GREY, "You cleared the chat.");
  5610. }
  5611. else SendUsage(playerid, "/clearchat "GREY"[yes]", "Will clear the chat");
  5612. }
  5613. return 1;
  5614. }
  5615. CMD:chat(PARAMS)
  5616. {
  5617. LoginCheck(playerid);
  5618. LevelCheck(playerid, 4);
  5619.  
  5620. if(!strlen(params))
  5621. return SendUsage(playerid, "/chat "GREY"[block/unblock/spam/clear]");
  5622.  
  5623. if(!strcmp(params, "unblock"))
  5624. {
  5625. if(!S_DATA[Chat]) return SendError(playerid, "Chat already unblocked!");
  5626.  
  5627. S_DATA[Chat] = 0;
  5628. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" unblocked the chat", Name(playerid), playerid);
  5629. SendClientMessage(playerid, Color:GREY, "You unblocked the chat.");
  5630. }
  5631. else if(!strcmp(params, "block"))
  5632. {
  5633. BlockChat(playerid);
  5634. }
  5635. else if(!strcmp(params, "clear"))
  5636. {
  5637. for(new m = 0; m < 20; m ++) { SendClientMessageToAll(-1, "-"); }
  5638. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" cleared the chat", Name(playerid), playerid);
  5639. SendClientMessage(playerid, Color:GREY, "You cleared the chat.");
  5640. }
  5641. else if(!strcmp(params, "spam"))
  5642. {
  5643. new Str[65],
  5644. Preload[65] = "zxcvbnmlkjhgfdsaqwertyuioplmkjnhbgfvcdfrtghyasetgrhnhgrftghnhjki";
  5645.  
  5646.  
  5647. for(new x = 0; x < 45; x++)
  5648. {
  5649. new rCo = random(sizeof(SpamColors)),
  5650. rMe = random(65);
  5651.  
  5652. format(Str, sizeof (Str), "%s%s", Str[rMe], Preload[rMe]);
  5653. foreach(Player, i)
  5654. {
  5655.  
  5656. SendClientMessage(i, SpamColors[rCo], Str[x]);
  5657. }
  5658. }
  5659.  
  5660. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" spammed the chat", Name(playerid), playerid);
  5661. SendClientMessage(playerid, Color:GREY, "You spammed the chat.");
  5662. }
  5663. else return SendUsage(playerid, "/chat "GREY"[block/unblock/spam/clear]");
  5664.  
  5665. return 1;
  5666. }
  5667.  
  5668. CMD:respawncars(PARAMS)
  5669. {
  5670. LoginCheck(playerid);
  5671. LevelCheck(playerid, 5);
  5672.  
  5673. new Yes[3];
  5674. if(sscanf(params, "s[3]", Yes)) return SendUsage(playerid, "/respawncars "GREY"[yes]", "Will respawn all server's unoccupied vehicles");
  5675. else
  5676. {
  5677. if(!strcmp(Yes, "yes"))
  5678. {
  5679. for (new v = 0; v < MAX_VEHICLES; v++)
  5680. {
  5681. if(!VehicleOccupied(v))
  5682. {
  5683. SetVehicleToRespawn(v);
  5684. }
  5685. }
  5686. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" respawned all server unoccupied vehicles!", Name(playerid), playerid);
  5687. SendClientMessage(playerid, Color:GREY, "You respawned all server unoccupied vehicles!");
  5688. }else SendUsage(playerid, "/respawncars "GREY"[yes]", "Will rspawn all server's unoccupied vehicles");
  5689. }
  5690.  
  5691. return 1;
  5692. }
  5693. CMD:explode(PARAMS)
  5694. {
  5695. LoginCheck(playerid);
  5696. LevelCheck(playerid, 3);
  5697.  
  5698. if(sscanf(params, "u", params[0])) return SendUsage(playerid, "/explode "GREY"<id>", "Will create an explosion near specified player's location");
  5699. else
  5700. {
  5701. CheckImune(playerid, params[0]);
  5702. if(params[0] == (0xFFFF)) return SendClientMessage(playerid, -1, ""GREY"Player not connected!");
  5703. if(params[0] == playerid) return SendClientMessage(playerid, -1, ""GREY"You cannot unfreeze yourself!");
  5704.  
  5705. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" exploded player "ORAN"%s[%i]", Name(playerid), playerid, Name(params[0]), params[0]);
  5706. FormatMSG(playerid, Color:GREY, "You exploded "ORAN"%s[%i]", Name(params[0]), params[0]);
  5707. SendClientMessage(params[0], Color:GREY, "You have been exploded!");
  5708.  
  5709. new Float: _P[3];
  5710. GetPlayerPos(params[0],_P[0], _P[1], _P[2]);CreateExplosion(_P[0], _P[1], _P[2], 7, 10.0);
  5711. }
  5712. return 1;
  5713. }
  5714.  
  5715. CMD:slap(PARAMS)
  5716. {
  5717. LoginCheck(playerid);
  5718. LevelCheck(playerid, 3);
  5719.  
  5720. if(sscanf(params, "u", params[0], params[1])) return SendUsage(playerid, "/slap "GREY"<id>", "Will slap the specified player, throwing him 10 ft. up and loose -30 health");
  5721. else
  5722. {
  5723. CheckImune(playerid, params[0]);
  5724. if(params[0] == (0xFFFF)) return SendClientMessage(playerid, -1, ""GREY"Player not connected!");
  5725. if(params[0] == playerid) return SendClientMessage(playerid, -1, ""GREY"You cannot slap yourself!");
  5726.  
  5727. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" slapped player "ORAN"%s[%i]", Name(playerid), playerid, Name(params[0]), params[0]);
  5728. FormatMSG(playerid, Color:GREY, "You slapped "ORAN"%s[%i]", Name(params[0]), params[0]);
  5729. SendClientMessage(params[0], Color:GREY, "You have been slapped!");
  5730.  
  5731. new Float:Pos[3], Float: Health;
  5732. GetPlayerPos(params[0], Pos[0], Pos[1], Pos[2]);
  5733. SetPlayerPos(params[0], Pos[0], Pos[1], Pos[2] + 3.5);
  5734. GetPlayerHealth(params[0], Health);
  5735. SetPlayerHealth(params[0], Health - 30);
  5736. }
  5737. return 1;
  5738. }
  5739. CMD:unfreeze(PARAMS)
  5740. {
  5741. LoginCheck(playerid);
  5742. LevelCheck(playerid, 2);
  5743.  
  5744. if(sscanf(params, "u", params[0], params[1])) return SendUsage(playerid, "/unfreeze "GREY"<id>", "Will un-freeze the player that has been frozen");
  5745. else
  5746. {
  5747. CheckImune(playerid, params[0]);
  5748. if(params[0] == (0xFFFF)) return SendClientMessage(playerid, -1, ""GREY"Player not connected!");
  5749. if(params[0] == playerid) return SendClientMessage(playerid, -1, ""GREY"You cannot unfreeze yourself!");
  5750. if(!P_DATA[params[0]][Frozen]) return SendClientMessage(playerid, -1, ""GREY"Player is not frozen!");
  5751.  
  5752. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" unfreezed player "ORAN"%s[%i]", Name(playerid), playerid, Name(params[0]), params[0]);
  5753. FormatMSG(playerid, Color:GREY, "You unfreezed "ORAN"%s[%i]", Name(params[0]), params[0]);
  5754. SendClientMessage(params[0], Color:GREY, "You have been unfreezed!");
  5755.  
  5756. P_DATA[params[0]][Frozen] = 0;
  5757. UnFreeze(params[0]);
  5758.  
  5759. #if SAVE_FREEZE == true
  5760.  
  5761. new
  5762. Query[256];
  5763. format(Query, 256, "DELETE FROM `Frozen` WHERE `IP` = '%s'", GetPlayerIPEx(params[0]));
  5764. DB::Query(_DB, Query);
  5765.  
  5766. #endif
  5767. }
  5768. return 1;
  5769. }
  5770. CMD:freeze(PARAMS)
  5771. {
  5772. LoginCheck(playerid);
  5773. LevelCheck(playerid, 2);
  5774.  
  5775. if(sscanf(params, "u", params[0])) return SendUsage(playerid, "/freeze "GREY"<id>", "Will freeze a specified player, he will cannot freeze-evade!");
  5776. else
  5777. {
  5778. CheckImune(playerid, params[0]);
  5779. if(params[0] == (0xFFFF)) return SendClientMessage(playerid, -1, ""GREY"Player not connected!");
  5780. if(params[0] == playerid) return SendClientMessage(playerid, -1, ""GREY"You cannot freeze yourself!");
  5781. if(P_DATA[params[0]][Frozen]) return SendClientMessage(playerid, -1, ""GREY"Player is already frozen!");
  5782.  
  5783. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" freezed player "ORAN"%s[%i]", Name(playerid), playerid, Name(params[0]), params[0]);
  5784. FormatMSG(playerid, Color:GREY, "You freezed "ORAN"%s[%i]", Name(params[0]), params[0]);
  5785. SendClientMessage(params[0], Color:GREY, "You have been freezed!");
  5786.  
  5787. P_DATA[params[0]][Frozen] = 1;
  5788. Freeze(params[0]);
  5789.  
  5790. #if SAVE_FREEZE == true
  5791.  
  5792. new
  5793. Query[256],
  5794. DBResult:R1;
  5795. format(Query, sizeof(Query), "SELECT `Key` FROM `Frozen` WHERE `IP` = '%s'", GetPlayerIPEx(params [0]));
  5796. R1 = DB::Query(_DB, Query);
  5797.  
  5798. if(R1)
  5799. {
  5800. if(DB::Valid(R1))
  5801. {
  5802. DB::Free(R1);
  5803. format(Query, sizeof(Query), "INSERT INTO `Frozen` VALUES(NULL, '%s',1, '%s')",Name(params [0]), GetPlayerIPEx(params [0]));
  5804. DB::Query(_DB, Query);
  5805. }
  5806. else
  5807. {
  5808. DB::Free(R1);
  5809. format(Query, sizeof(Query), "UPDATE `Frozen` SET `Frozen` = '1', `RealName` = '%s' WHERE `IP` = '%s'", Name(params [0]), GetPlayerIPEx(params [0]));
  5810. DB::Query(_DB, Query);
  5811. }
  5812. }
  5813.  
  5814. #endif
  5815. }
  5816. return 1;
  5817. }
  5818. CMD:unjail(PARAMS)
  5819. {
  5820. LoginCheck(playerid);
  5821. LevelCheck(playerid, 3);
  5822.  
  5823. new Player;
  5824. if(sscanf(params, "u", Player)) return SendUsage(playerid, "/unjail "GREY"<id>", "Will unjail the specified player");
  5825. else
  5826. {
  5827. CheckImune(playerid, Player);
  5828. if(Player == (0xFFFF)) return SendClientMessage(playerid, -1, ""GREY"Player not connected!");
  5829. if(Player == playerid && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, ""GREY"You cannot unjail yourself!");
  5830. if(!P_DATA[Player][Jailed]) return SendClientMessage(playerid, -1, ""GREY"Player is not jailed!");
  5831.  
  5832. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" unjailed player "ORAN"%s[%i]", Name(playerid), playerid, Name(Player), Player);
  5833. FormatMSG(playerid, Color:GREY, "You unjailed "ORAN"%s[%i]", Name(Player), Player);
  5834. SendClientMessage(Player, Color:GREY, "You have been unjailed!");
  5835.  
  5836. P_DATA[Player][Jailed] = 0;
  5837. P_DATA[Player][JailTime] = 0;
  5838.  
  5839. SetPlayerInterior(playerid, 0);
  5840. SetPlayerPos(playerid, 0.0, 0.0, 0.0);
  5841. SpawnPlayer(playerid);
  5842. PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
  5843.  
  5844. #if SAVE_JAIL == true
  5845.  
  5846. new Query[256], DBResult:Result;
  5847. format(Query, 256, "SELECT `Key` FROM `Jailed` WHERE `IP` = '%s'", GetPlayerIPEx(params[0]));
  5848. Result = DB::Query(_DB, Query);
  5849.  
  5850. if(Result)
  5851. {
  5852. if(DB::Valid(Result))
  5853. {
  5854. DB::Free(Result);
  5855. format(Query, 256, "DELETE FROM `Jailed` WHERE `IP` = '%s'", GetPlayerIPEx(params[0]));
  5856. DB::Query(_DB, Query);
  5857. }
  5858. else
  5859. {
  5860. DB::Free(Result);
  5861. }
  5862. }
  5863.  
  5864. #endif
  5865. }
  5866. return 1;
  5867. }
  5868. CMD:jail(PARAMS)
  5869. {
  5870. LoginCheck(playerid);
  5871. LevelCheck(playerid, 3);
  5872.  
  5873. new Player, Time, Reason[40];
  5874. if(sscanf(params, "uD(0)S(No Reason)[40]", Player, Time, Reason)) return SendUsage(playerid, "/jail "GREY"<id> <time> [reason] "W"NOTICE: "GREY"Time must be in minutes! (If time was not set, jailed forever)", "Will jail the specified player with the specified amount of time");
  5875. else
  5876. {
  5877. CheckImune(playerid, Player);
  5878. if(Player == (0xFFFF)) return SendClientMessage(playerid, -1, ""GREY"Player not connected!");
  5879. if(Player == playerid) return SendClientMessage(playerid, -1, ""GREY"You cannot jail yourself!");
  5880. if(P_DATA[Player][Jailed]) return SendClientMessage(playerid, -1, ""GREY"Player is already jailed!");
  5881.  
  5882. if(Time == 0)
  5883. {
  5884. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" jailed player "ORAN"%s[%i] "GREY"[Reason: "W"%s"GREY"]", Name(playerid), playerid, Name(Player), Player, Reason);
  5885. FormatMSG(playerid, Color:GREY, "You jailed "ORAN"%s[%i] "GREY"[Reason: "W"%s"GREY"][Time: "W"Forever]", Name(Player), Player, Reason, Time);
  5886. SendClientMessage(Player, Color:GREY, "You have been jailed "W"["GREY"Time:"W" Forever[");
  5887. }
  5888. if(Time > 0)
  5889. {
  5890. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" jailed player "ORAN"%s[%i] "GREY"[Reason: "W"%s"GREY"][Time: "W"%d"GREY" Minutes]", Name(playerid), playerid, Name(Player), Player, Reason, Time);
  5891. FormatMSG(playerid, Color:GREY, "You jailed "ORAN"%s[%i] "GREY"[Reason: "W"%s"GREY"][Time: "W"%d"GREY" Minutes]", Name(Player), Player, Reason, Time);
  5892. FormatMSG(Player, Color:GREY, "You have been jailed "W"["GREY"Time:"W" %d "GREY"Minutes "W"]", Time);
  5893. }
  5894. P_DATA[Player][Jailed] = 1;
  5895. P_DATA[Player][JailTime] = Time;
  5896.  
  5897. SetTimerEx("JailPlayer", 1500, false, "i", Player);
  5898.  
  5899. #if SAVE_JAIL == true
  5900.  
  5901. new Query[256],DBResult:R1;
  5902. format(Query, sizeof(Query), "SELECT `Key` FROM `Jailed` WHERE `IP` = '%s'", GetPlayerIPEx(Player));
  5903. R1 = DB::Query(_DB, Query);
  5904.  
  5905. if(R1)
  5906. {
  5907. if(DB::Valid(R1))
  5908. {
  5909. DB::Free(R1);
  5910. format(Query, sizeof(Query), "INSERT INTO `Jailed` (`IP`,`Jailed`,`Time`,`RealName`) VALUES('%s','1','%d','%s')",Name(Player), Time, GetPlayerIPEx(Player));
  5911. DB::Query(_DB, Query);
  5912. }
  5913. else
  5914. {
  5915. DB::Free(R1);
  5916. format(Query, sizeof(Query), "UPDATE `Jailed` SET `Jailed` = '1', `Time` = '%d', `RealName` = '%s' WHERE `IP` = '%s'", Time, GetPlayerIPEx(Player), Name(Player));
  5917. DB::Query(_DB, Query);
  5918. }
  5919. }
  5920.  
  5921. #endif
  5922. }
  5923. return 1;
  5924. }
  5925. CMD:settemplevel(PARAMS)
  5926. {
  5927. LoginCheck(playerid);
  5928. LevelCheck(playerid, 5);
  5929.  
  5930. new Player, TempLevel;
  5931. if(sscanf(params, "ui", Player, TempLevel)) return SendUsage(playerid, "/settemplevel "GREY"<id> <level>", "Will set player's temporary level, but on exist he will loose the level");
  5932. else
  5933. {
  5934. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  5935. if(Player == playerid ) return SendError(playerid, "Player entered is you!");
  5936. if(Player < 0 || TempLevel > 5) return SendError(playerid, "Invalid level! Maximum level is "ORAN"5");
  5937.  
  5938. P_DATA[Player][tLevel] = 1;
  5939. P_DATA[Player][Level] = TempLevel;
  5940.  
  5941. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"%s[%i]"GREY"'s temporary level to "ORAN"%d", Name(playerid), playerid, Name(Player), Player, TempLevel);
  5942. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s temporary level to "ORAN"%d", Name(Player), Player, TempLevel);
  5943. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your temporary level to "ORAN"%d", Name(playerid), playerid, TempLevel);
  5944. SendClientMessage(playerid, Color:ORAN, "Level will expire on exit!");
  5945. }
  5946. return 1;
  5947. }
  5948. CMD:setvip(PARAMS)
  5949. {
  5950. LoginCheck(playerid);
  5951. LevelCheck(playerid, 5);
  5952.  
  5953. if(sscanf(params, "ui", params[0], params[1])) return SendUsage(playerid, "/setvip "GREY"<id> <level>", "Will set a player to the specified VIP level");
  5954. else
  5955. {
  5956. if(params[0] == (0xFFFF)) return SendError(playerid, "Player not connected!");
  5957. if(!P_DATA[params[0]][Logged]) return SendError(playerid, "Player must be logged in to change his level!");
  5958. if(P_DATA[params[0]][Vip] == params[1]) return SendError(playerid, "Player is already that level!");
  5959. if(params[1] < 0 || params[1] > 3) return SendError(playerid, "Invalid level! Maximum VIP level is "ORAN"3");
  5960.  
  5961. if(params[0] == playerid)
  5962. {
  5963. #if SAVE_IN_LOGS == true
  5964. SaveInLog(SETVIP_LOG, "Admin %s set his VIP level %d on %s", Name(playerid), params[1], zDate());
  5965. #endif
  5966. SendAdminCMD(-1, "Admin "ORAN"%s[%i]"GREY" set himself a VIP member level "ORAN"%d", Name(playerid), playerid, params[1]);
  5967. FormatMSG(playerid, Color:GREY, "You set yourself a VIP member level "ORAN"%d", params[1]);
  5968. }
  5969. else
  5970. {
  5971. #if SAVE_IN_LOGS == true
  5972. SaveInLog(SETVIP_LOG, "Admin %s changed %s's VIP level from %d to %d on %s", Name(playerid), Name(params[0]), P_DATA[params[0]][Vip], params[1], zDate());
  5973. #endif
  5974. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"%s[%i]"GREY"'s VIP level to "ORAN"%d", Name(playerid), playerid, Name(params[0]), params[0], params[1]);
  5975. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s VIP level to "ORAN"%d", Name(params[0]), params[0], params[1]);
  5976. FormatMSG(params[0], Color:GREY,"Admin "ORAN"%s[%i]"GREY" set your VIP level to "ORAN"%d", Name(playerid), playerid, params[1]);
  5977. }
  5978. SetPVarInt(params[0], "0_Vip", params[1]);
  5979. P_DATA[params[0]][Vip] = params[1];
  5980.  
  5981. if(AccountExist(Name(params[0])))
  5982. {
  5983. new Query[100];
  5984. format(Query, 120, "UPDATE `Accounts` SET `VIP` = '%d' WHERE `Name` = '%s'", params[1], Name(params[0]));
  5985. DB::Query(_DB, Query);
  5986. }
  5987. }
  5988. return 1;
  5989. }
  5990. CMD:ranks(PARAMS)
  5991. {
  5992. #if USE_RANKS == false
  5993.  
  5994. return SendError(playerid, "Using ranks is disabled from script!");
  5995.  
  5996. #else
  5997.  
  5998. LoginCheck(playerid);
  5999.  
  6000. new
  6001. RankString[2_0_0_0];
  6002. RankString = ""BLUE"# "GREY"The current server ranks:\n\n";
  6003. for (new r = 0; r < sizeof(_Ranks); r++)
  6004. {
  6005. format(RankString, sizeof (RankString), "%s"GREY"Rank: "BLUE"%d"GREY" | Kills: "BLUE"%d"GREY" | Name: "BLUE"%s\n",RankString, r, _Ranks[r][iRank], _Ranks[r][irName]);
  6006. }
  6007. ShowPlayerDialog(playerid, Dialog:Empty, BOX, ""BLUE"Server Ranks", RankString, "Close", "");
  6008. return 1;
  6009.  
  6010. #endif
  6011. }
  6012. CMD:setrank(PARAMS)
  6013. {
  6014. #if USE_RANKS == false
  6015.  
  6016. return SendError(playerid, "Using ranks is disabled from script!");
  6017.  
  6018. #else
  6019.  
  6020. LoginCheck(playerid);
  6021. LevelCheck(playerid, 4);
  6022.  
  6023. if(sscanf(params, "ud", params[0], params[1])) return SendUsage(playerid, "/setrank "GREY"<id> <rank>", "Will change a player's rank position!("ORAN"Check /RANKS "GREY")");
  6024. else
  6025. {
  6026. if(params[0] == (0xFFFF)) return SendError(playerid, "Player not connected!");
  6027. if(!P_DATA[params[0]][Logged]) return SendError(playerid, "Player must be logged in to change his rank!");
  6028. if(P_DATA[params[0]][Rank] == params[1]) return SendError(playerid, "Player is already that rank!");
  6029. if(params[1] < 0 || params[1] > sizeof(_Ranks) - 1)
  6030. {
  6031. FormatMSG(playerid, Color:ORAN, "* "GREY"Invalid level! Maximum rank is "ORAN"%d "W"-"ORAN"%s", sizeof(_Ranks) - 1, _Ranks[sizeof(_Ranks) - 1][irName]);
  6032. return 1;
  6033. }
  6034. if(params[0] == playerid)
  6035. {
  6036. #if SAVE_IN_LOGS == true
  6037. SaveInLog(SETRANK_LOG, "Admin %s promoved set his rank to %d on %s", Name(playerid), params[1], zDate());
  6038. #endif
  6039. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his rank to "ORAN"%d "GREY"|"ORAN" %s", Name(playerid), playerid, params[1], RankName(params[1]));
  6040. FormatMSG(playerid, Color:GREY, "You set your rank to "ORAN"%d "GREY"|"ORAN" %s", params[1], RankName(params[1]));
  6041.  
  6042. SetPVarInt(playerid, "0_Rank", params[1]) ;
  6043. P_DATA[playerid][Rank] = params[1];
  6044. }
  6045. else
  6046. {
  6047. if(P_DATA[params[0]][Rank] < params[1])
  6048. {
  6049. #if SAVE_IN_LOGS == true
  6050. SaveInLog(SETRANK_LOG, "Admin %s promoved %s from Rank %d to %d on %s", Name(playerid), Name(params[0]), P_DATA[params[0]][Rank], params[1], zDate());
  6051. #endif
  6052. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" promoved "ORAN"%s[%i]"GREY" with a new rank: "ORAN"%d | %s", Name(playerid), playerid, Name(params[0]), params[0], params[1], RankName(params [1]));
  6053. GameTextForPlayer(params[0], "~n~~n~~n~~n~~n~~n~~n~~g~Ranked up!!", 6000, 1);
  6054. FormatMSG(params[0], Color:GREY,"Admin "ORAN"%s[%i]"GREY" set your rank to "ORAN"%d | %s", Name(playerid), playerid, params[1], RankName(params [1]));
  6055. FormatMSG(playerid, Color:GREY,"You set "ORAN"%s[%i]"GREY"'s rank to "ORAN"%d | %s", Name(params[0]), params[0], params[1], RankName(params [1]));
  6056. }
  6057. else
  6058. {
  6059. #if SAVE_IN_LOGS == true
  6060. SaveInLog(SETRANK_LOG, "Admin %s demoted %s from Rank %d to %d on %s", Name(playerid), Name(params[0]), P_DATA[params[0]][Rank], params[1], zDate());
  6061. #endif
  6062. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" demoted "ORAN"%s[%i]"GREY"'s rank to "ORAN"%d | %s", Name(playerid), playerid, Name(params[0]), params[0], params[1], RankName(params [1]));
  6063. GameTextForPlayer(params[0], "~n~~n~~n~~n~~n~~n~~n~~r~Ranked down!!", 6000, 1);
  6064. FormatMSG(params[0], Color:GREY,"Admin "ORAN"%s[%i]"GREY" set your rank to "ORAN"%d | %s", Name(playerid), playerid, params[1], RankName(params [1]));
  6065. FormatMSG(playerid, Color:GREY,"You set "ORAN"%s[%i]"GREY"'s rank to "ORAN"%d | %s", Name(params[0]), params[0], params[1], RankName(params [1]));
  6066. }
  6067. P_DATA[params[0]][Rank] = params[1];
  6068. SetPVarInt(params[0], "0_Rank", params[1]);
  6069. }
  6070. new Query[120];
  6071. if(AccountExist(Name(params[0])))
  6072. {
  6073. format(Query, 120, "UPDATE `Accounts` SET `Rank` = '%d' WHERE `Name` = '%s'", params[1], Name(params[0]));
  6074. DB::Query(_DB, Query);
  6075. }
  6076.  
  6077. #if UPDATE_TOP_ALWAYS == true
  6078. new
  6079. DBResult: R1;
  6080.  
  6081. format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(params[0]));
  6082. R1 = DB::Query(_DB, Query);
  6083.  
  6084. if(R1)
  6085. {
  6086. if(DB::Valid(R1))
  6087. {
  6088. DB::Free(R1);
  6089. format(Query, sizeof(Query), "UPDATE `Top` SET `Rank` = '%d' WHERE `Name` = '%s'", params[1], Name(params[0]));
  6090. DB::Query(_DB, Query);
  6091. }
  6092. else
  6093. {
  6094. DB::Free(R1);
  6095. format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`,`Rank`) VALUES('%s','%d')",Name(params[0]), params[1]);
  6096. DB::Query(_DB, Query);
  6097. }
  6098. }
  6099. #endif
  6100. }
  6101. return 1;
  6102.  
  6103. #endif
  6104. }
  6105. CMD:setlevel(PARAMS)
  6106. {
  6107. LoginCheck(playerid);
  6108. LevelCheck(playerid, 5);
  6109.  
  6110. if(sscanf(params, "ud", params[0], params[1])) return SendUsage(playerid, "/setlevel "GREY"<id> <level>", "Will change a player's level position!");
  6111. else
  6112. {
  6113. if(params[0] == (0xFFFF)) return SendError(playerid, "Player not connected!");
  6114. if(!P_DATA[params[0]][Logged]) return SendError(playerid, "Player must be logged in to change his level!");
  6115. if(P_DATA[params[0]][Level] == params[1]) return SendError(playerid, "Player is already that level!");
  6116. if(params[1] < 0 || params[1] > 5) return SendError(playerid, "Invalid level! Maximum level is "ORAN"5");
  6117.  
  6118. if(params[0] == playerid)
  6119. {
  6120. #if SAVE_IN_LOGS == true
  6121. SaveInLog(SETLEVEL_LOG, "Admin %s set his level to %d | %s on %s", Name(playerid), params[1], LevelName(params[1]), zDate());
  6122. #endif
  6123. SetPVarInt(playerid, "0_Level", params[1]) ;
  6124. P_DATA[playerid][Level] = params[1];
  6125. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set himself as "ORAN"%s"GREY" of the server!", Name(playerid), playerid, LevelName(params[1]));
  6126. FormatMSG(playerid, Color:GREY, "You set yourself as "ORAN"%s"GREY" of the server!", LevelName(params[1]));
  6127. }
  6128. else
  6129. {
  6130. if(P_DATA[params[0]][Level] < params[1])
  6131. {
  6132. #if SAVE_IN_LOGS == true
  6133. SaveInLog(SETLEVEL_LOG, "Admin %s promoved %s from %d to %d on %s", Name(playerid), Name(params[0]), P_DATA[params[0]][Level], params[1], zDate());
  6134. #endif
  6135. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" promoved "ORAN"%s[%i]"GREY" as "ORAN"%s", Name(playerid), playerid, Name(params[0]), params[0], LevelName(params[1]));
  6136. GameTextForPlayer(params[0], "~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~Promoved!", 6000, 1);
  6137. FormatMSG(params[0], Color:GREY,"Admin "ORAN"%s[%i]"GREY" promoved you as "ORAN"%s"GREY" of the server", Name(playerid), playerid, LevelName(params[1]));
  6138. FormatMSG(playerid, Color:GREY,"You promoved "ORAN"%s[%i]"GREY" as "ORAN"%s"GREY" of the server", Name(params[0]), params[0], LevelName(params[1]));
  6139. }
  6140. else
  6141. {
  6142. #if SAVE_IN_LOGS == true
  6143. SaveInLog(SETLEVEL_LOG, "Admin %s demoted %s from %d to %d on %s", Name(playerid), Name(params[0]), P_DATA[params[0]][Level], params[1], zDate());
  6144. #endif
  6145. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" demoted "ORAN"%s[%i]"GREY" to "ORAN"%s", Name(playerid), playerid, Name(params[0]), params[0], LevelName(params[1]));
  6146. GameTextForPlayer(params[0], "~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~r~Demoted!", 6000, 1);
  6147. FormatMSG(params[0], Color:GREY,"Admin "ORAN"%s[%i]"GREY" demoted to a "ORAN"%s"GREY" of the server", Name(playerid), playerid, LevelName(params[1]));
  6148. FormatMSG(playerid, Color:GREY,"You demoted "ORAN"%s[%i]"GREY" as "ORAN"%s"GREY" of the server", Name(params[0]), params[0], LevelName(params[1]));
  6149.  
  6150. }
  6151. SetPVarInt(params[0], "0_Level", params[1]) ;
  6152. P_DATA[params[0]][Level] = params[1];
  6153.  
  6154. }
  6155.  
  6156. new Query[120];
  6157. if(AccountExist(Name(params[0])))
  6158. {
  6159. format(Query, 120, "UPDATE `Accounts` SET `Level` = '%d' WHERE `Name` = '%s'", params[1], Name(params[0]));
  6160. DB::Query(_DB, Query);
  6161. }
  6162. }
  6163. return 1;
  6164. }
  6165.  
  6166. CMD:unmute(PARAMS)
  6167. {
  6168. LoginCheck(playerid);
  6169. LevelCheck(playerid, 2);
  6170.  
  6171. if(sscanf(params, "u", params[0])) return SendUsage(playerid, "/unmute "GREY"<id>", "Will unmute the specified player");
  6172. else
  6173. {
  6174. CheckImune(playerid, params[0]);
  6175. if(params[0] == (0xFFFF)) return SendError(playerid, "Player not connected!");
  6176. if(params[0] == playerid ) return SendError(playerid, "You cannot unmute yourself!");
  6177. if(!P_DATA[params[0]][Muted]) return SendError(playerid, "Player is not muted!");
  6178.  
  6179. P_DATA[params[0]][Muted] = 0;
  6180. P_DATA[params[0]][MutedTime] = 0;
  6181.  
  6182. KillTimer(MuteTimer[params[0]]);
  6183. #if SAVE_MUTE == true
  6184.  
  6185. new
  6186. Query[256];
  6187. format(Query, 256, "DELETE FROM `Muted` WHERE `IP` = '%s'", GetPlayerIPEx(params[0]));
  6188. DB::Query(_DB, Query);
  6189.  
  6190.  
  6191. #endif
  6192.  
  6193. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" unmuted player "ORAN"%s[%i]", Name(playerid), playerid, Name(params[0]), params[0]);
  6194. FormatMSG(playerid, Color:GREY, "You unmuted "ORAN"%s[%i]", Name(params[0]), params[0]);
  6195. SendClientMessage(params[0], Color:GREY, "You have been unmuted!");
  6196. }
  6197. return 1;
  6198. }
  6199. CMD:spawnall(PARAMS)
  6200. {
  6201. LoginCheck(playerid);
  6202. LevelCheck(playerid, 4);
  6203.  
  6204. foreach(Player, i)
  6205. {
  6206. if(P_DATA[i][Level] != 5)
  6207. {
  6208. if(i != playerid)
  6209. {
  6210. SpawnPlayer(i);
  6211. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" spawned you and everyone!", Name(playerid), playerid);
  6212. }
  6213. }
  6214. }
  6215. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" spawned everyone!", Name(playerid), playerid);
  6216. SendClientMessage(playerid, Color:GREY, "You spawned everyone in the server!");
  6217. return 1;
  6218. }
  6219. CMD:killall(PARAMS)
  6220. {
  6221. LoginCheck(playerid);
  6222. LevelCheck(playerid, 4);
  6223.  
  6224. foreach(Player, i)
  6225. {
  6226. if(P_DATA[i][Level] != 5)
  6227. {
  6228. if(i != playerid)
  6229. {
  6230. SetPlayerHealth(i, 0.0);
  6231. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" killed you and everyone!", Name(playerid), playerid);
  6232. }
  6233. }
  6234. }
  6235. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" killed everyone!", Name(playerid), playerid);
  6236. SendClientMessage(playerid, Color:GREY, "You killed everyone in the server!");
  6237. return 1;
  6238. }
  6239. CMD:unfreezeall(PARAMS)
  6240. {
  6241. LoginCheck(playerid);
  6242. LevelCheck(playerid, 4);
  6243.  
  6244. foreach(Player, i)
  6245. {
  6246. if(P_DATA[i][Level] != 5)
  6247. {
  6248. if(i != playerid)
  6249. {
  6250. P_DATA[i][Frozen] = 0;
  6251. UnFreeze(i);
  6252. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" defrosted you and everyone!", Name(playerid), playerid);
  6253. }
  6254. }
  6255. }
  6256. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" defrosted everyone!", Name(playerid), playerid);
  6257. SendClientMessage(playerid, Color:GREY, "You defrosted everyone in the server!");
  6258. return 1;
  6259. }
  6260. CMD:freezeall(PARAMS)
  6261. {
  6262. LoginCheck(playerid);
  6263. LevelCheck(playerid, 4);
  6264.  
  6265. foreach(Player, i)
  6266. {
  6267. if(P_DATA[i][Level] != 5)
  6268. {
  6269. if(i != playerid)
  6270. {
  6271. P_DATA[i][Frozen] = 1;
  6272. Freeze(i);
  6273. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" froze you and everyone!", Name(playerid), playerid);
  6274. }
  6275. }
  6276. }
  6277. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" froze everyone!", Name(playerid), playerid);
  6278. SendClientMessage(playerid, Color:GREY, "You froze everyone in the server! However, if the re-connect, they will be able to move again.");
  6279. return 1;
  6280. }
  6281. CMD:banall(PARAMS)
  6282. {
  6283. LoginCheck(playerid);
  6284. LevelCheck(playerid, 5);
  6285.  
  6286. new
  6287. File:zFile,
  6288. zStr[100];
  6289.  
  6290.  
  6291. zFile = fopen(BAN_LOG, io_append);
  6292. format(zStr, sizeof (zStr), "\r\n\r\n\r\n][MASSIVE BAN ON %s[]\r\n", zDate ());
  6293.  
  6294. fwrite(zFile, zStr);
  6295.  
  6296. foreach(Player, i)
  6297. {
  6298. if(P_DATA[i][Level] < 3 || !P_DATA[i][Vip])
  6299. {
  6300. if(i != playerid)
  6301. {
  6302. #if SAVE_IN_LOGS == true
  6303.  
  6304. if(zFile)
  6305. {
  6306.  
  6307. format(zStr, sizeof (zStr), "Player: %s[%i] has been banned by \"%s\" with reason \"Massive ban!\" on %s\r\n",
  6308. Name(i),
  6309. i,
  6310. Name(playerid),
  6311. zDate());
  6312. fwrite(zFile, zStr);
  6313.  
  6314. }
  6315.  
  6316. #endif
  6317. }
  6318. }
  6319. }
  6320. fwrite(zFile, "][!! END OF MASSIVE BAN !![]");
  6321. fclose(zFile);
  6322. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" banned everyone from the server except VIP members and level 3 admins!", Name(playerid), playerid);
  6323. SendClientMessage(playerid, Color:GREY, "You banned everyone from the server!");
  6324. return 1;
  6325. }
  6326. CMD:kickall(PARAMS)
  6327. {
  6328. LoginCheck(playerid);
  6329. LevelCheck(playerid, 5);
  6330.  
  6331.  
  6332. new
  6333. File:zFile,
  6334. zStr[100];
  6335.  
  6336.  
  6337. zFile = fopen(KICK_LOG, io_append);
  6338. format(zStr, sizeof (zStr), "\r\n\r\n\r\n][MASSIVE KICK ON %s[]\r\n", zDate ());
  6339.  
  6340. fwrite(zFile, zStr);
  6341.  
  6342. foreach(Player, i)
  6343. {
  6344. if(P_DATA[i][Level] < 3 || !P_DATA[i][Vip])
  6345. {
  6346. if(i != playerid)
  6347. {
  6348. KickEx(i, Name(i), "Massive kick!", false);
  6349. }
  6350. }
  6351. }
  6352. fwrite(zFile, "][!! END OF MASSIVE KICK !![]");
  6353. fclose(zFile);
  6354. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" kicked everyone from the server except VIP members and level 3 admins!", Name(playerid), playerid);
  6355. SendClientMessage(playerid, Color:GREY, "You kicked everyone from the server!");
  6356. return 1;
  6357. }
  6358. CMD:slapall(PARAMS)
  6359. {
  6360. LoginCheck(playerid);
  6361. LevelCheck(playerid, 4);
  6362.  
  6363. new
  6364. Float:Pos[3],
  6365. Float:Health
  6366. ;
  6367.  
  6368. foreach(Player, i)
  6369. {
  6370. if(P_DATA[i][Level] != 5)
  6371. {
  6372. if(i != playerid)
  6373. {
  6374.  
  6375. GetPlayerPos(i, Pos[0], Pos[1], Pos[2]);
  6376. SetPlayerPos(i, Pos[0], Pos[1], Pos[2] + 3.5);
  6377. GetPlayerHealth(i, Health);
  6378. SetPlayerHealth(i, Health - 30);
  6379. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" unmuted you and everyone!", Name(playerid), playerid);
  6380. }
  6381. }
  6382. }
  6383. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" slapped everyone!", Name(playerid), playerid);
  6384. SendClientMessage(playerid, Color:GREY, "You slapped everyone in the server!");
  6385. return 1;
  6386. }
  6387.  
  6388. CMD:unmuteall(PARAMS)
  6389. {
  6390. LoginCheck(playerid);
  6391. LevelCheck(playerid, 4);
  6392.  
  6393. foreach(Player, i)
  6394. {
  6395. if(P_DATA[i][Level] != 5)
  6396. {
  6397. if(i != playerid)
  6398. {
  6399. P_DATA[i][MutedAll] = 0;
  6400. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" unmuted you and everyone!", Name(playerid), playerid);
  6401. }
  6402. }
  6403. }
  6404. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" unmuted everyone!", Name(playerid), playerid);
  6405. SendClientMessage(playerid, Color:GREY, "You unmuted everyone in the server!");
  6406. return 1;
  6407. }
  6408. CMD:muteall(PARAMS)
  6409. {
  6410. LoginCheck(playerid);
  6411. LevelCheck(playerid, 3);
  6412.  
  6413. foreach(Player, i)
  6414. {
  6415. if(P_DATA[i][Level] != 5)
  6416. {
  6417. if(i != playerid)
  6418. {
  6419. P_DATA[i][MutedAll] = 1;
  6420. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" muted you and everyone!", Name(playerid), playerid);
  6421. }
  6422. }
  6423. }
  6424. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" muted everyone!", Name(playerid), playerid);
  6425. SendClientMessage(playerid, Color:GREY, "You muted everyone in the server! However, if the re-connect, they will be able to speak.");
  6426. return 1;
  6427. }
  6428. CMD:mute(PARAMS)
  6429. {
  6430. LoginCheck(playerid);
  6431. LevelCheck(playerid, 2);
  6432.  
  6433. if(sscanf(params, "uD(0)", params[0], params[1])) return SendUsage(playerid, "/mute "GREY"<id> <time> "W"NOTICE: "GREY"Time must be in minutes! (If time was not set, muted forever)", "Will mute the player with time, player cannt mute-evade this");
  6434. else
  6435. {
  6436. CheckImune(playerid, params[0]);
  6437. if(params[0] == (0xFFFF)) return SendError(playerid, "Player not connected!");
  6438. if(params[0] == playerid) return SendError(playerid, "You cannot mute yourself!");
  6439. if(P_DATA[params[0]][Muted]) return SendError(playerid, "Player is already muted!");
  6440.  
  6441. if(!params[1])
  6442. {
  6443.  
  6444. P_DATA[params[0]][Muted] = 1;
  6445. P_DATA[params[0]][MutedTime] = 0;
  6446.  
  6447.  
  6448. #if SAVE_MUTE == true
  6449. new
  6450. pQue[256];
  6451.  
  6452. format(pQue, 256, "SELECT `Key` FROM `Muted` WHERE `IP` = '%s'", GetPlayerIPEx(params[0]));
  6453. new DBResult:R1 = DB::Query(_DB, pQue);
  6454.  
  6455. if(R1)
  6456. {
  6457. if(!DB::Valid(R1))
  6458. {
  6459. DB::Free(R1);
  6460. format(pQue, sizeof (pQue), "INSERT INTO `Muted` VALUES (NULL, '%s', '1', '0', '%s')", GetPlayerIPEx(params[0]), Name(params[0]));
  6461. DB::Query(_DB, pQue);
  6462. }
  6463. else
  6464. {
  6465. DB::Free(R1);
  6466. format(pQue, sizeof (pQue), "UPDATE `Muted` SET `Muted` = '1', `Time` = '0', `RealName` = '%s' WHERE `IP` = '%s'", Name(params[0]), GetPlayerIPEx(params[0]));
  6467. DB::Query(_DB, pQue);
  6468. }
  6469. }
  6470.  
  6471. #endif
  6472.  
  6473. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" muted player "ORAN"%s[%i]", Name(playerid), playerid, Name(params[0]), params[0], params[1]);
  6474. FormatMSG(playerid, Color:GREY, "You muted "ORAN"%s[%i]", Name(params[0]), params[0]);
  6475. SendClientMessage(params[0], Color:GREY, "You have been muted!");
  6476. }
  6477. else
  6478. {
  6479. P_DATA[params[0]][Muted] = 1;
  6480.  
  6481. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" muted player "ORAN"%s[%i] "GREY"["ORAN"Time: "W"%d"GREY" minutes[", Name(playerid), playerid, Name(params[0]), params[0], params[1]);
  6482. FormatMSG(playerid, Color:GREY, "You muted "ORAN"%s[%i] "GREY"["ORAN"Time: "W"%d"GREY" minutes[", Name(params[0]), params[0], params[1]);
  6483. FormatMSG(params[0], Color:GREY, "You have been muted! "W"["GREE"Time: "W"%d"GREY" minutes"W"[", params[1]);
  6484.  
  6485. #if SAVE_MUTE == true
  6486.  
  6487. new
  6488. pQue[256];
  6489.  
  6490. format(pQue, 256, "SELECT `Key` FROM `Muted` WHERE `IP` = '%s'", GetPlayerIPEx(params[0]));
  6491. new DBResult:R1 = DB::Query(_DB, pQue);
  6492.  
  6493. if(R1)
  6494. {
  6495. if(!DB::Valid(R1))
  6496. {
  6497. DB::Free(R1);
  6498. format(pQue, sizeof (pQue), "INSERT INTO `Muted` VALUES (NULL, '%s', '1', '%d', '%s')", GetPlayerIPEx(params[0]), params[1], Name(params[0]));
  6499. DB::Query(_DB, pQue);
  6500. }
  6501. else
  6502. {
  6503. DB::Free(R1);
  6504. format(pQue, sizeof (pQue), "UPDATE `Muted` SET `Muted` = '1', `Time` = '%d', `RealName` = '%s' WHERE `IP` = '%s'", params[1], Name(params[0]), GetPlayerIPEx(params[0]));
  6505. DB::Query(_DB, pQue);
  6506. }
  6507. }
  6508.  
  6509. #endif
  6510.  
  6511. KillTimer(MuteTimer[params[0]]);
  6512. MuteTimer[params[0]] = SetTimerEx("UnMutePlayer", 60_000, true, "i", params[0]);
  6513. P_DATA[params[0]][MutedTime] = params[1];
  6514. }
  6515. }
  6516. return 1;
  6517. }
  6518.  
  6519. CMD:kick(PARAMS)
  6520. {
  6521. LoginCheck(playerid);
  6522. LevelCheck(playerid, 4);
  6523.  
  6524. if(sscanf(params, "uS(No Reason)[40]", params[0], params[1])) return SendUsage(playerid, "/kick "GREY"<id> [reason]", "Will kick the specified player, a log of this kick will be created");
  6525. else
  6526. {
  6527. if(playerid == params[0]) return SendError(playerid, "You can't kick yourself!");
  6528. if(params[0] == (0xFFFF)) return SendError(playerid, "Player not connected!");
  6529.  
  6530. CheckImune(playerid, params[0]);
  6531.  
  6532. KickEx(params[0], Name(playerid), params[1], true);
  6533. }
  6534. return 1;
  6535. }
  6536. CMD:unban(PARAMS)
  6537. {
  6538. LoginCheck(playerid);
  6539. LevelCheck(playerid, 5);
  6540.  
  6541. new Account[50];
  6542. if(sscanf(params, "s[50]", Account)) return SendUsage(playerid, "/unban [name]","Will unban a banned account");
  6543. else
  6544. {
  6545. new DBResult:Result, Query[129];
  6546. format(Query, 129, "SELECT `IP` FROM `Banlist` WHERE `Name` = '%s'", Account);
  6547. Result = DB::Query(_DB, Query);
  6548.  
  6549. if(Result)
  6550. {
  6551. if(DB::Valid(Result))
  6552. {
  6553. new fIP[30];
  6554. DB::GetField(Result, "IP", fIP, 30);
  6555.  
  6556. if(strlen(fIP) > 0)
  6557. {
  6558. new Str[50];
  6559. format(Str, sizeof (Str), "unbanip %s", fIP);
  6560. SendRconCommand(Str), SendRconCommand("reloadbans");
  6561. }
  6562. DB::Free(Result);
  6563. format(Query, 129, "DELETE FROM `Banlist` WHERE `Name` = '%s'", Account);
  6564. DB::Query(_DB, Query);
  6565.  
  6566. FormatMSG(playerid, Color:GREY, "Account "ORAN"%s"GREY" has been removed from the Banlist!", Account);
  6567. }
  6568. else
  6569. {
  6570. DB::Free(Result);
  6571. SendError(playerid, "Account not found in the Banlist!");
  6572. return 1;
  6573. }
  6574. }
  6575.  
  6576. }
  6577. return 1;
  6578. }
  6579.  
  6580. CMD:ban(PARAMS)
  6581. {
  6582. LoginCheck(playerid);
  6583. LevelCheck(playerid, 5);
  6584.  
  6585. new Player, IpBan, Reason[40];
  6586. if(sscanf(params, "udS(No Reason)[40]", Player, IpBan, Reason) || IpBan > 1 || IpBan < 0) return SendUsage(playerid, "/ban "GREY"<id> <ipban 1/0> [reason] "GREY"(1 - It will IP Ban the player | 0 - Only account ban!)", "Will ban the specified player, a log of this ban will be created");
  6587. else
  6588. {
  6589. if(playerid == Player) return SendError(playerid, "You can't ban yourself!");
  6590. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  6591. CheckImune(playerid, Player);
  6592.  
  6593. if(IpBan)
  6594. {
  6595. #if SAVE_IN_LOGS == true
  6596. new
  6597. zStr[256],
  6598. File:zFile;
  6599.  
  6600. format(zStr, sizeof (zStr), "Player: %s[%i] has been IP banned by \"%s\" with reason \"%s\" on %s\r\n",
  6601. Name(playerid),
  6602. playerid,
  6603. Name(playerid),
  6604. Reason,
  6605. zDate());
  6606.  
  6607.  
  6608. zFile = fopen(BAN_LOG, io_append);
  6609. if(zFile)
  6610. {
  6611. fwrite(zFile, zStr);
  6612. fclose(zFile);
  6613. }
  6614. #endif
  6615.  
  6616. FormatMSG(playerid, Color:ORAN, "SERVER:"W" You have been banned from this server! "W"["GREY" %s"W"]", Reason);
  6617. BanEx(Player, Reason);
  6618. }
  6619. else
  6620. {
  6621. BanEx2(Player, Name(playerid), Reason);
  6622. FormatMSG(playerid, Color:ORAN, "SERVER:"W" You have been banned from this server! "W"["GREY" %s"W"]", Reason);
  6623. }
  6624. SendAdminCMD(playerid, ""W"Player "ORAN"%s[%i]"W" has been %s by "ORAN"%s[%i] "W"with reason"ORAN" \"%s\"",Name(Player),Player,(IpBan) ? ("IP banned") : ("account banned"),Name(playerid),playerid,Reason);
  6625.  
  6626. }
  6627. return 1;
  6628. }
  6629. stock AntiIP(const string[])
  6630. {
  6631. static
  6632. RegEx:IP;
  6633. if(!IP)IP = regex_build("(.*?)([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})(.*?)");
  6634.  
  6635. return regex_match_exid(string, IP);
  6636. }
  6637. stock AntiSite(const string[])
  6638. {
  6639. static
  6640. RegEx:Site;
  6641. if(!Site)Site = regex_build("([\\w-]*://)?([\\w-]+\\.)+([\\w-]+)(/[^\\s]*)*");
  6642.  
  6643. return regex_match_exid(string, Site);
  6644. }
  6645. public OnPlayerText(playerid, text[])
  6646. {
  6647. if(!P_DATA[playerid][Muted] || !P_DATA[playerid][MutedAll])
  6648. {P_DATA[playerid][Msgs]++;}
  6649.  
  6650. //If player is NOT the RCON admin and NEITHER the OWNER
  6651. if(!IsPlayerAdmin(playerid) && P_DATA[playerid][Level] != 5)
  6652. {
  6653.  
  6654. //Then, take action!
  6655. if((P_DATA[playerid][Muted] || P_DATA[playerid][MutedAll]))
  6656. {
  6657. if(!P_DATA[playerid][MutedTime])
  6658. SendClientMessage(playerid, Color:ORAN, "SERVER:"W" You are not allowed to chat! You have been muted!");
  6659. else
  6660. FormatMSG(playerid, Color:ORAN, "SERVER:"W" You are still muted! "ORAN"["GREY"Aprox: "W"%d minutes"ORAN"]",P_DATA[playerid][MutedTime]);
  6661.  
  6662. return 0;
  6663. }
  6664.  
  6665.  
  6666. if(S_DATA[AntiRepeat])
  6667. {
  6668. if(!isnull(P_DATA[playerid][RepMSG]))
  6669. {
  6670. if(!strcmp(text, P_DATA[playerid][RepMSG], false))
  6671. {
  6672. SendClientMessage(playerid, Color:ORAN, "SERVER:"W" Please don't repeat yourself!");
  6673. SendAdminCMD(playerid, "Player %s[%i] repeated himself!", Name(playerid), playerid);
  6674. return 0;
  6675. }
  6676. }
  6677. format(P_DATA[playerid][RepMSG], 129, text);
  6678. }
  6679. if(S_DATA[Chat])
  6680. {
  6681. return GameTextForPlayer(playerid, "~n~~n~~n~~n~~r~Chat has been disabled!~w~You cannot send any messages!", 5000, 3);
  6682. }
  6683.  
  6684. P_DATA[playerid][SpamMSG] ++;
  6685. if(!P_DATA[playerid][Muted] && S_DATA[AntiSpam])
  6686. {
  6687. if(P_DATA[playerid][SpamMSG] > MAXIMUM_SPAM && !IsPlayerAdmin(playerid))
  6688. return BanEx2(playerid, .zReason = "Extreme Spam!"),false;
  6689.  
  6690. else if(P_DATA[playerid][SpamMSG] > MEDIUM_SPAM)
  6691. return KickEx(playerid, .zReason = "Massive Spam"),false;
  6692.  
  6693. else if(P_DATA[playerid][SpamMSG] > MINIMUM_SPAM)
  6694. {
  6695. P_DATA[playerid][Muted] = 1;
  6696. P_DATA[playerid][MutedTime] = 1;
  6697. SendClientMessage(playerid, Color:ORAN, "SERVER: "W"You have been muted "ORAN"1"W" minutes for spamming the chat!");
  6698.  
  6699. MuteTimer[playerid] = SetTimerEx("UnMutePlayer", 60_000, true, "i", playerid);
  6700.  
  6701. #if SAVE_MUTE == true
  6702.  
  6703. new pQue[256];
  6704.  
  6705. format(pQue, 256, "SELECT `Key` FROM `Muted` WHERE `IP` = '%s'", GetPlayerIPEx(playerid));
  6706. new DBResult:R1 = DB::Query(_DB, pQue);
  6707.  
  6708. if(R1)
  6709. {
  6710. if(!DB::Valid(R1))
  6711. {
  6712. DB::Free(R1);
  6713. format(pQue, sizeof (pQue), "INSERT INTO `Muted` (`IP`, `Muted`, `Time`, `RealName`) VALUES ('%s', '1', '1', '%s')", GetPlayerIPEx(playerid), Name(playerid));
  6714. DB::Query(_DB, pQue);
  6715. }
  6716. else
  6717. {
  6718. DB::Free(R1);
  6719. format(pQue, sizeof (pQue), "UPDATE `Muted` SET `Muted` = '1', `Time` = '2', `RealName` = '%s' WHERE `IP` = '%s'", Name(playerid), GetPlayerIPEx(playerid));
  6720. DB::Query(_DB, pQue);
  6721. }
  6722. }
  6723. #endif
  6724. return 0;
  6725. }
  6726. }
  6727. }
  6728. if(S_DATA[AntiAD])
  6729. {
  6730. if(!P_DATA[playerid][Muted] || !P_DATA[playerid][MutedAll])
  6731. {
  6732. if(P_DATA[playerid][Vip] > 0)
  6733. {
  6734. if(text[0] == VIP_CHAT_SYMBOL || text[0] == VIP_CHAT_SYMBOL2)
  6735. {
  6736. if(!S_DATA[VipChat] && P_DATA[playerid][Level] < 4)
  6737. return SendError(playerid, "Only the Owner and the Administrator of the server can use the VIP Chat.");
  6738.  
  6739. #if SAVE_IN_LOGS == true
  6740. new
  6741. Date[6];
  6742. getdate(Date[0], Date[1], Date[2]);
  6743. gettime(Date[3], Date[4], Date[5]);
  6744. SaveInLog(VIPCHAT_LOG, "[%d:%d:%d | %d/%d/%d] %s: %s", Date[3], Date[4], Date[5], Date[2], Date[1], Date[0], Name(playerid), text[1]);
  6745. #endif
  6746.  
  6747.  
  6748. new
  6749. iStr[160];
  6750. format(iStr, sizeof (iStr), "#### "GREY"%s:"W" %s", Name(playerid), text[1]);
  6751.  
  6752. foreach(Player, i){
  6753. if(P_DATA[i][Vip] > 0){
  6754. SendClientMessage(i, Color:BLUE, iStr);
  6755. }
  6756. }
  6757. return 0;
  6758. }
  6759. }
  6760. if(P_DATA[playerid][Level] > 0)
  6761. {
  6762. if(text[0] == ADMIN_CHAT_SYMBOL || text[0] == ADMIN_CHAT_SYMBOL2)
  6763. {
  6764. if(!S_DATA[AdminChat] && P_DATA[playerid][Level] < 4)
  6765. return SendError(playerid, "Only the Owner and the Administrator of the server can use the Admin Chat.");
  6766.  
  6767. #if SAVE_IN_LOGS == true
  6768. new
  6769. Date[6];
  6770. getdate(Date[0], Date[1], Date[2]);
  6771. gettime(Date[3], Date[4], Date[5]);
  6772. SaveInLog(ADMINCHAT_LOG, "[%d:%d:%d | %d/%d/%d] %s: %s", Date[3], Date[4], Date[5], Date[2], Date[1], Date[0], Name(playerid), text[1]);
  6773. #endif
  6774.  
  6775.  
  6776. new
  6777. iStr[160];
  6778. format(iStr, sizeof (iStr), "#### "GREY"%s:"W" %s", Name(playerid), text[1]);
  6779.  
  6780. foreach(Player, i){
  6781. if(P_DATA[i][Level] > 0){
  6782. SendClientMessage(i, 0xFF0000FF, iStr);
  6783. }
  6784. }
  6785. return 0;
  6786. }
  6787. }
  6788. if(text[0] != ADMIN_CHAT_SYMBOL || text[0] != ADMIN_CHAT_SYMBOL2)
  6789. {
  6790. if(AntiIP(text) || AntiSite(text))
  6791. {
  6792. P_DATA[playerid][Warns]++;
  6793.  
  6794. SendPlayerMessageToPlayer(playerid, playerid, text);
  6795. FormatMSG(playerid, Color:ORAN, "*** "GREY"You have been warned for advertising! ("ORAN"%d"GREY"/"ORAN""#MAX_P_WARNS""GREY")", P_DATA[playerid][Warns]);
  6796.  
  6797. if(P_DATA[playerid][Warns] >= MAX_P_WARNS)
  6798. {
  6799. SendClientMessage(playerid, Color:ORAN, "*** "GREY"You have been kicked from the server for advertising!");
  6800.  
  6801. foreach(Player, x)
  6802. {
  6803. if(x != playerid)
  6804. {
  6805. FormatMSG(x, Color:ORAN, "*** "GREY"%s has kicked from the server for advertising.", Name(playerid));
  6806. }
  6807. }
  6808. P_DATA[playerid][Warns] = 0;
  6809. KickEx(playerid, .zReason = "Advertising in the chat");
  6810. }
  6811. return 0;
  6812. }
  6813. SendPlayerMessageToAll(playerid, text);
  6814. }
  6815. }
  6816.  
  6817. }else SendPlayerMessageToAll(playerid, text);
  6818.  
  6819. return 0;
  6820. }
  6821.  
  6822. public OnVehicleDeath(vehicleid)
  6823. {
  6824. foreach(Player, InV)
  6825. {
  6826. if(vehicleid == P_DATA[InV][aCar])
  6827. {
  6828. SendError(InV, "Your admin car has been dstroyed!");
  6829. P_DATA[InV][aCar] = -1;
  6830. UpdatePlayer3DTextLabelText(InV, ZaAdminCar[InV], 0xFF0000FF, "Destroyed!\n{000000}--------------\n"W"You can spawn another one!");
  6831. SetTimerEx("dLabel", 4000, false, "i", InV);
  6832. }
  6833. }
  6834. return 1;
  6835. }
  6836. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  6837. {
  6838. if(strlen(GPVSEx(playerid, "Type")))
  6839. {
  6840. if(PRESSED(KEY_FIRE) && !strcmp(GPVSEx(playerid, "Type"), "Unlimited", false))
  6841. {
  6842. if(!IsPlayerInVehicle(playerid, P_DATA[playerid][aCar])) return 0;
  6843.  
  6844. AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
  6845. P_DATA[playerid][NosTimer] = SetTimerEx("UnlimitedNos",17 * 1000, true, "i", playerid);
  6846.  
  6847. }
  6848. else if(RELEASED(KEY_FIRE) && !strcmp(GPVSEx(playerid, "Type"), "Unlimited", false))
  6849. {
  6850. KillTimer(P_DATA[playerid][NosTimer]),
  6851. RemoveVehicleComponent(GetPlayerVehicleID(playerid), 1010);
  6852. }
  6853.  
  6854. if(PRESSED(KEY_FIRE) && strcmp(GPVSEx(playerid, "Type"), "Unlimited", false))
  6855. {
  6856. if(!IsPlayerInVehicle(playerid, P_DATA[playerid][aCar])) return 0;
  6857.  
  6858. AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
  6859. GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~10~g~~h~x~b~~h~ nitro added!", 1500, 3);
  6860. }
  6861. }
  6862. if(P_DATA[playerid][Vip] > 0)
  6863. {
  6864. if(newkeys & KEY_ACTION && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  6865. {
  6866. new Float:V[3];
  6867. GetVehicleVelocity(GetPlayerVehicleID(playerid), V[0], V[1], V[2]);
  6868. if(floatabs(V[0]) < 3 && floatabs(V[1]) < 3 && floatabs(V[2]) < 3)
  6869. {
  6870. SetVehicleVelocity(GetPlayerVehicleID (playerid), V[0] * P_DATA[playerid][bSpeed], V[1] * P_DATA[playerid][bSpeed], V[2] * P_DATA[playerid][bSpeed] );
  6871. }
  6872. }
  6873.  
  6874. if(PRESSED(KEY_LOOK_BEHIND) && P_DATA[playerid][Spin] == 1 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  6875. {
  6876. new Float:P[3];
  6877. GetVehiclePos(GetPlayerVehicleID(playerid), P[0], P[1], P[2] );
  6878. SetVehiclePos(GetPlayerVehicleID(playerid), P[0], P[1], P[2] +1 );
  6879. SetVehicleAngularVelocity(GetPlayerVehicleID(playerid), 0.0, 0.0, 3.0);
  6880. GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~r~WOOSH!", 600, 3);
  6881. }
  6882. }
  6883. return 1;
  6884. }
  6885. CMD:bspeed(PARAMS)
  6886. {
  6887. if(P_DATA[playerid][Vip] > 0)
  6888. {
  6889. if(!P_DATA[playerid][Boost])
  6890. return SendError(playerid, "Speed Boost must be activated first! Activate it from "BLUE"/PCP");
  6891.  
  6892. new Speed;
  6893. if(sscanf(params, "d", Speed))
  6894. {
  6895. SendUsage(playerid, "/bspeed "GREY"<speed> "W"(Speed is betwen 0-30)", "Wil change speed boost!");
  6896. return 1;
  6897. }
  6898. else
  6899. {
  6900. switch(P_DATA[playerid][Vip])
  6901. {
  6902. case (1):
  6903. {
  6904. if(Speed < 0 || Speed > 10)
  6905. return SendError(playerid, "Level 1 VIP Members are allowed only up to "BLUE"10"W".");
  6906. }
  6907. case (2):
  6908. {
  6909. if(Speed < 0 || Speed > 20)
  6910. return SendError(playerid, "Level 2 VIP Members are allowed only up to "BLUE"20"W".");
  6911. }
  6912. case (3):
  6913. {
  6914. if(Speed < 0 || Speed > 30)
  6915. return SendError(playerid, "Level 3 VIP Members are allowed only up to "BLUE"30"W".");
  6916. }
  6917. }
  6918. new Float:Speed2 = Speed;
  6919. P_DATA[playerid][bSpeed] = (Speed) ? (Speed2 / 2.367) : (0.0) ;
  6920. P_DATA[playerid][Boost] = 1;
  6921.  
  6922. if(Speed)FormatMSG(playerid, ~1, "Speed Boost set to "BLUE"%d"W" ("BLUE"%.3f"W")", Speed, P_DATA[playerid][bSpeed]);
  6923. else
  6924. {
  6925. P_DATA[playerid][Boost] = 0;
  6926. P_DATA[playerid][bSpeed] = 0;
  6927. SendClientMessage(playerid, Color:ORAN, "Speed Boost disabled!");
  6928. }
  6929. }
  6930. }
  6931. else
  6932. {
  6933. SendError(playerid, "Only VIP members allowed!");
  6934. }
  6935. return 1;
  6936. }
  6937.  
  6938. FormatList(playerid)
  6939. {
  6940. new Str[1024];
  6941. strcat(Str, ""GREY"Name\n\
  6942. "GREY"Money\n\
  6943. "GREY"Score\n\
  6944. "GREY"Cookies\n\
  6945. "GREY"Respect\n\
  6946. "GREY"Kills\n\
  6947. "GREY"Deaths\n\
  6948. "GREY"Messages\n\
  6949. "GREY"Commands\n\
  6950. "GREY"Fail Commands\n\
  6951. "GREY"Online Time\n\
  6952. "GREY"Admin Level\n\
  6953. "GREY"VIP Level\n\
  6954. "GREY"Change Password", 1024);
  6955.  
  6956. if(playerid != GetPVarInt(playerid, "StatsOf"))
  6957. {
  6958. strcat(Str, "\n"ORAN"Ban Account\n\
  6959. "ORAN"Delete Account", 1024);
  6960. }
  6961.  
  6962. return Str;
  6963. }
  6964.  
  6965. FormatInside(playerid, Player, what[] = "z", extra[] = " ", zelse[] =" ")
  6966. {
  6967. new Str[256];
  6968. if(strcmp(what, "z", true))
  6969. {
  6970. if(Player == playerid){
  6971. format(Str, sizeof (Str), ""GREY"Changing "ORAN"your"GREY" %s\n\n"ORAN"%s", what, extra);}
  6972. else{
  6973. format(Str, sizeof (Str), ""GREY"Changing "ORAN"%s"GREY"'s %s\n\n"ORAN"%s", Name(Player), what, extra);}
  6974. }
  6975. else
  6976. format(Str, sizeof (Str), ""GREY"%s "ORAN"%s"GREY"'s %s\n\n"ORAN"Are you sure you want to %s this account?", zelse, Name(Player), extra, zelse);
  6977.  
  6978. return Str;
  6979. }
  6980. NameExist(name[])
  6981. {
  6982. foreach(Player, i)
  6983. {
  6984. if(!strcmp(name, Name(i), false)) return 1;
  6985. }
  6986. return 0;
  6987. }
  6988. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  6989. {
  6990. if(playerid != clickedplayerid)
  6991. {
  6992. ShowPlayerDialog(playerid, Dialog:CLICK, LIST, Name(clickedplayerid), ""BLUE"Send Personal Message\n\
  6993. "BLUE"Give Respect\n\
  6994. "BLUE"Give Money\n\
  6995. "BLUE"See Stats\n\
  6996. "ORAN"Report", "Select", "Exit");
  6997. SetPVarInt(playerid, "ClickedTO", clickedplayerid);
  6998. }else SendError(playerid, "Please select someone else other than you!");
  6999. }
  7000. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  7001. {
  7002. new Query[500];
  7003.  
  7004. if(response)
  7005. {
  7006. iDialog<PCP>
  7007. {
  7008. switch(listitem)
  7009. {
  7010. case 1:
  7011. {
  7012. if(S_DATA[AutoLogin])
  7013. {
  7014. P_DATA[playerid][pAuto] = 1;
  7015. SPD(playerid, Dialog:PCPBack, BOX, ""W"Auto-Login", ""BLUE"Auto-Login\n\n"W"This feature has been enabled!", "Back", "");
  7016. }
  7017. else
  7018. {
  7019. P_DATA[playerid][pAuto] = 0;
  7020. SPD(playerid, Dialog:PCPBack, BOX, ""W"Auto-Login", ""BLUE"Auto-Login\n\n"W"This feature is not available!!", "Back", "");
  7021. }
  7022. }
  7023. case 2:
  7024. {
  7025. P_DATA[playerid][BAPMs] = 1;
  7026. SPD(playerid, Dialog:PCPBack, BOX, ""W"Block PM", ""BLUE"Block Personal Messages\n\n"W"This feature has been enabled!", "Back", "");
  7027. }
  7028. case 3:
  7029. {
  7030. cmd_stats(playerid,"");
  7031. }
  7032. case 4: cmd_pcp(playerid, "");
  7033. case 5:
  7034. {
  7035. P_DATA[playerid][God] = 1;
  7036. SPD(playerid, Dialog:PCPBack, BOX, ""W"Godlike", ""BLUE"Godlike\n\n"W"This feature has been enabled!\nYou won't loose health anymore.", "Back", "");
  7037. }
  7038. case 6:
  7039. {
  7040. P_DATA[playerid][CarGod] = 1;
  7041. SPD(playerid, Dialog:PCPBack, BOX, ""W"Vehicle God", ""BLUE"Vehicle God\n\n"W"This feature has been enabled!\nYour vehicle won't be destroyed!", "Back", "");
  7042. }
  7043. case 7:
  7044. {
  7045. P_DATA[playerid][Boost] = 1;
  7046. SPD(playerid, Dialog:PCPBack, BOX, ""W"Vehicle Boost", ""BLUE"Vehicle Boost\n\n"W"This feature has been enabled!\nPress "BLUE"Ctrl"W" to boost!\nUse "BLUE"/bspeed <value>"W" to change speed boost!", "Back", "");
  7047. }
  7048. case 8:
  7049. {
  7050. P_DATA[playerid][VIPTag] = 1;
  7051. SPD(playerid, Dialog:PCPBack, BOX, ""W"Wear VIP Tag", ""BLUE"Wear VIP Tag\n\n"W"This feature has been enabled!\nYou have a "BLUE"VIP Member"W" label above head.", "Back", "");
  7052.  
  7053. Delete3DTextLabel(P_DATA[playerid][Tag3D]);
  7054. P_DATA[playerid][Tag3D] = Create3DTextLabel("VIP Member", Color:BLUE, 0.0, 0.0, 0.0, 90.0, 0, 1);
  7055. Attach3DTextLabelToPlayer(P_DATA[playerid][Tag3D], playerid, 0.0, 0.0, 1.2);
  7056. }
  7057. case 9: cmd_pcp(playerid, "");
  7058. case 10:
  7059. {
  7060. P_DATA[playerid][Spin] = 1;
  7061. SPD(playerid, Dialog:PCPBack, BOX, ""W"Vehicle Spin", ""BLUE"Vehicle Spin\n\n"W"This feature has been enabled!\nPress "BLUE"2(Submission Key)"W" to spin!", "Back", "");
  7062. }
  7063. case 11:
  7064. {
  7065. for(new i = 0; i < 5; i++)
  7066. if(IsPlayerAttachedObjectSlotUsed(playerid, i))
  7067. RemovePlayerAttachedObject(playerid, i);
  7068.  
  7069. P_DATA[playerid][Incred] = 1;
  7070. SetPlayerAttachedObject(playerid, 0, 18693, 5, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
  7071. SetPlayerAttachedObject(playerid, 1, 18693, 6, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
  7072. SetPlayerAttachedObject(playerid, 2, 18703, 6, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
  7073. SetPlayerAttachedObject(playerid, 3, 18703, 5, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
  7074. SetPlayerAttachedObject(playerid, 4, 18965, 2, 0.111052, 0.021643, -0.000846, 92.280899, 92.752510, 358.071044, 1.200000, 1.283168, 1.200000 );
  7075.  
  7076. SPD(playerid, Dialog:PCPBack, BOX, ""W"Incredible", ""BLUE"Incredible\n\n"W"This feature has been enabled!\nCheck your character!", "Back", "");
  7077. }
  7078. case 12: cmd_pcp(playerid, "");
  7079. case 13:
  7080. {
  7081. SPD(playerid, Dialog:PCPShout, INPUT, ""W"Shout to the server!", ""W"Insert the text you want to shout:", "Insert", "Back");
  7082. }
  7083. }
  7084. }
  7085. }
  7086. else
  7087. {
  7088. iDialog<PCP>
  7089. {
  7090. switch(listitem)
  7091. {
  7092. case 1:
  7093. {
  7094. if(S_DATA[AutoLogin])
  7095. {
  7096. P_DATA[playerid][pAuto] = 0;
  7097. SPD(playerid, Dialog:PCPBack, BOX, ""W"Auto-Login", ""BLUE"Auto-Login\n\n"W"This feature has been disabled!", "Back", "");
  7098. }
  7099. else
  7100. {
  7101. P_DATA[playerid][pAuto] = 0;
  7102. SPD(playerid, Dialog:PCPBack, BOX, ""W"Auto-Login", ""BLUE"Auto-Login\n\n"W"This feature is not available!!", "Back", "");
  7103. }
  7104. }
  7105. case 2:
  7106. {
  7107. P_DATA[playerid][BAPMs] = 0;
  7108. SPD(playerid, Dialog:PCPBack, BOX, ""W"Block PM", ""BLUE"Block Personal Messages\n\n"W"This feature has been disabled!", "Back", "");
  7109. }
  7110. case 3:
  7111. {
  7112. cmd_stats(playerid,"");
  7113. }
  7114. case 4: cmd_pcp(playerid, "");
  7115. case 5:
  7116. {
  7117. P_DATA[playerid][God] = 0;
  7118. SPD(playerid, Dialog:PCPBack, BOX, ""W"Godlike", ""BLUE"Godlike\n\n"W"This feature has been disabled!\nYou will loose health.", "Back", "");
  7119. }
  7120. case 6:
  7121. {
  7122. P_DATA[playerid][CarGod] = 0;
  7123. SPD(playerid, Dialog:PCPBack, BOX, ""W"Vehicle God", ""BLUE"Vehicle God\n\n"W"This feature has been disabled!\nYour vehicle can be destroyed!", "Back", "");
  7124. }
  7125. case 7:
  7126. {
  7127. P_DATA[playerid][Boost] = 0;
  7128. SPD(playerid, Dialog:PCPBack, BOX, ""W"Vehicle Boost", ""BLUE"Vehicle Boost\n\n"W"This feature has been disabled!", "Back", "");
  7129. }
  7130. case 8:
  7131. {
  7132. P_DATA[playerid][VIPTag] = 0;
  7133. SPD(playerid, Dialog:PCPBack, BOX, ""W"Wear VIP Tag", ""BLUE"Wear VIP Tag\n\n"W"This feature has been disabled!\nThe label has been deleted.", "Back", "");
  7134.  
  7135. Delete3DTextLabel(P_DATA[playerid][Tag3D]);
  7136. }
  7137. case 9: cmd_pcp(playerid, "");
  7138. case 10:
  7139. {
  7140. P_DATA[playerid][Spin] = 0;
  7141. SPD(playerid, Dialog:PCPBack, BOX, ""W"Vehicle Spin", ""BLUE"Vehicle Spin\n\n"W"This feature has been disabled!", "Back", "");
  7142. }
  7143. case 11:
  7144. {
  7145. for(new i = 0; i < 5; i++)
  7146. if(IsPlayerAttachedObjectSlotUsed(playerid, i))
  7147. RemovePlayerAttachedObject(playerid, i);
  7148.  
  7149. P_DATA[playerid][Incred] = 0;
  7150.  
  7151. SPD(playerid, Dialog:PCPBack, BOX, ""W"Incredible", ""BLUE"Incredible\n\n"W"This feature has been enabled!\nCheck your character!", "Back", "");
  7152. }
  7153. case 12: cmd_pcp(playerid, "");
  7154. case 13:
  7155. {
  7156. SPD(playerid, Dialog:PCPShout, INPUT, ""W"Shout to the server!", ""W"Insert the text you want to shout:", "Insert", "Back");
  7157. }
  7158. }
  7159. }
  7160. }
  7161.  
  7162. iDialog<PCPBack>
  7163. {
  7164. cmd_pcp(playerid, "");
  7165. }
  7166. iDialog<PCPShout>
  7167. {
  7168. if(response)
  7169. {
  7170. if(strlen(inputtext))
  7171. {
  7172. SendClientMessageToAll(Color:BLUE, inputtext);
  7173. }
  7174. else SPD(playerid, Dialog:PCPShout, INPUT, ""W"Shout to the server!", ""W"Insert the text you want to shout:", "Insert", "Back");
  7175. }
  7176. else cmd_pcp(playerid, "");
  7177. }
  7178. iDialog<CLICK_REPORT>
  7179. {
  7180. if(!IsPlayerConnected(GetPVarInt(playerid, "ClickedTO")))
  7181. {
  7182. SendError(playerid, "Player is no longer connected to the server!");
  7183. DeletePVar(playerid, "ClickedTO");
  7184. return 1;
  7185. }
  7186. if(!response)
  7187. return ShowPlayerDialog(playerid, Dialog:CLICK, LIST, Name(GetPVarInt(playerid, "ClickedTO")), ""BLUE"Send Personal Message\n\
  7188. "BLUE"Give Respect\n\
  7189. "BLUE"Give Money\n\
  7190. "BLUE"See Stats\n\
  7191. "ORAN"Report", "Select", "Exit");
  7192. new
  7193. Report[256];
  7194.  
  7195. if(sscanf(inputtext, "s[256]", Report) || !strlen(Report))
  7196. return SendError(playerid, "Please insert a reason!"),
  7197. OnDialogResponse(playerid, Dialog:CLICK, 1, 4, "");
  7198. else
  7199. {
  7200. if(strlen(Report) < 10)
  7201. return SendError(playerid, "The reason must be at least "BLUE"10"GREY" characters long!"),
  7202. OnDialogResponse(playerid, Dialog:CLICK, 1, 4, "");
  7203. new
  7204. Player = GetPVarInt(playerid, "ClickedTO"),
  7205. Str[256];
  7206.  
  7207. format(Str, sizeof(Str), ""W"You reported player:\n"BLUE"%s"W" ID: "BLUE"%d\n\n"ORAN"Reason: "W"%s\n\n\n"GREY"* A log of this report has been created.", Name(Player), Player, Report);
  7208. SPD(playerid, Dialog:Empty, BOX, ""W"Player reported!", Str, "Close", "");
  7209.  
  7210. foreach(Player, i)
  7211. {
  7212. if(P_DATA[i][Level] > 2)
  7213. {
  7214. if(i != playerid)
  7215. {
  7216. FormatMSG(i, Color:BLUE, "REPORT: "GREY"Player "ORAN"%s[%i]"GREY" reported "ORAN"%s[%i]"GREY"", Name(playerid), playerid, Name(Player), Player);
  7217. FormatMSG(i, Color:GREE, "MESSAGE:"GREY" %s", Report);
  7218. }
  7219. }
  7220. }
  7221.  
  7222. format(Str, sizeof(Str), "\r\n---------------------------------------------------------\r\n\
  7223. Reporter: %s\r\n\
  7224. Reported: %s\r\n\
  7225. Message: %s\r\n\
  7226. Date: %s\r\n\
  7227. ---------------------------------------------------------\r\n",
  7228. Name(playerid),
  7229. Name(Player),
  7230. Report,
  7231. zDate());
  7232. new
  7233. File: ReportLog = fopen(REPORT_LOG, io_append);
  7234.  
  7235. if(ReportLog)
  7236. {
  7237. fwrite(ReportLog, Str);
  7238. fclose(ReportLog);
  7239. }
  7240. }
  7241. }
  7242.  
  7243. iDialog<CLICK_MONEY>
  7244. {
  7245. if(!IsPlayerConnected(GetPVarInt(playerid, "ClickedTO")))
  7246. {
  7247. SendError(playerid, "Player is no longer connected to the server!");
  7248. DeletePVar(playerid, "ClickedTO");
  7249. return 1;
  7250. }
  7251. if(!response)
  7252. return ShowPlayerDialog(playerid, Dialog:CLICK, LIST, Name(GetPVarInt(playerid, "ClickedTO")), ""BLUE"Send Personal Message\n\
  7253. "BLUE"Give Respect\n\
  7254. "BLUE"Give Money\n\
  7255. "BLUE"See Stats\n\
  7256. "ORAN"Report", "Select", "Exit");
  7257. new
  7258. pMoney;
  7259. if(sscanf(inputtext, "i", pMoney) || !pMoney)
  7260. return SendError(playerid, "Please insert a correct value!"),
  7261. OnDialogResponse(playerid, Dialog:CLICK, 1, 2, "");
  7262. else
  7263. {
  7264. new
  7265. Player = GetPVarInt(playerid, "ClickedTO"),
  7266. Str[256];
  7267.  
  7268. if(GetPlayerMoney(playerid) < pMoney)
  7269. return SendError(playerid, "Not enough money to send!"),
  7270. OnDialogResponse(playerid, Dialog:CLICK, 1, 2, "");
  7271.  
  7272. GivePlayerMoney(Player, pMoney);
  7273. GivePlayerMoney(playerid, -pMoney);
  7274.  
  7275. format(Str, sizeof(Str), ""W"You gave a "GREE"$%d"W" to:\n"BLUE"%s"W" ID: "BLUE"%d", pMoney, Name(Player), Player);
  7276. SPD(playerid, Dialog:Empty, BOX, ""W"Money sent!", Str, "Close", "");
  7277. FormatMSG(Player, Color:BLUE, "***"GREY" You received "GREE"$%d"GREY" from player "BLUE"%s[%i]", pMoney, Name(playerid), playerid);
  7278. }
  7279. }
  7280. iDialog<CLICK_RP>
  7281. {
  7282. if(!IsPlayerConnected(GetPVarInt(playerid, "ClickedTO")))
  7283. {
  7284. SendError(playerid, "Player is no longer connected to the server!");
  7285. DeletePVar(playerid, "ClickedTO");
  7286. return 1;
  7287. }
  7288. if(!response)
  7289. return ShowPlayerDialog(playerid, Dialog:CLICK, LIST, Name(GetPVarInt(playerid, "ClickedTO")), ""BLUE"Send Personal Message\n\
  7290. "BLUE"Give Respect\n\
  7291. "BLUE"Give Money\n\
  7292. "BLUE"See Stats\n\
  7293. "ORAN"Report", "Select", "Exit");
  7294. new
  7295. Player = GetPVarInt(playerid, "ClickedTO"),
  7296. Str[256],
  7297. Time[5];
  7298. switch(listitem)
  7299. {
  7300. case (0):
  7301. {
  7302. if(P_DATA[playerid][Vip] != 3)
  7303. {
  7304. format(Query, 256, "SELECT `Key` FROM `Positive` WHERE `Name` = '%s'", Name(playerid));
  7305.  
  7306. new
  7307. DBResult:R2 = DB::Query(_DB, Query);
  7308.  
  7309. gettime(Time[0], Time[1]);
  7310. getdate(.day = Time[2]);
  7311.  
  7312. if(R2)
  7313. {
  7314. if(DB::Valid(R2))
  7315. {
  7316. new
  7317. Field[64],
  7318. T2[3];
  7319.  
  7320. DB::GetField(R2, "Expiration", Field, sizeof (Field));
  7321. DB::Free(R2);
  7322. if(!isnull(Field))
  7323. {
  7324. sscanf(Field, "p<|>iii", Time[2], Time[0], Time[1]);
  7325.  
  7326. gettime(T2[0], T2[1]);
  7327. getdate(.day = T2[2]);
  7328.  
  7329. if(Time[0] == 0) Time[0] = 24;
  7330. if(T2[2] == Time[2])
  7331. {
  7332. if(T2[0] == Time[0])
  7333. {
  7334. if(T2[1] < Time[1])
  7335. {
  7336. SendError(playerid, "You are allowed to give only one "GREE"+"GREY" respect per hour!");
  7337. FormatMSG(playerid, Color:GREY, "You can repeat the process after "BLUE"%d"GREY":"BLUE"%d "GREY"!", Time[0], Time[1]);
  7338. return 1;
  7339. }
  7340. }
  7341. else if(T2[0] < Time[0])
  7342. {
  7343. SendError(playerid, "You are allowed to give only one "GREE"+"GREY" respect per hour!");
  7344. FormatMSG(playerid, Color:GREY, "You can repeat the process after "BLUE"%d"GREY":"BLUE"%d "GREY"!", Time[0], Time[1]);
  7345. return 1;
  7346. }
  7347. }
  7348. }
  7349.  
  7350. format(Query, sizeof (Query), "UPDATE `Positive` SET `Expiration` = '%d|%d|%d' WHERE `Name` = '%s'", Time[2], (Time[0] == 23) ? (0) : (Time[0] + 1), Time[1], Name(playerid));
  7351. DB::Query(_DB, Query);
  7352. }
  7353. else
  7354. {
  7355. DB::Free(R2);
  7356. format(Query, sizeof (Query), "INSERT INTO `Positive` (`Name`, `Expiration`) VALUES ('%s', '%d|%d|%d')", Name(playerid), Time[2], (Time[0] == 23) ? (0) : (Time[0] + 1), Time[1]);
  7357. DB::Query(_DB, Query);
  7358. }
  7359. }
  7360.  
  7361. format(Str, sizeof (Str), ""W"You gave a "GREE"Positive Respect"W" to:\n"BLUE"%s"W" ID: "BLUE"%d\n\n"GREY"You must wait an hour before giving\nany other "GREE"+"GREY" respect to anybody!", Name(Player), Player);
  7362. }else format(Str, sizeof (Str), ""W"You gave a "GREE"Positive Respect"W" to:\n"BLUE"%s"W" ID: "BLUE"%d", Name(Player), Player);
  7363.  
  7364. P_DATA[Player][Positive] += 1;
  7365. SetPVarInt(Player, "0_Positive", P_DATA[Player][Positive]);
  7366. FormatMSG(Player, Color:ORAN, "*** "GREY"You received a "GREE"+1"GREY" respect from "BLUE"%s[%i]", Name(playerid), playerid);
  7367.  
  7368. SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Respect given", Str, "Close", "");
  7369. }
  7370. case (1):
  7371. {
  7372. if(P_DATA[playerid][Vip] != 3)
  7373. {
  7374. format(Query, 256, "SELECT `Key` FROM `Negative` WHERE `Name` = '%s'", Name(playerid));
  7375.  
  7376. new
  7377. DBResult:R2 = DB::Query(_DB, Query);
  7378.  
  7379. gettime(Time[0], Time[1]);
  7380. getdate(.day = Time[2]);
  7381.  
  7382. if(R2)
  7383. {
  7384. if(DB::Valid(R2))
  7385. {
  7386. new
  7387. Field[64],
  7388. T2[3];
  7389.  
  7390. DB::GetField(R2, "Expiration", Field, sizeof (Field));
  7391. DB::Free(R2);
  7392. if(!isnull(Field))
  7393. {
  7394. sscanf(Field, "p<|>iii", Time[2], Time[0], Time[1]);
  7395.  
  7396. gettime(T2[0], T2[1]);
  7397. getdate(.day = T2[2]);
  7398.  
  7399. if(Time[0] == 0) Time[0] = 24;
  7400. if(T2[2] == Time[2])
  7401. {
  7402. if(T2[0] == Time[0])
  7403. {
  7404. if(T2[1] < Time[1])
  7405. {
  7406. SendError(playerid, "You are allowed to give only one "ORAN"-"GREY" respect per hour!");
  7407. FormatMSG(playerid, Color:GREY, "You can repeat the process after "BLUE"%d"GREY":"BLUE"%d "GREY"!", Time[0], Time[1]);
  7408. return 1;
  7409. }
  7410. }
  7411. else if(T2[0] < Time[0])
  7412. {
  7413. SendError(playerid, "You are allowed to give only one "ORAN"-"GREY" respect per hour!");
  7414. FormatMSG(playerid, Color:GREY, "You can repeat the process after "BLUE"%d"GREY":"BLUE"%d "GREY"!", Time[0], Time[1]);
  7415. return 1;
  7416. }
  7417. }
  7418. }
  7419.  
  7420. format(Query, sizeof (Query), "UPDATE `Negative` SET `Expiration` = '%d|%d|%d' WHERE `Name` = '%s'", Time[2], (Time[0] == 23) ? (0) : (Time[0] + 1), Time[1], Name(playerid));
  7421. DB::Query(_DB, Query);
  7422. }
  7423. else
  7424. {
  7425. DB::Free(R2);
  7426. format(Query, sizeof (Query), "INSERT INTO `Negative` (`Name`, `Expiration`) VALUES ('%s', '%d|%d|%d')", Name(playerid), Time[2], (Time[0] == 23) ? (0) : (Time[0] + 1), Time[1]);
  7427. DB::Query(_DB, Query);
  7428. }
  7429. }
  7430. format(Str, sizeof (Str), ""W"You gave a "ORAN"Negative Respect"W" to:\n"BLUE"%s"W" ID: "BLUE"%d\n\n"GREY"You must wait an hour before giving\nany other "ORAN"-"GREY" respect to anybody!", Name(Player), Player);
  7431. }else format(Str, sizeof (Str), ""W"You gave a "ORAN"Negative Respect"W" to:\n"BLUE"%s"W" ID: "BLUE"%d", Name(Player), Player);
  7432.  
  7433. P_DATA[Player][Negative] += 1;
  7434. SetPVarInt(Player, "0_Negative", P_DATA[Player][Negative]);
  7435.  
  7436. FormatMSG(Player, Color:ORAN, "*** "GREY"You received a "ORAN"-1"GREY" respect from "BLUE"%s[%i]", Name(playerid), playerid);
  7437. SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Respect given", Str, "Close", "");
  7438. }
  7439. }
  7440. }
  7441. iDialog<CLICK_PM>
  7442. {
  7443. if(!response)
  7444. return ShowPlayerDialog(playerid, Dialog:CLICK, LIST, Name(GetPVarInt(playerid, "ClickedTO")), ""BLUE"Send Personal Message\n\
  7445. "BLUE"Give Respect\n\
  7446. "BLUE"Give Money\n\
  7447. "BLUE"See Stats\n\
  7448. "ORAN"Report", "Select", "Exit");
  7449.  
  7450. if(P_DATA[playerid][Muted])
  7451. return ShowPlayerDialog(playerid, Dialog:CLICK, LIST, Name(GetPVarInt(playerid, "ClickedTO")), ""BLUE"Send Personal Message\n\
  7452. "BLUE"Give Respect\n\
  7453. "BLUE"Give Money\n\
  7454. "BLUE"See Stats\n\
  7455. "ORAN"Report", "Select", "Exit"),
  7456. SendError(playerid, "You are still muted! Check with "ORAN"/mutecheck"GREY" to see when it will be lifted!");
  7457.  
  7458. if(!IsPlayerConnected(GetPVarInt(playerid, "ClickedTO")))
  7459. {
  7460. SendError(playerid, "Player is no longer connected to the server!");
  7461. DeletePVar(playerid, "ClickedTO");
  7462. return 1;
  7463. }
  7464. new
  7465. Message[140];
  7466. if(sscanf(inputtext, "s[140]", Message))
  7467. return OnDialogResponse(playerid, Dialog:CLICK, 1, 0, ""),
  7468. SendError(playerid, "Please enter a message to send!");
  7469. else
  7470. {
  7471. if(strlen(Message) < 5)
  7472. return OnDialogResponse(playerid, Dialog:CLICK, 1, 0, ""),
  7473. SendError(playerid, "Message must be at least "BLUE"5"GREY" characters long.");
  7474.  
  7475. new
  7476. Player = GetPVarInt(playerid, "ClickedTO");
  7477.  
  7478. FormatMSG(Player, Color:GREY, "From "BLUE"%s[%i]"W": %s", Name(playerid), playerid, Message);
  7479. FormatMSG(playerid, Color:GREY, "PM Sent to "BLUE"%s[%i]"W": %s", Name(Player), Player, Message);
  7480.  
  7481. if(S_DATA[ReadPM])
  7482. {
  7483. SendAdminCMD(playerid, "PM Detected: "BLUE"%s[%i] "GREY"to"BLUE" %s[%i]", Name(playerid), playerid, Name(Player), Player);
  7484. SendAdminCMD(playerid, "Message: "BLUE"%s", Message);
  7485. }
  7486. }
  7487. }
  7488.  
  7489. iDialog<CLICK>
  7490. {
  7491. if(!response)
  7492. return DeletePVar(playerid, "ClickedTO"),
  7493. false;
  7494.  
  7495. if(!IsPlayerConnected(GetPVarInt(playerid, "ClickedTO")))
  7496. {
  7497. SendError(playerid, "Player is no longer connected to the server!");
  7498. DeletePVar(playerid, "ClickedTO");
  7499. return 1;
  7500. }
  7501. switch(listitem)
  7502. {
  7503. case (0):
  7504. {
  7505. new
  7506. Player = GetPVarInt(playerid, "ClickedTO"),
  7507. Str[129];
  7508.  
  7509. format(Str, 129, ""W"Send a personal message to:\n"BLUE"%s"W" ID: "BLUE"%d\n\n\n"GREY"Please insert the message:", Name(Player), Player);
  7510.  
  7511. SPD(playerid, Dialog:CLICK_PM, INPUT, "{FFFFFF}Send a Personal Message", Str, "Send", "Back");
  7512. }
  7513. case (1): SPD(playerid, Dialog:CLICK_RP, LIST, "{FFFFFF}Select Rspect type", ""GREE"Positive\n"ORAN"Negative", "Select", "Back");
  7514. case (2):
  7515. {
  7516. new
  7517. Player = GetPVarInt(playerid, "ClickedTO"),
  7518. Str[129];
  7519.  
  7520. format(Str, 129, ""W"Sending money to:\n"BLUE"%s"W" ID: "BLUE"%d\n\n\n"GREY"Please insert the amount of money:", Name(Player), Player);
  7521.  
  7522. SPD(playerid, Dialog:CLICK_MONEY, INPUT, "{FFFFFF}Send money", Str, "Send", "Back");
  7523. }
  7524. case (3):
  7525. {
  7526. format(WhosStats, sizeof (WhosStats), ""ORAN"%s{FFFFFF}'s stats", Name(GetPVarInt(playerid, "ClickedTO")));
  7527. FormatStats(GetPVarInt(playerid, "ClickedTO"));
  7528. }
  7529. case (4):
  7530. {
  7531. new
  7532. Player = GetPVarInt(playerid, "ClickedTO"),
  7533. Str[129];
  7534.  
  7535. format(Str, 129, ""W"Reporting player:\n"BLUE"%s"W" ID: "BLUE"%d\n\n\n"GREY"Please insert the reason for this report:", Name(Player), Player);
  7536.  
  7537. SPD(playerid, Dialog:CLICK_REPORT, INPUT, "{FFFFFF}Reporting player", Str, "Send", "Back");
  7538. }
  7539. }
  7540. }
  7541.  
  7542. iDialog<TOP>
  7543. {
  7544. return cmd_top(playerid, "");
  7545. }
  7546. iDialog<TOP_RESPECT>
  7547. {
  7548.  
  7549. if(!response) cmd_top(playerid, "");
  7550. else
  7551. {
  7552. switch(listitem)
  7553. {
  7554. case 0: ShowTopStats(playerid, "Positive", "Respected Players");
  7555. case 1: ShowTopStats(playerid, "Negative", "Disrespected Players");
  7556. }
  7557. }
  7558. }
  7559. iDialog<TOP_SELECT>
  7560. {
  7561. if(!response) return 1;
  7562. else
  7563. {
  7564. switch(listitem)
  7565. {
  7566. case 0: ShowTopStats(playerid, "Kills", "Killers");
  7567. case 1: ShowTopStats(playerid, "Deaths", "Deaths");
  7568. case 2: ShowTopStats(playerid, "Rank", "Ranked");
  7569. case 3: SPD(playerid, Dialog:TOP_RESPECT, LIST, "{FFFFFF}Select type", ""W"Positive\n"W"Negative", "Select", "Back");
  7570. case 4: ShowTopStats(playerid, "Hours", "Hours");
  7571. case 5:
  7572. {
  7573. new Speed = GetTickCount(),
  7574. DialString[3_0_0_0],
  7575. String[2][128],
  7576. sQuery[2][256],
  7577. DBResult:Result1;
  7578.  
  7579. format(sQuery[0], 256, "SELECT `Name` FROM `Top` ORDER BY (`Ratio` * 1) DESC limit %d", MAX_TOP_LIMIT);
  7580.  
  7581. Result1 = DB::Query(_DB, sQuery[0]);
  7582.  
  7583. format(DialString, sizeof (DialString), "{FFFFFF}Server top "ORAN" Kills/Deaths ratio\n\n\n"W"Pos. Player = Ratio");
  7584. for (new Qr; Qr < DB::Valid(Result1); Qr++)
  7585. {
  7586. db_get_field(Result1, 0, String[0], 128);
  7587.  
  7588. format(sQuery[1], 256, "SELECT `Ratio` FROM `Top` WHERE `Name` = '%s'", String[0]);
  7589.  
  7590. new DBResult:Result2 = DB::Query(_DB, sQuery[1]);
  7591. db_get_field(Result2, 0, String[1], 128);
  7592.  
  7593. format(DialString, sizeof (DialString), "%s\n"BLUE"%d."GREY" %s "W": %s", DialString, Qr + 1, String[0], String[1]);
  7594.  
  7595. db_next_row(Result1);
  7596. DB::Free(Result2);
  7597. }
  7598. DB::Free(Result1);
  7599. format(DialString, sizeof (DialString), "%s\n\n"W"Top list generated in "ORAN"%d "W"ms.", DialString, GetTickCount() - Speed);
  7600. SPD(playerid, Dialog:TOP, BOX, ""W"TOP PLAYERS", DialString, "Close", "");
  7601. }
  7602. }
  7603. }
  7604. }
  7605.  
  7606. switch(dialogid)
  7607. {
  7608. CaseDialog<NAME>
  7609. {
  7610. if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  7611.  
  7612. new
  7613. NewName[MAX_PLAYER_NAME];
  7614. if(sscanf(inputtext, "s["#MAX_PLAYER_NAME"]", NewName))
  7615. {
  7616. OnDialogResponse(playerid, Dialog:SetStatsTrue, 1, NAME, "");
  7617. return 1;
  7618. }
  7619. else
  7620. {
  7621. if(strlen(NewName) > MAX_PLAYER_NAME || strlen(NewName) < 5)
  7622. return SendError(playerid, "Invalid name length! Max: "ORAN""#MAX_PLAYER_NAME""GREY" Min: "ORAN"5"),
  7623. OnDialogResponse(playerid, Dialog:SetStatsTrue, 1, NAME, "");
  7624.  
  7625. new
  7626. Player = GetPVarInt(playerid, "StatsOf");
  7627.  
  7628. if(Player == 0xFFFF)
  7629. return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
  7630.  
  7631. if(NameExist(NewName))
  7632. return SendError(playerid, "The name entered is already used by someone else!"),
  7633. OnDialogResponse(playerid, Dialog:SetStatsTrue, 1, NAME, "");
  7634.  
  7635. if(Player != playerid)
  7636. {
  7637. FormatMSG(playerid, Color:GREY, "You changed the name of "ORAN"%s"GREY" to "ORAN"%s"GREY"", Name(Player), NewName);
  7638. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" changed your name to "ORAN"%s"GREY"", Name(playerid), playerid, NewName);
  7639. }
  7640. else{FormatMSG(playerid, Color:GREY, "You changed your name to "ORAN"%s"GREY" ", NewName);SendClientMessage(playerid, Color:ORAN, "WARNING: "GREY"Stats saving won't work properly!");}
  7641. SetPlayerName(Player, NewName);
  7642.  
  7643. OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  7644. }
  7645. }
  7646. CaseDialog<MONEY>
  7647. {
  7648. if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  7649.  
  7650. if(sscanf(inputtext, "d", inputtext[0]))
  7651. {
  7652. OnDialogResponse(playerid, Dialog:SetStatsTrue, 1, MONEY, "");
  7653. return 1;
  7654. }
  7655. else
  7656. {
  7657. new
  7658. Player = GetPVarInt(playerid, "StatsOf");
  7659.  
  7660. if(Player == 0xFFFF)
  7661. return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
  7662.  
  7663. ResetPlayerMoney(Player), GivePlayerMoney(Player, inputtext[0]);
  7664. OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  7665.  
  7666. if(Player != playerid)
  7667. {
  7668. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s money to "ORAN"$%d"GREY"", Name(Player), inputtext[0]);
  7669. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your money to "ORAN"$%d"GREY"", Name(playerid), playerid, inputtext[0]);
  7670. }
  7671. else
  7672. FormatMSG(playerid, Color:GREY, "You set your money to "ORAN"$%d"GREY" ", inputtext[0]);
  7673.  
  7674. }
  7675. }
  7676. CaseDialog<SCORE>
  7677. {
  7678. if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  7679.  
  7680. if(sscanf(inputtext, "d", inputtext[0]))
  7681. {
  7682. OnDialogResponse(playerid, Dialog:SetStatsTrue, 1, SCORE, "");
  7683. return 1;
  7684. }
  7685. else
  7686. {
  7687. new
  7688. Player = GetPVarInt(playerid, "StatsOf");
  7689.  
  7690. if(Player == 0xFFFF)
  7691. return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
  7692.  
  7693. SetPlayerScore(Player, inputtext[0]);
  7694. OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  7695.  
  7696. if(Player != playerid)
  7697. {
  7698. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s score to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
  7699. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your score to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
  7700. }
  7701. else
  7702. FormatMSG(playerid, Color:GREY, "You set your score to "ORAN"%d"GREY" ", inputtext[0]);
  7703.  
  7704. }
  7705. }
  7706. CaseDialog<COOKIES>
  7707. {
  7708. if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  7709.  
  7710. if(sscanf(inputtext, "d", inputtext[0]))
  7711. {
  7712. OnDialogResponse(playerid, Dialog:SetStatsTrue, 1, COOKIES, "");
  7713. return 1;
  7714. }
  7715. else
  7716. {
  7717. new
  7718. Player = GetPVarInt(playerid, "StatsOf");
  7719.  
  7720. if(Player == 0xFFFF)
  7721. return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
  7722.  
  7723. SetPVarInt(Player, "0_Cookies", inputtext[0]);
  7724. P_DATA[Player][Cookies] = inputtext[0];
  7725.  
  7726. OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  7727.  
  7728. if(Player != playerid)
  7729. {
  7730. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s cookies to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
  7731. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your cookies to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
  7732. }
  7733. else
  7734. FormatMSG(playerid, Color:GREY, "You set your cookies to "ORAN"%d"GREY" ", inputtext[0]);
  7735.  
  7736. }
  7737. }
  7738. CaseDialog<RESPECT>
  7739. {
  7740. if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  7741.  
  7742. new
  7743. _2DS[2][129],
  7744. _Dialog,
  7745. Player = GetPVarInt(playerid, "StatsOf");
  7746.  
  7747. if(Player == 0xFFFF)
  7748. return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
  7749.  
  7750. switch(listitem)
  7751. {
  7752. case 0:{ if(Player != playerid)format(_2DS[0], 129, "Changing "ORAN"%s"GREY"'s Positive Respect\nPlease insert your respect value:", Name(Player));
  7753. else _2DS[0] = "Changing "ORAN"your"GREY"'s Positive Respect\nPlease insert your respect value:";
  7754. _2DS[1] = "{FFFFFF}Changing Positive"; _Dialog = Dialog:RESPECT_POS;}
  7755.  
  7756.  
  7757. case 1:{ if(Player != playerid)format(_2DS[0], 129, "Changing "ORAN"%s"GREY"'s Negative Respect\nPlease insert your respect value:", Name(Player));
  7758. else _2DS[0] = "Changing "ORAN"your"GREY"'s Positive Respect\nPlease insert your respect value:";
  7759. _2DS[1] = "{FFFFFF}Changing Negative" ; _Dialog = Dialog:RESPECT_NEG;}
  7760. }
  7761. SPD(playerid, _Dialog, INPUT, _2DS[1], _2DS[0], "Set", "Back");
  7762. }
  7763. CaseDialog<RESPECT_POS>
  7764. {
  7765. if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  7766.  
  7767. if(sscanf(inputtext, "d", inputtext[0]))
  7768. {
  7769. OnDialogResponse(playerid, Dialog:SetStatsTrue, true, 0, "");
  7770. return 1;
  7771. }
  7772. else
  7773. {
  7774. new
  7775. Player = GetPVarInt(playerid, "StatsOf");
  7776.  
  7777. if(Player == 0xFFFF)
  7778. return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
  7779.  
  7780. SetPVarInt(Player, "0_Positive", inputtext[0]);
  7781. P_DATA[Player][Positive] = inputtext[0];
  7782.  
  7783. OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  7784.  
  7785. if(Player != playerid)
  7786. {
  7787. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s Positive Respect to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
  7788. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your Positive Respect to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
  7789. }
  7790. else
  7791. FormatMSG(playerid, Color:GREY, "You set your Positive Respect to "ORAN"%d"GREY" ", inputtext[0]);
  7792.  
  7793. #if UPDATE_TOP_ALWAYS == true
  7794. new DBResult: R1;
  7795. format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(Player));
  7796. R1 = DB::Query(_DB, Query);
  7797.  
  7798. if(R1)
  7799. {
  7800. if(DB::Valid(R1))
  7801. {
  7802. DB::Free(R1);
  7803. format(Query, sizeof(Query), "UPDATE `Top` SET `Positive` = '%d' WHERE `Name` = '%s'", inputtext[0], Name(Player));
  7804. DB::Query(_DB, Query);
  7805. }
  7806. else
  7807. {
  7808. DB::Free(R1);
  7809. format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`,`Positive`) VALUES('%s','%d')", Name(Player), inputtext[0]);
  7810. DB::Query(_DB, Query);
  7811. }
  7812. }
  7813. #endif
  7814. }
  7815. }
  7816. CaseDialog<RESPECT_NEG>
  7817. {
  7818. if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  7819.  
  7820. if(sscanf(inputtext, "d", inputtext[0]))
  7821. {
  7822. OnDialogResponse(playerid, Dialog:SetStatsTrue, true, 1, "");
  7823. return 1;
  7824. }
  7825. else
  7826. {
  7827. new
  7828. Player = GetPVarInt(playerid, "StatsOf");
  7829.  
  7830. if(Player == 0xFFFF)
  7831. return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
  7832.  
  7833. SetPVarInt(Player, "0_Negative", inputtext[0]);
  7834. P_DATA[Player][Negative] = inputtext[0];
  7835.  
  7836. OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  7837.  
  7838. if(Player != playerid)
  7839. {
  7840. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s Negative Respect to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
  7841. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your Negative Respect to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
  7842. }
  7843. else
  7844. FormatMSG(playerid, Color:GREY, "You set your Negative Respect to "ORAN"%d"GREY" ", inputtext[0]);
  7845.  
  7846. #if UPDATE_TOP_ALWAYS == true
  7847. new DBResult: R1;
  7848.  
  7849. format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(Player));
  7850. R1 = DB::Query(_DB, Query);
  7851.  
  7852. if(R1)
  7853. {
  7854. if(DB::Valid(R1))
  7855. {
  7856. DB::Free(R1);
  7857. format(Query, sizeof(Query), "UPDATE `Top` SET `Negative` = '%d' WHERE `Name` = '%s'", inputtext[0], Name(Player));
  7858. DB::Query(_DB, Query);
  7859. }
  7860. else
  7861. {
  7862. DB::Free(R1);
  7863. format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`,`Negative`) VALUES('%s','%d')", Name(Player),inputtext[0]);
  7864. DB::Query(_DB, Query);
  7865. }
  7866. }
  7867. #endif
  7868. }
  7869. }
  7870. CaseDialog<KILLS>
  7871. {
  7872. if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  7873.  
  7874. if(sscanf(inputtext, "d", inputtext[0]))
  7875. {
  7876. OnDialogResponse(playerid, Dialog:SetStatsTrue, true, KILLS, "");
  7877. return 1;
  7878. }
  7879. else
  7880. {
  7881. new
  7882. Player = GetPVarInt(playerid, "StatsOf");
  7883.  
  7884. if(Player == 0xFFFF)
  7885. return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
  7886.  
  7887. SetPVarInt(Player, "0_Kills", inputtext[0]);
  7888. P_DATA[Player][Kills] = inputtext[0];
  7889.  
  7890. OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  7891.  
  7892. if(Player != playerid)
  7893. {
  7894. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s kills to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
  7895. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your kills to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
  7896. }
  7897. else
  7898. FormatMSG(playerid, Color:GREY, "You set your kills to "ORAN"%d"GREY" ", inputtext[0]);
  7899.  
  7900. #if UPDATE_TOP_ALWAYS == true
  7901. new DBResult: R1;
  7902.  
  7903. format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(Player));
  7904. R1 = DB::Query(_DB, Query);
  7905.  
  7906. if(R1)
  7907. {
  7908. if(DB::Valid(R1))
  7909. {
  7910. DB::Free(R1);
  7911. format(Query, sizeof(Query), "UPDATE `Top` SET `Kills` = '%d', `Ratio` = '%f' WHERE `Name` = '%s'", inputtext[0], (Float:P_DATA[Player][Kills] / Float:P_DATA[Player][Deaths]), Name(Player));
  7912. DB::Query(_DB, Query);
  7913. }
  7914. else
  7915. {
  7916. DB::Free(R1);
  7917. format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`, `Deaths`,`Ratio`) VALUES('%s','%d','%f')",Name(Player), inputtext[0], (Float:P_DATA[Player][Kills] / Float:P_DATA[Player][Deaths]));
  7918. DB::Query(_DB, Query);
  7919. }
  7920. }
  7921. #endif
  7922. }
  7923. }
  7924. CaseDialog<DEATHS>
  7925. {
  7926. if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  7927.  
  7928. if(sscanf(inputtext, "d", inputtext[0]))
  7929. {
  7930. OnDialogResponse(playerid, Dialog:SetStatsTrue, true, DEATHS, "");
  7931. return 1;
  7932. }
  7933. else
  7934. {
  7935. new
  7936. Player = GetPVarInt(playerid, "StatsOf");
  7937.  
  7938. if(Player == 0xFFFF)
  7939. return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
  7940.  
  7941. SetPVarInt(Player, "0_Deaths", inputtext[0]);
  7942. P_DATA[Player][Deaths] = inputtext[0];
  7943.  
  7944. OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  7945.  
  7946. if(Player != playerid)
  7947. {
  7948. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s deaths to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
  7949. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your deaths to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
  7950. }
  7951. else
  7952. FormatMSG(playerid, Color:GREY, "You set your deaths to "ORAN"%d"GREY" ", inputtext[0]);
  7953.  
  7954. #if UPDATE_TOP_ALWAYS == true
  7955. new DBResult: R1;
  7956.  
  7957. format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(Player));
  7958. R1 = DB::Query(_DB, Query);
  7959.  
  7960. if(R1)
  7961. {
  7962. if(DB::Valid(R1))
  7963. {
  7964. DB::Free(R1);
  7965. format(Query, sizeof(Query), "UPDATE `Top` SET `Deaths` = '%d', `Ratio` = '%f' WHERE `Name` = '%s'", inputtext[0], (Float:P_DATA[Player][Kills] / Float:P_DATA[Player][Deaths]), Name(Player));
  7966. DB::Query(_DB, Query);
  7967. }
  7968. else
  7969. {
  7970. DB::Free(R1);
  7971. format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`, `Deaths`,`Ratio`) VALUES('%s','%d','%f')",Name(Player), inputtext[0], (Float:P_DATA[playerid][Kills] / Float:P_DATA[playerid][Deaths]));
  7972. DB::Query(_DB, Query);
  7973. }
  7974. }
  7975. #endif
  7976. }
  7977. }
  7978. CaseDialog<MESSAGES>
  7979. {
  7980. if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  7981.  
  7982. if(sscanf(inputtext, "d", inputtext[0]))
  7983. {
  7984. OnDialogResponse(playerid, Dialog:SetStatsTrue, true, MESSAGES, "");
  7985. return 1;
  7986. }
  7987. else
  7988. {
  7989. new
  7990. Player = GetPVarInt(playerid, "StatsOf");
  7991.  
  7992. if(Player == 0xFFFF)
  7993. return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
  7994.  
  7995. SetPVarInt(Player, "0_Messages", inputtext[0]);
  7996. P_DATA[Player][Msgs] = inputtext[0];
  7997.  
  7998. OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  7999.  
  8000. if(Player != playerid)
  8001. {
  8002. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s sent messages to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
  8003. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your sent messages to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
  8004. }
  8005. else
  8006. FormatMSG(playerid, Color:GREY, "You set your sent messages to "ORAN"%d"GREY" ", inputtext[0]);
  8007.  
  8008. }
  8009. }
  8010. CaseDialog<COMMANDS>
  8011. {
  8012. if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  8013.  
  8014. if(sscanf(inputtext, "d", inputtext[0]))
  8015. {
  8016. OnDialogResponse(playerid, Dialog:SetStatsTrue, true, COMMANDS, "");
  8017. return 1;
  8018. }
  8019. else
  8020. {
  8021. new
  8022. Player = GetPVarInt(playerid, "StatsOf");
  8023.  
  8024. if(Player == 0xFFFF)
  8025. return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
  8026.  
  8027. SetPVarInt(Player, "0_Commands", inputtext[0]);
  8028. P_DATA[Player][Cmds] = inputtext[0];
  8029.  
  8030. OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  8031.  
  8032. if(Player != playerid)
  8033. {
  8034. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s used commands to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
  8035. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your used commands to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
  8036. }
  8037. else
  8038. FormatMSG(playerid, Color:GREY, "You set your used commands to "ORAN"%d"GREY" ", inputtext[0]);
  8039.  
  8040. }
  8041. }
  8042. CaseDialog<FCOMMANDS>
  8043. {
  8044. if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  8045.  
  8046. if(sscanf(inputtext, "d", inputtext[0]))
  8047. {
  8048. OnDialogResponse(playerid, Dialog:SetStatsTrue, true, FCOMMANDS, "");
  8049. return 1;
  8050. }
  8051. else
  8052. {
  8053. new
  8054. Player = GetPVarInt(playerid, "StatsOf");
  8055.  
  8056. if(Player == 0xFFFF)
  8057. return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
  8058.  
  8059. SetPVarInt(Player, "0_Fail_Commands", inputtext[0]);
  8060. P_DATA[Player][fCmds] = inputtext[0];
  8061.  
  8062. OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  8063.  
  8064. if(Player != playerid)
  8065. {
  8066. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s fail commands to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
  8067. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your fail commands to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
  8068. }
  8069. else
  8070. FormatMSG(playerid, Color:GREY, "You set your fail commands to "ORAN"%d"GREY" ", inputtext[0]);
  8071.  
  8072. }
  8073. }
  8074. CaseDialog<ONLINE>
  8075. {
  8076. if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  8077.  
  8078. new
  8079. _2DS2[2][129],
  8080. _Dialog,
  8081. Player = GetPVarInt(playerid, "StatsOf");
  8082.  
  8083. if(Player == 0xFFFF)
  8084. return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
  8085.  
  8086. switch(listitem)
  8087. {
  8088. case 0:{ if(Player != playerid)format(_2DS2[0], 129, ""GREY"Changing "ORAN"%s"GREY"'s Hours\nPlease insert the hour value:", Name(Player));
  8089. else _2DS2[0] = ""GREY"Changing "ORAN"your"GREY" Hours\nPlease insert the hour value:";
  8090. _2DS2[1] = "{FFFFFF}Changing Hours" ; _Dialog = Dialog:ONLINE_H; }
  8091.  
  8092. case 1:{ if(Player != playerid)format(_2DS2[0], 129, ""GREY"Changing "ORAN"%s"GREY"'s Minutes\nPlease insert the hour value:", Name(Player));
  8093. else _2DS2[0] = ""GREY"Changing "ORAN"your"GREY" Minutes\nPlease insert the hour value:";
  8094. _2DS2[1] = "{FFFFFF}Changing Minutes" ; _Dialog = Dialog:ONLINE_M;}
  8095.  
  8096. case 2:{ if(Player != playerid)format(_2DS2[0], 129, ""GREY"Changing "ORAN"%s"GREY"'s Seconds\nPlease insert the hour value:", Name(Player));
  8097. else _2DS2[0] = ""GREY"Changing "ORAN"your"GREY" Seconds\nPlease insert the hour value:";
  8098. _2DS2[1] = "{FFFFFF}Changing Seconds" ; _Dialog = Dialog:ONLINE_S;}
  8099. }
  8100. SPD(playerid, _Dialog, INPUT, _2DS2[1], _2DS2[0], "Set", "Back");
  8101. }
  8102. CaseDialog<ONLINE_H>
  8103. {
  8104. if(!response) return OnDialogResponse(playerid, Dialog:SetStatsTrue, true, ONLINE, "");
  8105.  
  8106. if(sscanf(inputtext, "d", inputtext[0]))
  8107. {
  8108. OnDialogResponse(playerid, Dialog:ONLINE, true, 0, "");
  8109. return 1;
  8110. }
  8111. else
  8112. {
  8113. new
  8114. Player = GetPVarInt(playerid, "StatsOf");
  8115.  
  8116. if(Player == 0xFFFF)
  8117. return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
  8118.  
  8119. P_DATA[Player][Hours] = inputtext[0];
  8120. P_DATA[Player][ConnTime] = gettime();
  8121.  
  8122. OnDialogResponse(playerid, Dialog:SetStatsTrue, true, ONLINE, "");
  8123.  
  8124. if(Player != playerid)
  8125. {
  8126. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s online hours to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
  8127. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your online hours to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
  8128. }
  8129. else
  8130. FormatMSG(playerid, Color:GREY, "You set your online hours to "ORAN"%d"GREY" ", inputtext[0]);
  8131.  
  8132. #if UPDATE_TOP_ALWAYS == true
  8133. new DBResult: R1;
  8134.  
  8135. format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(Player));
  8136. R1 = DB::Query(_DB, Query);
  8137.  
  8138. if(R1)
  8139. {
  8140. if(DB::Valid(R1))
  8141. {
  8142. DB::Free(R1);
  8143. format(Query, sizeof(Query), "UPDATE `Top` SET `Hours` = '%d' WHERE `Name` = '%s'", inputtext[0], Name(Player));
  8144. DB::Query(_DB, Query);
  8145. }
  8146. else
  8147. {
  8148. DB::Free(R1);
  8149. format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`, `Hours`) VALUES('%s','%d')",Name(Player), inputtext[0]);
  8150. DB::Query(_DB, Query);
  8151. }
  8152. }
  8153. #endif
  8154.  
  8155. }
  8156. }
  8157. CaseDialog<ONLINE_M>
  8158. {
  8159. if(!response) return OnDialogResponse(playerid, Dialog:SetStatsTrue, true, ONLINE, "");
  8160.  
  8161. if(sscanf(inputtext, "d", inputtext[0]))
  8162. {
  8163. OnDialogResponse(playerid, Dialog:ONLINE, true, 1, "");
  8164. return 1;
  8165. }
  8166. else
  8167. {
  8168. if(inputtext[0] > 60 || inputtext[0] < 0)
  8169. return OnDialogResponse(playerid, Dialog:ONLINE, true, 1, ""),
  8170. SendError(playerid, "Minutes must be from "ORAN"0"GREY" to "ORAN"60"GREY".");
  8171. new
  8172. Player = GetPVarInt(playerid, "StatsOf");
  8173.  
  8174. if(Player == 0xFFFF)
  8175. return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
  8176.  
  8177. P_DATA[Player][Minutes] = inputtext[0];
  8178. P_DATA[Player][ConnTime] = gettime();
  8179.  
  8180. OnDialogResponse(playerid, Dialog:SetStatsTrue, true, ONLINE, "");
  8181.  
  8182. if(Player != playerid)
  8183. {
  8184. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s online minutes to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
  8185. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your online minutes to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
  8186. }
  8187. else
  8188. FormatMSG(playerid, Color:GREY, "You set your online minutes to "ORAN"%d"GREY" ", inputtext[0]);
  8189.  
  8190. }
  8191. }
  8192. CaseDialog<ONLINE_S>
  8193. {
  8194. if(!response) return OnDialogResponse(playerid, Dialog:SetStatsTrue, true, ONLINE, "");
  8195.  
  8196. if(sscanf(inputtext, "d", inputtext[0]))
  8197. {
  8198. OnDialogResponse(playerid, Dialog:ONLINE, true, 2, "");
  8199. return 1;
  8200. }
  8201. else
  8202. {
  8203. if(inputtext[0] > 60 || inputtext[0] < 0)
  8204. return OnDialogResponse(playerid, Dialog:ONLINE, true, 2, ""),
  8205. SendError(playerid, "Seconds must be from "ORAN"0"GREY" to "ORAN"60"GREY".");
  8206. new
  8207. Player = GetPVarInt(playerid, "StatsOf");
  8208.  
  8209. if(Player == 0xFFFF)
  8210. return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
  8211.  
  8212. P_DATA[Player][Seconds] = inputtext[0];
  8213. P_DATA[Player][ConnTime] = gettime();
  8214.  
  8215. OnDialogResponse(playerid, Dialog:SetStatsTrue, true, ONLINE, "");
  8216.  
  8217. if(Player != playerid)
  8218. {
  8219. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s online seonds to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
  8220. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your online seonds to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
  8221. }
  8222. else
  8223. FormatMSG(playerid, Color:GREY, "You set your online seonds to "ORAN"%d"GREY" ", inputtext[0]);
  8224.  
  8225. }
  8226. }
  8227. CaseDialog<LEVEL>
  8228. {
  8229. if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  8230.  
  8231. if(sscanf(inputtext, "d", inputtext[0]))
  8232. {
  8233. OnDialogResponse(playerid, Dialog:SetStatsTrue, true, LEVEL, "");
  8234. return 1;
  8235. }
  8236. else
  8237. {
  8238. new
  8239. Player = GetPVarInt(playerid, "StatsOf");
  8240.  
  8241. if(Player == 0xFFFF)
  8242. return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
  8243.  
  8244. if(inputtext[0] < 0 || inputtext[0] > 5)
  8245. return OnDialogResponse(playerid, Dialog:SetStatsTrue, true, LEVEL, ""),
  8246. SendError(playerid, "Invalid level! Min. "ORAN"0"GREY" Max. "ORAN"5");
  8247.  
  8248. SetPVarInt(Player, "0_Level", inputtext[0]);
  8249. P_DATA[Player][Level] = inputtext[0];
  8250.  
  8251. OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  8252.  
  8253. if(Player != playerid)
  8254. {
  8255. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY" as "ORAN"%s"GREY" of the server!", Name(Player), LevelName(inputtext[0]));
  8256. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s"GREY" set you as "ORAN"%s"GREY" of the server!", Name(playerid), playerid, LevelName(inputtext[0]));
  8257. }
  8258. else
  8259. FormatMSG(playerid, Color:GREY, "You set yourself as "ORAN"%s"GREY" of the server!", LevelName(inputtext[0]));
  8260.  
  8261. }
  8262. }
  8263. CaseDialog<VLEVEL>
  8264. {
  8265. if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  8266.  
  8267. if(sscanf(inputtext, "d", inputtext[0]))
  8268. {
  8269. OnDialogResponse(playerid, Dialog:SetStatsTrue, true, VLEVEL, "");
  8270. return 1;
  8271. }
  8272. else
  8273. {
  8274. new
  8275. Player = GetPVarInt(playerid, "StatsOf");
  8276.  
  8277. if(Player == 0xFFFF)
  8278. return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
  8279.  
  8280. if(inputtext[0] < 0 || inputtext[0] > 3)
  8281. return OnDialogResponse(playerid, Dialog:SetStatsTrue, true, LEVEL, ""),
  8282. SendError(playerid, "Invalid level! Min. "ORAN"0"GREY" Max. "ORAN"3");
  8283.  
  8284. SetPVarInt(Player, "0_Vip", inputtext[0]);
  8285. P_DATA[Player][Vip] = inputtext[0];
  8286.  
  8287. OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  8288.  
  8289. if(Player != playerid)
  8290. {
  8291. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s VIP Level to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
  8292. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your VIP Level to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
  8293. }
  8294. else
  8295. FormatMSG(playerid, Color:GREY, "You set your VIP Level to "ORAN"%d"GREY" ", inputtext[0]);
  8296.  
  8297. }
  8298. }
  8299. CaseDialog<CPASS>
  8300. {
  8301. if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  8302.  
  8303. new NewPass[30];
  8304. if(sscanf(inputtext, "s[30]", NewPass))
  8305. {
  8306. OnDialogResponse(playerid, Dialog:SetStatsTrue, true, CPASS, "");
  8307. return 1;
  8308. }
  8309. else
  8310. {
  8311. new
  8312. Player = GetPVarInt(playerid, "StatsOf");
  8313.  
  8314. if(Player == 0xFFFF)
  8315. return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
  8316.  
  8317. if(strlen(NewPass) < MIN_PASS_LEN || strlen(NewPass) > MAX_PASS_LEN)
  8318. return SendError(playerid, "An error has occured. Invalid Password length!"),
  8319. OnDialogResponse(playerid, Dialog:SetStatsTrue, true, CPASS, "");
  8320.  
  8321. new Buf[129];
  8322.  
  8323. WP_Hash(Buf, (129), NewPass);
  8324. format(Query, 280, "UPDATE `Accounts` SET `Password` = '%s' WHERE `Name` = '%s'", Buf, Name(Player));
  8325. DB::Query(_DB, Query);
  8326.  
  8327.  
  8328. if(Player != playerid)
  8329. FormatMSG(playerid, Color:GREY, "You changed "ORAN"%s"GREY"'s password to "ORAN"%s", Name(Player), NewPass);
  8330. else
  8331. FormatMSG(playerid, Color:GREY, "You changed your password to "ORAN"%s", NewPass);
  8332. }
  8333. }
  8334. CaseDialog<BACCOUNT>
  8335. {
  8336. if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  8337.  
  8338. new Reason[129];
  8339. if(sscanf(inputtext, "s[129]", Reason))
  8340. {
  8341. OnDialogResponse(playerid, Dialog:SetStatsTrue, true, BACCOUNT, "");
  8342. return 1;
  8343. }
  8344. else
  8345. {
  8346. if(strlen(Reason) < 5 || strlen(Reason) > 129)
  8347. return SendError(playerid, "The reason must be Min. "ORAN"5"GREY" Max. "ORAN"129"GREY" characters long!"),
  8348. OnDialogResponse(playerid, Dialog:SetStatsTrue, true, BACCOUNT, "");
  8349.  
  8350. new
  8351. Player = GetPVarInt(playerid, "StatsOf");
  8352.  
  8353. if(Player == 0xFFFF)
  8354. return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
  8355.  
  8356. format(Query, 129, "INSERT INTO `Banlist` VALUES('%s', '%s', '%s', '%s', '%s')", GetPlayerIPEx(Player), Name(Player), Reason, Name(playerid), zDate());
  8357. DB::Query(_DB, Query);
  8358.  
  8359. OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  8360.  
  8361. if(Player != playerid)
  8362. {
  8363. FormatMSG(playerid, Color:GREY, "You banned "ORAN"%s"GREY"'s account with reason "ORAN"%s", Name(Player), Reason);
  8364. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s"GREY" banned your account with reason:", Name(playerid));
  8365. FormatMSG(Player, Color:GREY, "REASON: "ORAN"%s",Reason);
  8366. }
  8367. else
  8368. return 0;
  8369.  
  8370. KickEx(Player, "System", "Account banned with [/setstats]", false);
  8371. }
  8372. }
  8373. CaseDialog<DACCOUNT>
  8374. {
  8375. if(!response)
  8376. return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  8377.  
  8378. new
  8379. Player = GetPVarInt(playerid, "StatsOf");
  8380.  
  8381. if(Player == 0xFFFF)
  8382. return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
  8383.  
  8384. OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  8385.  
  8386. if(Player != playerid)
  8387. {
  8388. FormatMSG(playerid, Color:GREY, "You deleted "ORAN"%s"GREY"'s account.", Name(Player));
  8389. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s"GREY" deleted your account", Name(playerid));
  8390. SendClientMessage(Player, Color:GREY, "You will be kicked in 2 seconds!");
  8391. SendClientMessage(Player, Color:GREY, "Later you can come back without an account.");
  8392.  
  8393. format(Query, 120, "DELETE FROM `Accounts` WHERE `Name` = '%s'", Name(Player));
  8394. DB::Query(_DB, Query);
  8395. }
  8396. else
  8397. return 0;
  8398.  
  8399. KickEx(Player, "System", "Account banned with [/setstats]", false);
  8400. }
  8401. }
  8402.  
  8403. iDialog<SetStatsTrue>
  8404. {
  8405. if(response)
  8406. {
  8407. new id = GetPVarInt(playerid, "StatsOf");
  8408. switch(listitem)
  8409. {
  8410. case NAME: \
  8411. SPD(playerid, Dialog:NAME, INPUT, "{FFFFFF}Changing Name", \
  8412. FormatInside(playerid, id, "Name", "Please insert the new name!"), "Insert", "Back");
  8413.  
  8414.  
  8415. case MONEY: \
  8416. SPD(playerid, Dialog:MONEY, INPUT, "{FFFFFF}Changing Money", \
  8417. FormatInside(playerid, id, "Money", "Please insert the new money value!"),"Insert", "Back");
  8418.  
  8419.  
  8420. case SCORE: \
  8421. SPD(playerid, Dialog:SCORE, INPUT, "{FFFFFF}Changing Score", \
  8422. FormatInside(playerid, id, "Score", "Please insert the new score!"),"Insert", "Back");
  8423.  
  8424.  
  8425. case COOKIES: \
  8426. SPD(playerid, Dialog:COOKIES, INPUT, "{FFFFFF}Changing Cookies", \
  8427. FormatInside(playerid, id, "Cookies", "Please insert the new cookies!"), "Insert", "Back");
  8428.  
  8429.  
  8430. case RESPECT: \
  8431. SPD(playerid, Dialog:RESPECT, LIST, "{FFFFFF}Changing Respect", \
  8432. "Positive\nNegative", "Select", "Back");
  8433.  
  8434.  
  8435.  
  8436. case KILLS: \
  8437. SPD(playerid, Dialog:KILLS, INPUT, "{FFFFFF}Changing Kills", \
  8438. FormatInside(playerid, id, "Kills", "Please insert the new kills!"), "Insert", "Back");
  8439.  
  8440.  
  8441. case DEATHS: \
  8442. SPD(playerid, Dialog:DEATHS, INPUT, "{FFFFFF}Changing Deaths", \
  8443. FormatInside(playerid, id, "Deaths", "Please insert the new deaths!"), "Insert", "Back");
  8444.  
  8445.  
  8446. case MESSAGES: \
  8447. SPD(playerid, Dialog:MESSAGES, INPUT, "{FFFFFF}Changing Messages Sent", \
  8448. FormatInside(playerid, id, "Messages", "Please insert the new messages!"), "Insert", "Back");
  8449.  
  8450.  
  8451. case COMMANDS: \
  8452. SPD(playerid, Dialog:COMMANDS, INPUT, "{FFFFFF}Changing Commands Used", \
  8453. FormatInside(playerid, id, "Used Commands", "Please insert the new used commands value!"), "Insert", "Back");
  8454.  
  8455.  
  8456. case FCOMMANDS: \
  8457. SPD(playerid, Dialog:FCOMMANDS,INPUT, "{FFFFFF}Changing Fail Commands", \
  8458. FormatInside(playerid, id, "Fail Commands", "Please insert the new failed commands value !"), "Insert", "Back");
  8459.  
  8460.  
  8461. case ONLINE: \
  8462. SPD(playerid, Dialog:ONLINE, LIST, "{FFFFFF}Changing Online Time", \
  8463. "Hours\nMinutes\nSeconds", "Select", "Back");
  8464.  
  8465.  
  8466. case LEVEL: \
  8467. SPD(playerid, Dialog:LEVEL, INPUT, "{FFFFFF}Changing Admin Level", \
  8468. FormatInside(playerid, id, "Admin Level", "Please insert the new admin level!"), "Insert", "Back");
  8469.  
  8470.  
  8471. case VLEVEL: \
  8472. SPD(playerid, Dialog:VLEVEL, INPUT, "{FFFFFF}Changing VIP Level", \
  8473. FormatInside(playerid, id, "VIP Level", "Please insert the new VIP level!"), "Insert", "Back");
  8474.  
  8475.  
  8476. case CPASS: \
  8477. SPD(playerid, Dialog:CPASS, INPUT, "{FFFFFF}Changing Password", \
  8478. FormatInside(playerid, id, "Password", "Please insert the new password!"), "Insert", "Back");
  8479.  
  8480.  
  8481. case BACCOUNT: \
  8482. SPD(playerid, Dialog:BACCOUNT, INPUT, "{FFFFFF}Banning Account", \
  8483. FormatInside(playerid, id, .zelse = "Banning", .extra = "Account"), "Yes" , "Back");
  8484.  
  8485.  
  8486. case DACCOUNT: \
  8487. SPD(playerid, Dialog:DACCOUNT, BOX, "{FFFFFF}Deleting Account", \
  8488. FormatInside(playerid, id, .zelse = "Deleting", .extra = "Account"), "Yes" , "Back");
  8489. }
  8490. }else DeletePVar(playerid, "StatsOf");
  8491. }
  8492. iDialog<SetStatsSure>
  8493. {
  8494. if(response)
  8495. {
  8496. new zStr[30];
  8497. format(zStr, 30, "%s", Name(GetPVarInt(playerid, "StatsOf")));
  8498. ShowPlayerDialog(playerid, Dialog:SetStatsTrue, LIST, zStr, FormatList(playerid), "Change", "Exit");
  8499.  
  8500. }else DeletePVar(playerid, "StatsOf");
  8501. }
  8502. iDialog<cPanel_Back> cmd_acp(playerid, "");
  8503.  
  8504. iDialog<ACCP_LOAD>
  8505. {
  8506. if(!response)
  8507. return cmd_accp(playerid, "");
  8508.  
  8509. new Accp_String[16], Accp_Vars[6], DBResult:Result;
  8510. format(Query, sizeof(Query), "SELECT `ACCP` FROM `Accounts` WHERE `Name` = '%s'", Name(playerid));
  8511. Result = DB::Query(_DB, Query);
  8512.  
  8513. if(Result)
  8514. {
  8515. if(DB::Valid(Result))
  8516. {
  8517. new Field[50];
  8518. DB::GetField(Result, "ACCP", Field, sizeof(Field));
  8519. SetPVarString(playerid, "ACCP_DATA", Field);
  8520.  
  8521. DB::Free(Result);
  8522.  
  8523. if(!sscanf(GPVSEx(playerid, "ACCP_DATA"), "p<:>s[16]iiiiii",Accp_String,
  8524. Accp_Vars[0],
  8525. Accp_Vars[1],
  8526. Accp_Vars[2],
  8527. Accp_Vars[3],
  8528. Accp_Vars[4],
  8529. Accp_Vars[5]))
  8530. {
  8531. SetPVarString(playerid, "Type", Accp_String);
  8532. P_DATA[playerid][A_Component1] = Accp_Vars[0];
  8533. P_DATA[playerid][A_Component2] = Accp_Vars[1];
  8534. P_DATA[playerid][A_Component3] = Accp_Vars[2];
  8535. P_DATA[playerid][A_Component4] = Accp_Vars[3];
  8536. P_DATA[playerid][A_Wheels] = Accp_Vars[4];
  8537. P_DATA[playerid][A_Color ] = Accp_Vars[5];
  8538.  
  8539. }
  8540.  
  8541. if(P_DATA[playerid][A_Component1] != 0)AddVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Component1]);
  8542. if(P_DATA[playerid][A_Component2] != 0)AddVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Component2]);
  8543. if(P_DATA[playerid][A_Component3] != 0)AddVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Component3]);
  8544. if(P_DATA[playerid][A_Component4] != 0)AddVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Component4]);
  8545. if(P_DATA[playerid][A_Wheels] != 0)AddVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Wheels]);
  8546. if(P_DATA[playerid][A_Color] != 0)ChangeVehicleColor(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Color], P_DATA[playerid][A_Color]);
  8547.  
  8548. SendClientMessage(playerid, Color:GREY, "The components of your Admin Vehicle have been loaded!");
  8549. }
  8550. else
  8551. {
  8552. SendClientMessage(playerid, Color:GREY, "Failed to load the components from the database!");
  8553. }
  8554. }
  8555. }
  8556. iDialog<ACCP_DISCARD>
  8557. {
  8558. if(!response)
  8559. return cmd_accp(playerid, "");
  8560.  
  8561. if(P_DATA[playerid][A_Component1] != 0)RemoveVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Component1]);
  8562. if(P_DATA[playerid][A_Component2] != 0)RemoveVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Component2]);
  8563. if(P_DATA[playerid][A_Component3] != 0)RemoveVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Component3]);
  8564. if(P_DATA[playerid][A_Component4] != 0)RemoveVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Component4]);
  8565. if(P_DATA[playerid][A_Wheels] != 0)RemoveVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Wheels]);
  8566. if(P_DATA[playerid][A_Color] != 0)ChangeVehicleColor(GetPlayerVehicleID(playerid), 0, 0);
  8567.  
  8568. P_DATA[playerid][A_Component1] = 0;
  8569. P_DATA[playerid][A_Component2] = 0;
  8570. P_DATA[playerid][A_Component3] = 0;
  8571. P_DATA[playerid][A_Component4] = 0;
  8572. P_DATA[playerid][A_Wheels] = 0;
  8573. P_DATA[playerid][A_Color] = 0;
  8574.  
  8575. SendClientMessage(playerid, Color:GREY, "The components of your Admin Vehicle have been discarted! You can "BLUE"Save Changes"GREY" from Admin Car cPanel again!");
  8576.  
  8577. }
  8578. iDialog<ACCP_SAVE>
  8579. {
  8580. if(!response) return cmd_accp(playerid, "");
  8581.  
  8582. CheckComponents(playerid,"No changes have been made to your Admin Car!");
  8583.  
  8584. new zQuery[300];
  8585. format(zQuery, 300, "UPDATE `Accounts` SET ACCP = '%s:%d:%d:%d:%d:%d:%d', ACCPSav = '1' WHERE `Name` = '%s'",
  8586. (strlen(GPVSEx(playerid, "Type")) ? (GPVSEx(playerid, "Type")) : ("None")),
  8587. (P_DATA[playerid][A_Component1]) ? (P_DATA[playerid][A_Component1]) : (0),
  8588. (P_DATA[playerid][A_Component2]) ? (P_DATA[playerid][A_Component2]) : (0),
  8589. (P_DATA[playerid][A_Component3]) ? (P_DATA[playerid][A_Component3]) : (0),
  8590. (P_DATA[playerid][A_Component4]) ? (P_DATA[playerid][A_Component4]) : (0),
  8591. (P_DATA[playerid][A_Wheels]) ? (P_DATA[playerid][A_Wheels]) : (0) ,
  8592. (P_DATA[playerid][A_Color]) ? (P_DATA[playerid][A_Color]) : (0),
  8593. Name(playerid));
  8594. DB::Query(_DB, zQuery);
  8595.  
  8596.  
  8597. P_DATA[playerid][Accp_Saved] = 1;
  8598.  
  8599. SendClientMessage(playerid, Color:GREY, "The components of Admin Vehicle have been saved! Later select "BLUE"Load Changes"GREY" from Admin Car cPanel!");
  8600.  
  8601. }
  8602. iDialog<ACCP_COMPS>
  8603. {
  8604. if(!response) return OnDialogResponse(playerid, Dialog:ACCP, 1, 2, "");
  8605.  
  8606. AddVehicleComponent(GetPlayerVehicleID(playerid), ACCP_Components[listitem][iComponent]);
  8607. FormatMSG(playerid, Color:GREY, "You added "ORAN"%s"GREY" on your Admin Car!", ACCP_Components[listitem][icName]);
  8608.  
  8609. switch(listitem)
  8610. {
  8611. case 0,1: P_DATA[playerid][A_Component1] = ACCP_Components[listitem][iComponent];
  8612. case 2,3,4: P_DATA[playerid][A_Component2] = ACCP_Components[listitem][iComponent];
  8613. case 5: P_DATA[playerid][A_Component3] = ACCP_Components[listitem][iComponent];
  8614. case 6: P_DATA[playerid][A_Component4] = ACCP_Components[listitem][iComponent];
  8615. }
  8616.  
  8617. return cmd_accp(playerid,"");
  8618. }
  8619.  
  8620. iDialog<ACCP_WHEELS>
  8621. {
  8622. if(!response) return OnDialogResponse(playerid, Dialog:ACCP, 1, 2, "");
  8623.  
  8624. AddVehicleComponent(GetPlayerVehicleID(playerid), Wheels[listitem][iWheel]);
  8625. FormatMSG(playerid, Color:GREY, "You added wheels "ORAN"%s"GREY" on your Admin Car!",Wheels[listitem][iwName]);
  8626.  
  8627. P_DATA[playerid][A_Wheels] = Wheels[listitem][iWheel];
  8628.  
  8629. return cmd_accp(playerid,"");
  8630. }
  8631.  
  8632. iDialog<ACCP_COLORS>
  8633. {
  8634. if(!response) return cmd_accp(playerid,"");
  8635.  
  8636. ChangeVehicleColor(GetPlayerVehicleID(playerid),ACCP_Colors[listitem][ivColor], ACCP_Colors[listitem][ivColor]);
  8637. FormatMSG(playerid, Color:GREY, "You changed your vehicle's color to color to %s%s!", ACCP_Colors[listitem][ivcRGB], ACCP_Colors[listitem][ivcName]);
  8638.  
  8639. P_DATA[playerid][A_Color] = ACCP_Colors[listitem][ivColor];
  8640.  
  8641. return cmd_accp(playerid,"");
  8642. }
  8643.  
  8644. iDialog<ACCP_C_C>
  8645. {
  8646. if(!response) return cmd_accp(playerid,"");
  8647.  
  8648. switch(listitem)
  8649. {
  8650. case (0):
  8651. {
  8652. new Str[1024];
  8653. for (new c = 0; c < sizeof(Wheels); c++)
  8654. {format(Str, sizeof (Str), "%s"GREY"ID: "ORAN"%d "GREY" NAME: "ORAN"%s\n",Str, Wheels[c][iWheel], Wheels[c][iwName]);}
  8655.  
  8656. SPD(playerid, Dialog:ACCP_WHEELS, LIST, "Change: "ORAN"Wheels", Str, "Change", "Back");
  8657. }
  8658. case (1):
  8659. {
  8660. new Str[1024];
  8661. for (new c = 0; c < sizeof(ACCP_Components); c++)
  8662. {format(Str, sizeof (Str), "%s"GREY"%s\n",Str, ACCP_Components[c][icName]);}
  8663.  
  8664. SPD(playerid, Dialog:ACCP_COMPS, LIST, "Add: "ORAN"Components", Str, "Change", "Back");
  8665. }
  8666. }
  8667. }
  8668.  
  8669. iDialog<ACCP>
  8670. {
  8671. if(response)
  8672. {
  8673. switch(listitem)
  8674. {
  8675. case (0): SPD(playerid, Dialog:ACCP_NOS, LIST, "Add: "ORAN"Nos", ""GREY"2x\n\
  8676. "GREY"5x\n\
  8677. "GREY"10x\n\
  8678. "GREY"Unlimited\n\
  8679. "ORAN"Remove Nos", "Add", "Back");
  8680.  
  8681. case (1):
  8682. {
  8683. new Str[512];
  8684. for (new c = 0; c < sizeof(ACCP_Colors); c++)
  8685. { format(Str, sizeof (Str), "%s%s%s\n", Str, ACCP_Colors[c][ivcRGB], ACCP_Colors[c][ivcName]); }
  8686.  
  8687. SPD(playerid, Dialog:ACCP_COLORS, LIST, "Change: "ORAN"Colors", Str, "Change", "Back");
  8688. }
  8689. case (2): SPD(playerid, Dialog:ACCP_C_C, LIST, "Add: "ORAN"Components", ""GREY"Wheels\n\
  8690. "GREY"Components", "Add", "Back");
  8691.  
  8692. case (3):
  8693. {
  8694.  
  8695. CheckComponents(playerid, "There are no changes to save!");
  8696.  
  8697. SPD(playerid, Dialog:ACCP_SAVE, BOX, "Save: "ORAN"Changes!", ""GREY"Saving changes made to your vehicle can be used everytime, anywhere!\n\
  8698. Changes will be saved into your account.\n\
  8699. Later select the "BLUE"Load Changes"GREY" item on your Admin Car cPanel.\n\
  8700. It's totally free and usable anytime!\n\n\
  8701. Want to "ORAN"save"GREY" or go "ORAN"back"GREY" ?", "Save", "Back");
  8702. }
  8703. case (4):
  8704. {
  8705. if(!P_DATA[playerid][Accp_Saved])
  8706. return SendError(playerid, "You didn't save any changes to your vehicle!"), cmd_accp(playerid, "");
  8707.  
  8708. SPD(playerid, Dialog:ACCP_LOAD, BOX, "Load: "ORAN"Changes!", ""GREY"With this you will load the changes you saved last time\n\
  8709. If you want to remove the changes select the "ORAN"Discard Changes"GREY" from Admin Car cPanel!\n\n\
  8710. Want to "ORAN"load"GREY" or go "ORAN"back"GREY" ?", "Load", "Back");
  8711. }
  8712. case (5):
  8713. {
  8714. CheckComponents(playerid, "There are no changes to discard due to the fact that there aren't any!");
  8715.  
  8716. SPD(playerid, Dialog:ACCP_DISCARD, BOX, "Discard: "ORAN"Changes!", ""GREY"You are about to discard the changes made to your vehicle!\n\
  8717. Ani component, nos type, wheels, colors selected for your Admin Car WILL BE DELETED!!\n\n\
  8718. Want to "ORAN"discard"GREY" or go "ORAN"back"GREY" ?", "Discard", "Back");
  8719. }
  8720. }
  8721. }
  8722. }
  8723. iDialog<ACCP_NOS>
  8724. {
  8725. if(!response) return cmd_accp(playerid,"");
  8726. switch(listitem)
  8727. {
  8728. case (0): AddVehicleComponent(GetPlayerVehicleID(playerid), 1009),SetPVarString(playerid, "Type", "2x");
  8729. case (1): AddVehicleComponent(GetPlayerVehicleID(playerid), 1008),SetPVarString(playerid, "Type", "5x");
  8730. case (2): AddVehicleComponent(GetPlayerVehicleID(playerid), 1010),SetPVarString(playerid, "Type", "10x");
  8731. case (3): AddVehicleComponent(GetPlayerVehicleID(playerid), 1010),SetPVarString(playerid, "Type", "Unlimited");
  8732. case (4):
  8733. {
  8734. if(!strcmp(GPVSEx(playerid, "Type"), "None", false))
  8735. return SendError(playerid, "You don't have NOS installed!"),
  8736. OnDialogResponse(playerid, Dialog:ACCP, 1, 0, "");
  8737.  
  8738. SendClientMessage(playerid, Color:ORAN, "ACCP: "GREY"You removed your Nitro from vehicle!");
  8739.  
  8740. RemoveVehicleComponent(GetPlayerVehicleID(playerid), 1010),
  8741. RemoveVehicleComponent(GetPlayerVehicleID(playerid), 1009),
  8742. RemoveVehicleComponent(GetPlayerVehicleID(playerid), 1008),
  8743. SetPVarString(playerid, "Type", "None");
  8744. }
  8745. }
  8746. if(listitem != 4)
  8747. {
  8748. FormatMSG(playerid, Color:ORAN, "ACCP: "GREY" You have added "ORAN"%s"GREY" nitro to your vehicle!", GPVSEx(playerid, "Type"));
  8749.  
  8750. if(!strcmp(GPVSEx(playerid, "Type"), "Unlimited", false))
  8751. SendClientMessage(playerid, Color:ORAN, "NOTE:"GREY" Hold your left mouse button for unlimited nos!");
  8752.  
  8753. else
  8754. SendClientMessage(playerid, Color:ORAN, "NOTE:"GREY" Press "ORAN"2"GREY" or "ORAN"Left Mouse Button"GREY" to recharge when exhausted!");
  8755.  
  8756. return cmd_accp(playerid,"");
  8757. }
  8758. }
  8759. iDialog<cPanel_Ping>
  8760. {
  8761. if(!response)
  8762. {
  8763. S_DATA[Ping] = 0;
  8764.  
  8765. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Ping Kicker",
  8766. ""W"Feature "ORAN"\"Ping Kicker\""W" has been disabled!\n\
  8767. Players won't be kicked from the server for high ping.", "Back", "");
  8768. }
  8769. else
  8770. {
  8771. new sPing[10];
  8772. if(sscanf(inputtext, "s[10]", sPing)) return OnDialogResponse(playerid, Dialog:cPanel, 1, 2, "");
  8773. else
  8774. {
  8775. if(!IsNumeric(sPing))
  8776. {
  8777. if(!strcmp(sPing, "off", true))
  8778. {
  8779. S_DATA[Ping] = 0;
  8780. new INI:
  8781. ServerData = INI_Open(SERVER_FILE);
  8782. INI_WriteInt(ServerData, INI_Server_Info[2][isName], 0);
  8783. INI_Close(ServerData);
  8784. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Ping Kicker", \
  8785. ""W"Feature "ORAN"\"Ping Kicker\""W" has been disabled!\n\
  8786. Players won't be kicked if they have a high ping", "Back", "");
  8787. return 0;
  8788. }
  8789. else
  8790. {
  8791. SPD(playerid, Dialog:cPanel_Ping, INPUT, ""W"cPanel: "ORAN"Ping Kicker","\n\n\
  8792. "GREY"Please write down the ping needed for the player to get kicked.\n\
  8793. If you write "ORAN"OFF"GREY" the "ORAN"Ping Kicker"GREY" will be disabled.", "Enter", "Disable");
  8794. }
  8795. }
  8796. else
  8797. {
  8798. if(strval(sPing) < MIN_PING_LIMIT || strval(sPing) > MAX_PING_LIMIT)
  8799. return SPD(playerid, Dialog:cPanel_Ping, INPUT, ""W"cPanel: "ORAN"Ping Kicker",
  8800. ""ORAN"ERROR:"W" Min. Ping: "ORAN""#MIN_PING_LIMIT" "W"| Max. Ping: "ORAN""#MAX_PING_LIMIT"\n\n\
  8801. "GREY"Please write down the ping needed for the player to get kicked.\n\
  8802. If you write "ORAN"OFF"GREY" the "ORAN"Ping Kicker"GREY" will be disabled.", "Enter", "Disable");
  8803.  
  8804. S_DATA[Ping] = strval(sPing);
  8805.  
  8806. new INI: ServerData = INI_Open(SERVER_FILE);
  8807. INI_WriteInt(ServerData, INI_Server_Info[2][isName], strval(sPing));
  8808. INI_Close(ServerData);
  8809.  
  8810. new zStr[256];
  8811. format(zStr, sizeof (zStr), ""W"Feature "ORAN"\"Ping Kicker\""W" has been enabled!\n\
  8812. Players will be kicked if they exceed the "ORAN"%d"W" ping limit!", strval(sPing));
  8813. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Ping Kicker", zStr, "Back", "");
  8814.  
  8815. }
  8816. }
  8817. }
  8818. }
  8819. iDialog<cPanel>
  8820. {
  8821. if(response)
  8822. {
  8823. new INI:
  8824. ServerData = INI_Open(SERVER_FILE);
  8825. switch(listitem)
  8826. {
  8827. case 0:
  8828. {
  8829. INI_WriteInt(ServerData, INI_Server_Info[0][isName], 1);
  8830. S_DATA[AntiSpam] = 1;
  8831. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti-Spam",\
  8832. ""W"Feature "ORAN"\"Anti-Spam\""W" has been enabled!\n\
  8833. Players won't be able to spam the chat and will be kicked for abuse.", "Back", "");
  8834. }
  8835. case 1:
  8836. {
  8837. INI_WriteInt(ServerData, INI_Server_Info[1][isName], 1);
  8838. S_DATA[AntiCSpam] = 1;
  8839. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Command Spam",\
  8840. ""W"Feature "ORAN"\"Anti Command Spam\""W" has been enabled!\n\
  8841. Players won't be able to spam the chat with commands.", "Back", "");
  8842. }
  8843. case 2:
  8844. {
  8845. SPD(playerid, Dialog:cPanel_Ping, INPUT, ""W"cPanel: "ORAN"Ping Kicker","\n\n\
  8846. "GREY"Please write down the ping needed for the player to get kicked.\n\
  8847. If you write "ORAN"OFF"GREY" the "ORAN"Ping Kicker"GREY" will be disabled.", "Enter", "Disable");
  8848. }
  8849. case 3:
  8850. {
  8851. INI_WriteInt(ServerData, INI_Server_Info[3][isName], 1);
  8852. S_DATA[RCONProt] = 1;
  8853. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"RCON Protection",\
  8854. ""W"Feature "ORAN"\"Rcon Protection\""W" has been enabled!\n\
  8855. After "ORAN""#MAX_RCON_ATTEMPTS" attempts players will be banned\n\
  8856. from the server for repeated login attempts", "Back", "");
  8857. }
  8858. case 4:
  8859. {
  8860. INI_WriteInt(ServerData, INI_Server_Info[4][isName], 1);
  8861. S_DATA[TellPlayer] = 1;
  8862. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Tell Player",\
  8863. ""W"Feature "ORAN"\"Tell Player\""W" has been enabled!\n\
  8864. Players will receive a message when typing an admin command\n\
  8865. telling them that their admin level is not high enough!", "Back", "");
  8866. }
  8867. case 5:
  8868. {
  8869. INI_WriteInt(ServerData, INI_Server_Info[5][isName], 0);
  8870. S_DATA[Chat] = 0;
  8871. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Block Chat",\
  8872. ""W"The "ORAN"Chat"W" has been unblocked!\n\
  8873. Players are able to speak in the chat!", "Back", "");
  8874. }
  8875.  
  8876. case 6:
  8877. {
  8878. INI_WriteInt(ServerData, INI_Server_Info[6][isName], 1);
  8879. S_DATA[ReadPM] = 1;
  8880. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Read Personal Messages",\
  8881. ""W"Feature "ORAN"\"Read PMs\""W" has been enabled!\n\
  8882. Administrators will be able to see the messages\n\
  8883. sent by members to others!", "Back", "");
  8884. }
  8885. case 7:
  8886. {
  8887. INI_WriteInt(ServerData, INI_Server_Info[7][isName], 1);
  8888. S_DATA[ReadCMD] = 1;
  8889. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Read Commands",\
  8890. ""W"Feature "ORAN"\"Read Commands\""W" has been enabled!\n\
  8891. Administrators will be able to see the commands a player used!", "Back", "");
  8892. }
  8893. case 8:
  8894. {
  8895. INI_WriteInt(ServerData, INI_Server_Info[8][isName], 1);
  8896. S_DATA[AKA] = 1;
  8897. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"AKA",\
  8898. ""W"Feature "ORAN"\"AKA\""W" has been enabled!\n\
  8899. Admins will see the AKA names of a player!", "Back", "");
  8900. }
  8901.  
  8902. case 9:
  8903. {
  8904. SPD(playerid, Dialog:cPanel2, LIST, ""ORAN"Server Control Panel"W" Page: 2", cPanel2(), "Enable", "Disable");
  8905. }
  8906. }
  8907. INI_Close(ServerData);
  8908. }
  8909. else
  8910. {
  8911. new INI:
  8912. ServerData = INI_Open(SERVER_FILE);
  8913. switch(listitem)
  8914. {
  8915. case 0:
  8916. {
  8917. INI_WriteInt(ServerData, INI_Server_Info[0][isName], 0);
  8918. S_DATA[AntiSpam] = 0;
  8919. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti-Spam",\
  8920. ""W"Feature "ORAN"\"Anti-Spam\""W" has been disabled!\n\
  8921. Players will be able to spam the chat.", "Back", "");
  8922. }
  8923. case 1:
  8924. {
  8925. INI_WriteInt(ServerData, INI_Server_Info[1][isName], 0);
  8926. S_DATA[AntiCSpam] = 0;
  8927. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Command Spam",\
  8928. ""W"Feature "ORAN"\"Anti Command Spam\""W" has been disabled!\n\
  8929. Players will be able to spam the chat with commands.", "Back", "");
  8930. }
  8931. case 2:
  8932. {
  8933. INI_WriteInt(ServerData, INI_Server_Info[2][isName], 0);
  8934. S_DATA[Ping] = 0;
  8935. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Ping Kicker",\
  8936. ""W"Feature "ORAN"\"Ping Kicker\""W" has been disabled!\n\
  8937. Players won't be kicked for a high ping.", "Back", "");
  8938. }
  8939. case 3:
  8940. {
  8941. INI_WriteInt(ServerData, INI_Server_Info[3][isName], 0);
  8942. S_DATA[RCONProt] = 0;
  8943. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"RCON Protection",\
  8944. ""W"Feature "ORAN"\"Rcon Protection\""W" has been disabled!\n\
  8945. Players won't be banned from the server for RCON login attempts.", "Back", "");
  8946. }
  8947. case 4:
  8948. {
  8949. INI_WriteInt(ServerData, INI_Server_Info[4][isName], 0);
  8950. S_DATA[TellPlayer] = 0;
  8951. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Tell Player",\
  8952. ""W"Feature "ORAN"\"Tell Player\""W" has been disabled!\n\
  8953. Players won't be informed that their level is not high enough\n\
  8954. to execute the admin command, actually, no message will be sent.", "Back", "");
  8955. }
  8956. case 5:
  8957. {
  8958. INI_WriteInt(ServerData, INI_Server_Info[5][isName], 1);
  8959. S_DATA[Chat] = 1;
  8960. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Block Chat",\
  8961. ""W"The "ORAN"Chat"W" has been blocked!\n\
  8962. Players won't be able to speak in the chat", "Back", "");
  8963. }
  8964. case 6:
  8965. {
  8966. INI_WriteInt(ServerData, INI_Server_Info[6][isName], 0);
  8967. S_DATA[ReadPM] = 0;
  8968. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Read Personal Messages",\
  8969. ""W"Feature "ORAN"\"Read PMs\""W" has been disabled!\n\
  8970. Personal Messages are now PERSONAL!", "Back", "");
  8971. }
  8972. case 7:
  8973. {
  8974. INI_WriteInt(ServerData, INI_Server_Info[7][isName], 0);
  8975. S_DATA[ReadCMD] = 0;
  8976. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Read Commands",\
  8977. ""W"Feature "ORAN"\"Read Commands\""W" has been disabled!\n\
  8978. Reading Commands is now disabled, Admins won't see.!", "Back", "");
  8979. }
  8980. case 8:
  8981. {
  8982. INI_WriteInt(ServerData, INI_Server_Info[8][isName], 0);
  8983. S_DATA[AKA] = 0;
  8984. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"AKA",\
  8985. ""W"Feature "ORAN"\"AKA\""W" has been disabled!\n\
  8986. Admins won't see the AKA the players logged with!", "Back", "");
  8987. }
  8988. }
  8989. INI_Close(ServerData);
  8990. }
  8991. }
  8992. iDialog<cPanel2>
  8993. {
  8994. if(response)
  8995. {
  8996. new INI:
  8997. ServerData = INI_Open(SERVER_FILE);
  8998. switch(listitem)
  8999. {
  9000. case 0:
  9001. {
  9002. INI_WriteInt(ServerData, INI_Server_Info[9][isName], 1);
  9003. S_DATA[ShowFunction] = 1;
  9004. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Show Function",\
  9005. ""W"Feature "ORAN"\"Show Function\""W" has been enabled!\n\
  9006. When admins type an admin command, they will see the \""ORAN"Function: "W"blabla\"", "Back", "");
  9007. }
  9008. case 1:
  9009. {
  9010. INI_WriteInt(ServerData, INI_Server_Info[10][isName], 1);
  9011. S_DATA[AntiRepeat] = 1;
  9012. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Message Repeat",\
  9013. ""W"Feature "ORAN"\"Anti Message Repeat\""W" has been enabled!\n\
  9014. Players will be warned if they continue to send same message in the chat!", "Back", "");
  9015. }
  9016. case 2:
  9017. {
  9018. INI_WriteInt(ServerData, INI_Server_Info[11][isName], 1);
  9019. S_DATA[AutoLogin] = 1;
  9020. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Auto Login",\
  9021. ""W"Feature "ORAN"\"Auto Login\""W" has been enabled!\n\
  9022. When players connect and the IP with which they left matches\n\
  9023. the one they connected with and the name is same they will\n\
  9024. auto login into their account without password request\n\n\
  9025. "ORAN"# Could be unsafe! Use carfully!", "Back", "");
  9026. }
  9027. case 3:
  9028. {
  9029. #if USE_RANKS == true
  9030.  
  9031. INI_WriteInt(ServerData, INI_Server_Info[12][isName], 1);
  9032. S_DATA[AnnRank] = 1;
  9033. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Announce Rank",\
  9034. ""W"Feature "ORAN"\"Announce Rank\""W" has been enabled!\n\
  9035. When a player will rank up, will tell to the whole server\n\
  9036. This feature can get frustrating when the server is crowded!", "Back", "");
  9037.  
  9038. #else
  9039.  
  9040. cmd_acp(playerid, "");
  9041. SendError(playerid, "Using Ranks is disabled from script!");
  9042.  
  9043. #endif
  9044. }
  9045. case 4:
  9046. {
  9047. INI_WriteInt(ServerData, INI_Server_Info[13][isName], 1);
  9048. S_DATA[AntiAD] = 1;
  9049. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Advertising",\
  9050. ""W"Feature "ORAN"\"Anti Advertising\""W" has been enabled!\n\
  9051. Players that will advertise will be warned then kicked!", "Back", "");
  9052. }
  9053. case 5:
  9054. {
  9055. INI_WriteInt(ServerData, INI_Server_Info[14][isName], 0);
  9056. S_DATA[AdminChat] = 1;
  9057. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Advertising",\
  9058. ""W"Feature "ORAN"\"Bloch Admin Chat\""W" has been enabled!\n\
  9059. All admins will be able to chat trough Admin Chat", "Back", "");
  9060. }
  9061. case 6:
  9062. {
  9063. INI_WriteInt(ServerData, INI_Server_Info[15][isName], 0);
  9064. S_DATA[VipChat] = 1;
  9065. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Advertising",\
  9066. ""W"Feature "ORAN"\"Block VIP Chat\""W" has been enabled!\n\
  9067. VIP members can now chat freely trough VIP Chat.", "Back", "");
  9068. }
  9069. case 7:
  9070. {
  9071. cmd_acp(playerid, "");
  9072. }
  9073. }
  9074. INI_Close(ServerData);
  9075. }
  9076. else
  9077. {
  9078. new INI:
  9079. ServerData = INI_Open(SERVER_FILE);
  9080.  
  9081. switch(listitem)
  9082. {
  9083. case 0:
  9084. {
  9085. INI_WriteInt(ServerData, INI_Server_Info[9][isName], 0);
  9086. S_DATA[ShowFunction] = 0;
  9087. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Show Function",\
  9088. ""W"Feature "ORAN"\"Show Function\""W" has been disabled!\n\
  9089. When admins type an admin command, they won't see the \"Function: blabla\"", "Back", "");
  9090. }
  9091. case 1:
  9092. {
  9093. INI_WriteInt(ServerData, INI_Server_Info[10][isName], 0);
  9094. S_DATA[AntiRepeat] = 0;
  9095. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Message Repeat",\
  9096. ""W"Feature "ORAN"\"Anti Message Repeat\""W" has been disabled!\n\
  9097. Players are now allowed to repeate themselves in the chat!", "Back", "");
  9098. }
  9099. case 2:
  9100. {
  9101. INI_WriteInt(ServerData, INI_Server_Info[11][isName], 0);
  9102. S_DATA[AutoLogin] = 0;
  9103. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Auto Login",\
  9104. ""W"Feature "ORAN"\"Auto Login\""W" has been disabled!\n\
  9105. On connection player will need to enter their passwords\n\
  9106. to enter their accounts!\n\n\
  9107. "GREE"# Safest Way!", "Back", "");
  9108. }
  9109. case 3:
  9110. {
  9111. #if USE_RANKS == true
  9112.  
  9113. INI_WriteInt(ServerData, INI_Server_Info[12][isName], 0);
  9114. S_DATA[AnnRank] = 0;
  9115. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Announce Rank",\
  9116. ""W"Feature "ORAN"\"Announce Rank\""W" has been disabled!\n\
  9117. Only the ranked up player will see the message!", "Back", "");
  9118.  
  9119. #else
  9120.  
  9121. cmd_acp(playerid, "");
  9122. SendError(playerid, "Using Ranks is disabled from script!");
  9123.  
  9124. #endif
  9125. }
  9126. case 4:
  9127. {
  9128. INI_WriteInt(ServerData, INI_Server_Info[13][isName], 0);
  9129. S_DATA[AntiAD] = 0;
  9130. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Advertising",\
  9131. ""W"Feature "ORAN"\"Anti Advertising\""W" has been disabled!\n\
  9132. Players will now be able to send IP in chat!!!", "Back", "");
  9133. }
  9134. case 5:
  9135. {
  9136. INI_WriteInt(ServerData, INI_Server_Info[14][isName], 0);
  9137. S_DATA[AdminChat] = 0;
  9138. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Advertising",\
  9139. ""W"Feature "ORAN"\"Bloch Admin Chat\""W" has been disabled!\n\
  9140. Only Administrators and Owners will be able to Admin Chat", "Back", "");
  9141. }
  9142. case 6:
  9143. {
  9144. INI_WriteInt(ServerData, INI_Server_Info[15][isName], 0);
  9145. S_DATA[VipChat] = 0;
  9146. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Advertising",\
  9147. ""W"Feature "ORAN"\"Block VIP Chat\""W" has been disabled!\n\
  9148. VIP members won't be able to chat trough VIP Chat.", "Back", "");
  9149. }
  9150. case 7:
  9151. {
  9152. cmd_acp(playerid, "");
  9153. }
  9154. }
  9155. INI_Close(ServerData);
  9156. }
  9157. }
  9158.  
  9159. switch(dialogid)
  9160. {
  9161. CaseDialog<Register1> if(response)RegisterPlayer(playerid, Dialog:Register1, inputtext);
  9162. CaseDialog<Login>
  9163. {
  9164. #if SECURITY_QUESTION == true
  9165.  
  9166. SPD(playerid, Dialog:Login2, INPUT, ""W"Account login", ""W"Please write your password!", "Login", "Forg. Pass");
  9167.  
  9168. #else
  9169.  
  9170. SPD(playerid, Dialog:Login2, INPUT, ""W"Account login", ""W"Please write your password!", "Login", "Kick");
  9171.  
  9172. #endif
  9173. }
  9174. CaseDialog<Register>
  9175. {
  9176. if(! response) return KickEx(playerid, .zReason = "Not registering", .tell = true);
  9177.  
  9178. if(strlen(inputtext))
  9179. {
  9180. if(strlen(inputtext) < MIN_PASS_LEN || strlen(inputtext) > MAX_PASS_LEN)
  9181. return ShowPlayerDialog
  9182. (
  9183. playerid,
  9184. Dialog:Register,
  9185. DIALOG_STYLE_INPUT,
  9186. ""W"Register an account",
  9187. ""ORAN"ERROR:"W" An error has occured while trying to register the account, please try again!!\n\n\
  9188. Please write your desired password.", "Register", "Kick");
  9189.  
  9190. #if SECURITY_QUESTION == false
  9191.  
  9192. RegisterPlayer(playerid, Dialog:Register, inputtext);
  9193.  
  9194. #else
  9195.  
  9196. SetPVarString(playerid, "TempPass", inputtext);
  9197. SPD(playerid, Dialog:SQuestion, INPUT, ""W"Secret Question", ""W"Please write your secret question!\nThis secret question will be used later\nwhen you want to retrieve your password!", "Insert", "");
  9198.  
  9199. #endif
  9200. }
  9201. else
  9202. {
  9203. new zStr[256];
  9204. format(zStr, sizeof (zStr), "{FF0000}Please write a password!\n\n"W"Please write your desired password", Name(playerid), GetServerHostName());
  9205. ShowPlayerDialog(playerid, Dialog:Register, DIALOG_STYLE_INPUT, ""W"Register an account", zStr, "Register", "Kick");
  9206. }
  9207. }
  9208. CaseDialog<SQuestion>
  9209. {
  9210. if(response || !response)
  9211. {
  9212. if(strlen(inputtext))
  9213. {
  9214. if(strlen(inputtext) > 10 && strlen(inputtext) < 90)
  9215. {
  9216. if(strfind(inputtext, "?", true) != -1)
  9217. {
  9218. SetPVarString(playerid, "Question", inputtext);
  9219. new Str[190];
  9220. format(Str, 190, ""W"Your secret question is:\n "BLUE"%s\n\n"W"Please insert the answer:", inputtext);
  9221. SPD(playerid, Dialog:SAnswer, INPUT, ""W"Secret Answer",Str, "Insert", "Back");
  9222. }
  9223. else SPD(playerid, Dialog:SQuestion, INPUT, ""W"Secret Question", ""ORAN"That was not a question! Try again!\n\n"W"Please write your secret question!\nThis secret question will be used later\nwhen you want to retrieve your password!", "Insert", "");
  9224. }
  9225. else SPD(playerid, Dialog:SQuestion, INPUT, ""W"Secret Question", ""ORAN"Insert a longer question!\n\n"W"Please write your secret question!\nThis secret question will be used later\nwhen you want to retrieve your password!", "Insert", "");
  9226. }
  9227. else SPD(playerid, Dialog:SQuestion, INPUT, ""W"Secret Question", ""ORAN"Insert a longer question!\n\n"W"Please write your secret question!\nThis secret question will be used later\nwhen you want to retrieve your password!", "Insert", "");
  9228. }
  9229. }
  9230. CaseDialog<SAnswer2>
  9231. {
  9232. RegisterPlayer(playerid, Dialog:Register1, GPVSEx(playerid, "TempPass"));
  9233. }
  9234. CaseDialog<SAnswer>
  9235. {
  9236. if(response)
  9237. {
  9238. new Str[190];
  9239. if(strlen(inputtext))
  9240. {
  9241. if(strlen(inputtext) > 4 && strlen(inputtext) < 90)
  9242. {
  9243. SetPVarString(playerid, "Answer", inputtext);
  9244.  
  9245. format(Str, 190, ""W"Process finished!\n\n"W"QUESTION: "BLUE"%s\n"W"ANSWER: "BLUE"%s"W"\n\n{FF0000}REMEMBER THE ANSWER!!\n"GREY"Procees with login.", GPVSEx(playerid, "Question"),inputtext);
  9246. SPD(playerid, Dialog:SAnswer2, BOX, ""W"Account login",Str, "Continue", "");
  9247.  
  9248. format(Query, 200, "UPDATE `Accounts` SET `Question` = '%s', `Answer` = '%s' WHERE `Name` = '%s'", GPVSEx(playerid, "Question"), inputtext, Name(playerid));
  9249. DB::Query(_DB, Query);
  9250. }
  9251. else
  9252. {
  9253. format(Str, 190, ""ORAN"Insert a longer answer!\n\n"W"Your secret question is:\n"BLUE"%s\n\n"W"Please insert the answer:", GPVSEx(playerid, "Question"));
  9254. SPD(playerid, Dialog:SAnswer, INPUT, ""W"Secret Answer",Str, "Insert", "Back");
  9255. }
  9256. }
  9257. else
  9258. {
  9259. format(Str, 190, ""ORAN"Insert a longer answer!\n\n"W"Your secret question is:\n"BLUE"%s\n\n"W"Please insert the answer:", GPVSEx(playerid, "Question"));
  9260. SPD(playerid, Dialog:SAnswer, INPUT, ""W"Secret Answer",Str, "Insert", "Back");
  9261. }
  9262. }
  9263. else
  9264. {
  9265. DeletePVar(playerid, "Question");
  9266. SPD(playerid, Dialog:SQuestion, INPUT, ""W"Secret Question", ""W"Please write your secret question!\nThis secret question will be used later\nwhen you want to retrieve your password!", "Insert", "");
  9267. }
  9268. }
  9269. CaseDialog<Login2>
  9270. {
  9271. if(response)
  9272. {
  9273. if(strlen(inputtext))LoginPlayer(playerid, inputtext);
  9274. else
  9275. {
  9276. #if SECURITY_QUESTION == true
  9277.  
  9278. SPD(playerid, Dialog:Login2, INPUT, ""W"Account login", ""ORAN"ERROR:"W" No password entered!\n\n"W"Please write your password!", "Login", "Forg. Pass");
  9279.  
  9280. #else
  9281.  
  9282. SPD(playerid, Dialog:Login2, INPUT, ""W"Account login", ""ORAN"ERROR:"W" No password entered!\n\n"W"Please write your password!", "Login", "Kick");
  9283.  
  9284. #endif
  9285. }
  9286.  
  9287. }
  9288. else
  9289. {
  9290. #if SECURITY_QUESTION == true
  9291.  
  9292. SPD(playerid, Dialog:ForgPass, INPUT, ""W"Forgot Password", ""W"Please insert the answer to your secret question for password retrival", "Insert", "Back");
  9293.  
  9294. #else
  9295.  
  9296. KickEx(playerid, "System", "Not logging in");
  9297.  
  9298. #endif
  9299. }
  9300. }
  9301. CaseDialog<ForgPass>
  9302. {
  9303. if(response)
  9304. {
  9305. if(strlen(inputtext))
  9306. {
  9307. new DBResult:Result;
  9308. format(Query, 200, "SELECT `Question`, `Answer`, `RPassword` FROM `Accounts` WHERE `Name` = '%s';", Name(playerid));
  9309. Result = DB::Query(_DB, Query);
  9310.  
  9311. if(Result)
  9312. {
  9313. if(DB::Valid(Result))
  9314. {
  9315. new Field[129];
  9316.  
  9317. DB::GetField(Result, "Answer", Field, sizeof(Field));
  9318. SetPVarString(playerid, "TempAnswer", Field);
  9319.  
  9320. DB::GetField(Result, "Question", Field, sizeof(Field));
  9321. SetPVarString(playerid, "Question", Field);
  9322.  
  9323. if(!strcmp(GPVSEx(playerid, "TempAnswer"), inputtext, false))
  9324. {
  9325. DB::GetField(Result, "RPassword", Field, sizeof(Field));
  9326.  
  9327. new Str[100];
  9328. format(Str, 100, ""W"The answer is correct!\n\nYour password is:"BLUE" %s", Field);
  9329. SPD(playerid, Dialog:Login2, INPUT, ""W"Correct answer!", "You answered correct to your question:\n"BLUE"%s\n\n\nPlease insert your password to continue!", "Login", "");
  9330.  
  9331. DB::Free(Result);
  9332.  
  9333. DeletePVar(playerid, "TempAnswer");
  9334. }
  9335. else
  9336. {
  9337. DB::Free(Result);
  9338. SPD(playerid, Dialog:ForgPass, INPUT, ""W"Forgot Password", "{FF0000}Incorrect answer! Try again!\n\n"W"Please insert the answer to your secret question for password retrival", "Insert", "Back");
  9339. }
  9340. }
  9341. }
  9342. }else SPD(playerid, Dialog:ForgPass, INPUT, ""W"Forgot Password", ""W"Please insert the answer to your secret question for password retrival", "Insert", "Back");
  9343. }
  9344. else
  9345. {
  9346. #if SECURITY_QUESTION == true
  9347.  
  9348. SPD(playerid, Dialog:Login2, INPUT, ""W"Account login", ""W"Please write your password!", "Login", "Forg. Pass");
  9349.  
  9350. #else
  9351.  
  9352. SPD(playerid, Dialog:Login2, INPUT, ""W"Account login", ""W"Please write your password!", "Login", "Kick");
  9353.  
  9354. #endif
  9355. }
  9356.  
  9357. }
  9358.  
  9359. CaseDialog<Login3>
  9360. {
  9361. if(response)
  9362. {
  9363. if(strlen(inputtext)) LoginPlayer(playerid, inputtext);
  9364. else
  9365. {
  9366. #if SECURITY_QUESTION == true
  9367.  
  9368. SPD(playerid, Dialog:Login3, INPUT, ""W"Account login", ""ORAN"ERROR:"W" No password entered!\n\n"W"Please write your password!", "Login", "Forg. Pass");
  9369.  
  9370. #else
  9371.  
  9372. SPD(playerid, Dialog:Login3, INPUT, ""W"Account login", ""ORAN"ERROR:"W" No password entered!\n\n"W"Please write your password!", "Login", "Kick");
  9373.  
  9374. #endif
  9375. }
  9376. }
  9377. }
  9378. }
  9379. return 0;
  9380. }
  9381.  
  9382. Public:dLabel(InV) return DeletePlayer3DTextLabel(InV, ZaAdminCar[InV]);
  9383. Public:UnlimitedNos(playerid)AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
  9384.  
  9385. Public:LoadAKA(playerid, name[], value[])
  9386. {
  9387. new pIP[30];
  9388. GetPlayerIp(playerid, pIP, 30);
  9389. if(!strcmp(name, pIP)) SetPVarString(playerid, "pAKA", value);
  9390. }
  9391. Public:PingKick()
  9392. {
  9393. foreach(Player, i)
  9394. {
  9395. if(S_DATA[Ping] != 0)
  9396. {
  9397. if(GetPlayerPing(i) > S_DATA[Ping] && P_DATA[i][Level] < IPGKICK)
  9398. {
  9399. new Str[30];
  9400. format(Str, sizeof (Str), "Exceeding Ping Limit of %d", S_DATA[Ping]);
  9401. KickEx(i, .zAdmin = "System", .zReason = Str, .tell = true);
  9402. }
  9403. }
  9404. }
  9405. }
  9406. Public:BlockChat(playerid)
  9407. {
  9408. if(S_DATA[Chat]) return SendError(playerid, "Chat already blocked!");
  9409. S_DATA[Chat] = 1;
  9410. SendAdminCMD(-1, "Admin "ORAN"%s[%i]"GREY" blocked the chat.", Name(playerid), playerid);
  9411. SendClientMessage(playerid, Color:GREY, "You blocked the chat.");
  9412.  
  9413. foreach(Player, i)
  9414. {
  9415. if(P_DATA[i][Level] <= 0)
  9416. {
  9417. SendClientMessage(i, -1, "- * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *");
  9418. FormatMSG(i, -1, "Chat has been disabled by the Owner: %s", Name(playerid));
  9419. SendClientMessage(i, -1, "- * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *");
  9420. }
  9421. }
  9422. return 1;
  9423. }
  9424.  
  9425. Public:JailPlayer(playerid)
  9426. {
  9427. KillTimer(JailTimer[playerid]);
  9428.  
  9429. UnFreeze(playerid);
  9430.  
  9431. SetPlayerPos(playerid, 197.6661, 173.8179, 1003.0234);
  9432. SetPlayerInterior(playerid,3);
  9433. SetCameraBehindPlayer(playerid);
  9434.  
  9435. if(P_DATA[playerid][Frozen])
  9436. {
  9437. Freeze(playerid);
  9438. }
  9439. JailTimer[playerid] = SetTimerEx("UnjailPlayer", 60_000, true, "d", playerid);
  9440. P_DATA[playerid][Jailed] = 1;
  9441. }
  9442. Public:UnjailPlayer(playerid)
  9443. {
  9444.  
  9445. --P_DATA[playerid][JailTime];
  9446.  
  9447.  
  9448. if(!P_DATA[playerid][JailTime])
  9449. {
  9450. KillTimer(JailTimer[playerid]);
  9451. UnjailPlayer(playerid);
  9452.  
  9453. P_DATA[playerid][Jailed] = 0;
  9454. P_DATA[playerid][JailTime] = 0;
  9455.  
  9456. SetPlayerInterior(playerid, 0);
  9457. SetPlayerPos(playerid, 0.0, 0.0, 0.0);
  9458. PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
  9459.  
  9460. SpawnPlayer(playerid);
  9461. SendClientMessage(playerid, Color:ORAN, "SERVER:"W" You have been un-jailed by the system!");
  9462.  
  9463. #if SAVE_JAIL == true
  9464. new
  9465. Query[256];
  9466. format(Query, 256, "DELETE FROM `Jailed` WHERE `IP` = '%s'", GetPlayerIPEx(playerid));
  9467. DB::Query(_DB, Query);
  9468. #endif
  9469. }
  9470. else if(P_DATA[playerid][JailTime] == 1){
  9471. GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~b~~h~JAIL INFO~n~~b~~h~One~w~ minute left", 10000, 3);}
  9472.  
  9473. else if(P_DATA[playerid][JailTime] > 1)
  9474. {
  9475. new Str[129];
  9476. format(Str, 129, "~n~~n~~n~~n~~n~~n~~b~~h~JAIL INFO~n~~b~~h~%d~w~ minutes left", P_DATA[playerid][JailTime]);
  9477. GameTextForPlayer(playerid, Str, 10000, 3);
  9478. }
  9479.  
  9480. return 1;
  9481. }
  9482.  
  9483. PcPanel(playerid)
  9484. {
  9485.  
  9486. new Str[2_0_0_0];
  9487.  
  9488. format(Str, sizeof (Str), ""ORAN"Exit cPanel\n\
  9489. "W"Auto-Login\t\t%s\n\
  9490. "W"Block PMs\t\t%s\n\
  9491. "W"My stats",
  9492. (S_DATA[AutoLogin] && P_DATA[playerid][pAuto]) ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9493. P_DATA[playerid][BAPMs] ? (""GREE"Enabled") : (""ORAN"Disabled"));
  9494.  
  9495. switch(P_DATA[playerid][Vip])
  9496. {
  9497. case 1:
  9498. {
  9499. format(Str, sizeof (Str), "%s\n"BLUE"VIP LEVEL 1\n\
  9500. "W"Godlike\t\t%s\n\
  9501. "W"Vehicle God\t\t%s\n\
  9502. "W"Vehicle Boost\t\t%s\n\
  9503. "W"Wear VIP Tag\t\t%s",
  9504. Str,
  9505. P_DATA[playerid][God] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9506. P_DATA[playerid][CarGod] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9507. P_DATA[playerid][Boost] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9508. P_DATA[playerid][VIPTag] ? (""GREE"Enabled") : (""ORAN"Disabled"));
  9509. }
  9510. case 2:
  9511. {
  9512. format(Str, sizeof (Str), "%s\n"BLUE"VIP LEVEL 1\n\
  9513. "W"Godlike\t\t\t%s\n\
  9514. "W"Vehicle God\t\t%s\n\
  9515. "W"Vehicle Boost\t\t%s\n\
  9516. "W"Wear VIP Tag\t\t%s\n\
  9517. "BLUE"VIP LEVEL 2\n\
  9518. "W"Vehicle Spin\t\t%s\n\
  9519. "W"Incredible\t\t%s",
  9520. Str,
  9521. P_DATA[playerid][God] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9522. P_DATA[playerid][CarGod] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9523. P_DATA[playerid][Boost] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9524. P_DATA[playerid][VIPTag] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9525. P_DATA[playerid][Spin] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9526. P_DATA[playerid][Incred] ? (""GREE"Enabled") : (""ORAN"Disabled"));
  9527. }
  9528. case 3:
  9529. {
  9530. format(Str, sizeof (Str), "%s\n"BLUE"VIP LEVEL 1\n\
  9531. "W"Godlike\t\t\t%s\n\
  9532. "W"Vehicle God\t\t%s\n\
  9533. "W"Vehicle Boost\t\t%s\n\
  9534. "W"Wear VIP Tag\t\t%s\n\
  9535. "BLUE"VIP LEVEL 2\n\
  9536. "W"Vehicle Spin\t\t%s\n\
  9537. "W"Incredible\t\t%s\n\
  9538. "BLUE"VIP LEVEL 3\n\
  9539. "W"Shout",
  9540. Str,
  9541. P_DATA[playerid][God] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9542. P_DATA[playerid][CarGod] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9543. P_DATA[playerid][Boost] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9544. P_DATA[playerid][VIPTag] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9545. P_DATA[playerid][Spin] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9546. P_DATA[playerid][Incred] ? (""GREE"Enabled") : (""ORAN"Disabled"));
  9547. }
  9548. }
  9549. return Str;
  9550. }
  9551. cPanel()
  9552. {
  9553. new PingString[50], Str[1024];
  9554. if(S_DATA[Ping] != 0) format(PingString, sizeof (PingString), ""GREE"Enabled"W"\tPing Limit: "ORAN"%d", S_DATA[Ping]); else PingString = ""ORAN"Disabled";
  9555. format(Str, sizeof (Str), ""W"Anti Spam\t\t%s\n\
  9556. "W"Anti Command Spam\t%s\n\
  9557. "W"Ping Kicker\t\t%s\n\
  9558. "W"RCON Protection\t%s\n\
  9559. "W"Tell Player\t\t%s\n\
  9560. "W"Chat\t\t\t%s\n\
  9561. "W"Read Commands\t%s\n\
  9562. "W"Read PMs\t\t%s\n\
  9563. "W"AKA\t\t\t%s\n\
  9564. "GREY"..: Page 2\n\
  9565. "ORAN"..: Exit",
  9566. S_DATA[AntiSpam] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9567. S_DATA[AntiCSpam] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9568. PingString,
  9569. S_DATA[RCONProt] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9570. S_DATA[TellPlayer] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9571. S_DATA[Chat] ? (""ORAN"Blocked") : (""GREE"Free to chat"),
  9572. S_DATA[ReadPM] ? (""GREE"Reading") : (""ORAN"Not Reading"),
  9573. S_DATA[ReadCMD] ? (""GREE"Reading") : (""ORAN"Not Reading"),
  9574. S_DATA[AKA] ? (""GREE"Enabled") : (""ORAN"Disabled"));
  9575.  
  9576.  
  9577.  
  9578. return Str;
  9579. }
  9580. cPanel2()
  9581. {
  9582. new Str[512];
  9583. format(Str, sizeof (Str), ""W"Show Function\t\t%s\n\
  9584. "W"Anti Message Repeat\t%s\n\
  9585. "W"Autologin\t\t%s\n\
  9586. "W"Announce Rank-Up\t%s\n\
  9587. "W"Anti Advertising\t%s\n\
  9588. "W"Admin Chat\t\t%s\n\
  9589. "W"VIP Chat\t\t%s\n\
  9590. "GREY"..: Back\n\
  9591. "ORAN"..: Exit",
  9592. S_DATA[ShowFunction] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9593. S_DATA[AntiRepeat] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9594. S_DATA[AutoLogin] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9595. S_DATA[AnnRank] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9596. S_DATA[AntiAD] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9597. S_DATA[AdminChat] ? (""GREE"Allowed") : (""ORAN"Not Allowed"),
  9598. S_DATA[VipChat] ? (""GREE"Allowed") : (""ORAN"Not Allowed"));
  9599.  
  9600.  
  9601.  
  9602. return Str;
  9603. }
  9604. OnlineCheck(type[], C)
  9605. {
  9606. new cS[126];
  9607. if(!strcmp(type, "Admins"))
  9608. {
  9609. if(C > 1) format(cS, sizeof (cS), ""W"There are "BLUE"%d"W" Administrators online!\n\n", C);
  9610. else format(cS, sizeof (cS), ""W"There is only "BLUE"1"W" Administrator online!\n\n");
  9611. }
  9612. else if(!strcmp(type, "Vips"))
  9613. {
  9614. if(C > 1) format(cS, sizeof (cS), ""W"There are "BLUE"%d"W" VIP Members online!\n\n", C);
  9615. else format(cS, sizeof (cS), ""W"There is only "BLUE"1"W" VIP Member online!\n\n");
  9616. }
  9617. else if(!strcmp(type, "Jailed"))
  9618. {
  9619. if(C > 1) format(cS, sizeof (cS), ""W"There are "BLUE"%d"W" Jailed players online!\n\n", C);
  9620. else format(cS, sizeof (cS), ""W"There is only "BLUE"1"W" Jailed player online!\n\n");
  9621. }
  9622. else if(!strcmp(type, "Muted"))
  9623. {
  9624. if(C > 1) format(cS, sizeof (cS), ""W"There are "BLUE"%d"W" Muted players online!\n\n", C);
  9625. else format(cS, sizeof (cS), ""W"There is only "BLUE"1"W" Muted player online!\n\n");
  9626. }
  9627. else if(!strcmp(type, "Frozen"))
  9628. {
  9629. if(C > 1) format(cS, sizeof (cS), ""W"There are "BLUE"%d"W" Frozen players online!\n\n", C);
  9630. else format(cS, sizeof (cS), ""W"There is only "BLUE"1"W" Frozen player online!\n\n");
  9631. }
  9632. return cS;
  9633. }
  9634. Public: LowerSpam()
  9635. {
  9636. foreach(Player, playerid)
  9637. {
  9638. if(P_DATA[playerid][SpamMSG] > 0) P_DATA[playerid][SpamMSG]--;
  9639. if(P_DATA[playerid][cSpam] > 0) P_DATA[playerid][cSpam]--;
  9640. }
  9641. }
  9642.  
  9643. fNMB(nmb)
  9644. {
  9645. new Str[4];
  9646. format(Str, sizeof (Str), "%d", nmb);
  9647. return Str;
  9648. }
  9649.  
  9650.  
  9651. FormatStats(playerid)
  9652. {
  9653. #if USE_RANKS == true
  9654. format(StatsString, sizeof (StatsString), "\n"W"Viewing %s\n\n\
  9655. "W"Level: "ORAN"%s\n\
  9656. "W"Vip: "ORAN"%s\n\
  9657. "W"Kills: "ORAN"%d\n\
  9658. "W"Deaths: "ORAN"%d\n\
  9659. "W"Ratio: "ORAN"%.3f\n\
  9660. "W"Rank: "ORAN"%s\n\
  9661. "W"Cookies: "ORAN"%d\n\
  9662. "W"Respect: "GREE"+%d"W"/"ORAN"-%d\n",
  9663. WhosStats,
  9664. LevelName(GetPVarInt(playerid, "0_Level")),
  9665. (GetPVarInt(playerid, "0_Vip")) ? (fNMB(GetPVarInt(playerid, "0_Vip"))) : ("NO!"),
  9666. GetPVarInt(playerid, "0_Kills"),
  9667. GetPVarInt(playerid, "0_Deaths"),
  9668. (Float:GetPVarInt(playerid, "0_Kills") / Float:GetPVarInt(playerid, "0_Deaths")),
  9669. RankName(GetPVarInt(playerid, "0_Rank")),
  9670. GetPVarInt(playerid, "0_Cookies"),
  9671. GetPVarInt(playerid, "0_Positive"),
  9672. GetPVarInt(playerid, "0_Negative"));
  9673. #else
  9674. format(StatsString, sizeof (StatsString), "\n"W"Viewing %s\n\n\
  9675. "W"Level: "ORAN"%s\n\
  9676. "W"Vip: "ORAN"%s\n\
  9677. "W"Kills: "ORAN"%d\n\
  9678. "W"Deaths: "ORAN"%d\n\
  9679. "W"Ratio: "ORAN"%.3f\n\
  9680. "W"Cookies: "ORAN"%d\n\
  9681. "W"Respect: "GREE"+%d"W"/"ORAN"-%d\n",
  9682. WhosStats,
  9683. LevelName(GetPVarInt(playerid, "0_Level")),
  9684. (GetPVarInt(playerid, "0_Vip")) ? (fNMB(GetPVarInt(playerid, "0_Vip"))) : ("NO!"),
  9685. GetPVarInt(playerid, "0_Kills"),
  9686. GetPVarInt(playerid, "0_Deaths"),
  9687. (Float:GetPVarInt(playerid, "0_Kills") / Float:GetPVarInt(playerid, "0_Deaths")),
  9688. GetPVarInt(playerid, "0_Cookies"),
  9689. GetPVarInt(playerid, "0_Positive"),
  9690. GetPVarInt(playerid, "0_Negative"));
  9691. #endif
  9692. format(StatsString, sizeof (StatsString), "%s\
  9693. "W"Money: "ORAN"%d\n\
  9694. "W"Score: "ORAN"%d\n\
  9695. "W"Online: "ORAN"%s\n\
  9696. "W"Commands: "ORAN"%d\n\
  9697. "W"Fail Cmds: "ORAN"%d\n\
  9698. "W"Messages: "ORAN"%d\n\
  9699. "W"Kicks: "ORAN"%d\n\
  9700. "W"Account date: "ORAN"%s\n\
  9701. "W"Account ID: "ORAN"%d\n\n",
  9702. StatsString,
  9703. GetPlayerMoney(playerid),
  9704. GetPlayerScore(playerid),
  9705. FormatOnline(playerid),
  9706. P_DATA[playerid][Cmds],
  9707. P_DATA[playerid][fCmds],
  9708. P_DATA[playerid][Msgs],
  9709. P_DATA[playerid][Kicks],
  9710. GPVSEx(playerid, "AccountDate"),
  9711. P_DATA[playerid][AccID]);
  9712. return 1;
  9713. }
  9714. #if USE_RANKS == true
  9715. RankName(rank) return _RankNames[rank];
  9716.  
  9717. #endif
  9718. LevelName(iLevel)
  9719. {
  9720. new zLevel[35];
  9721. if (iLevel == 0) format(zLevel, 35, "%s", _Levels[0]);
  9722. else if(iLevel == 1) format(zLevel, 35, "%s", _Levels[1]);
  9723. else if(iLevel == 2) format(zLevel, 35, "%s", _Levels[2]);
  9724. else if(iLevel == 3) format(zLevel, 35, "%s", _Levels[3]);
  9725. else if(iLevel == 4) format(zLevel, 35, "%s", _Levels[4]);
  9726. else if(iLevel >= 5) format(zLevel, 35, "%s", _Levels[5]);
  9727. else zLevel = "<< Error >>";
  9728. return zLevel;
  9729. }
  9730.  
  9731. LoginPlayer(playerid, const pPass[], pAutoLogin = false)
  9732. {
  9733.  
  9734. new Buf[129], Query[280], DBResult:Result;
  9735. WP_Hash(Buf, (129), pPass);
  9736.  
  9737. format(Query, 280, "SELECT `Key` FROM `Accounts` WHERE `Name` = '%s' AND `Password` = '%s'", Name(playerid), Buf);
  9738. Result = DB::Query(_DB, Query);
  9739.  
  9740. if(Result)
  9741. {
  9742. if(DB::Valid(Result))
  9743. {
  9744. DB::Free(Result);
  9745. new Accp_String[16], Accp_Vars[6], Str[256];
  9746.  
  9747. LoadPlayerData(playerid);
  9748. P_DATA[playerid][Logged] = 1;
  9749.  
  9750.  
  9751. sscanf(GPVSEx(playerid, "Online"), "p<:>iii", P_DATA[playerid][Hours],P_DATA[playerid][Minutes],P_DATA[playerid][Seconds]);
  9752.  
  9753. if(!sscanf(GPVSEx(playerid, "ACCP_DATA"), "p<:>s[16]iiiiii",Accp_String,
  9754. Accp_Vars[0],
  9755. Accp_Vars[1],
  9756. Accp_Vars[2],
  9757. Accp_Vars[3],
  9758. Accp_Vars[4],
  9759. Accp_Vars[5]))
  9760. {
  9761. SetPVarString(playerid, "Type", Accp_String);
  9762. P_DATA[playerid][A_Component1] = Accp_Vars[0];
  9763. P_DATA[playerid][A_Component2] = Accp_Vars[1];
  9764. P_DATA[playerid][A_Component3] = Accp_Vars[2];
  9765. P_DATA[playerid][A_Component4] = Accp_Vars[2];
  9766. P_DATA[playerid][A_Wheels] = Accp_Vars[3];
  9767. P_DATA[playerid][A_Color] = Accp_Vars[4];
  9768. }
  9769. else
  9770. {
  9771. SetPVarString(playerid, "Type", "None");
  9772. P_DATA[playerid][A_Component1] = 0;
  9773. P_DATA[playerid][A_Component2] = 0;
  9774. P_DATA[playerid][A_Component3] = 0;
  9775. P_DATA[playerid][A_Component4] = 0;
  9776. P_DATA[playerid][A_Wheels] = 0;
  9777. P_DATA[playerid][A_Color] = 0;
  9778. }
  9779. SetPVarInt(playerid, "0_Level", P_DATA[playerid][Level]);
  9780. SetPVarInt(playerid, "0_Vip", P_DATA[playerid][Vip]);
  9781. SetPVarInt(playerid, "0_Kills", P_DATA[playerid][Kills]);
  9782. SetPVarInt(playerid, "0_Deaths", P_DATA[playerid][Deaths]);
  9783. SetPVarInt(playerid, "0_Messages", P_DATA[playerid][Msgs]);
  9784. SetPVarInt(playerid, "0_Commands", P_DATA[playerid][Cmds]);
  9785. SetPVarInt(playerid, "0_Fail_Commands", P_DATA[playerid][fCmds]);
  9786. SetPVarInt(playerid, "0_Cookies", P_DATA[playerid][Cookies]);
  9787. SetPVarInt(playerid, "0_God", P_DATA[playerid][God]);
  9788. SetPVarInt(playerid, "0_CarGod", P_DATA[playerid][CarGod]);
  9789. SetPVarInt(playerid, "0_Positive", P_DATA[playerid][Positive]);
  9790. SetPVarInt(playerid, "0_Negative", P_DATA[playerid][Negative]);
  9791. SetPVarInt(playerid, "0_Rank", P_DATA[playerid][Rank]);
  9792.  
  9793.  
  9794. if(!pAutoLogin)
  9795. {
  9796.  
  9797. if(P_DATA[playerid][Level] > 0 && P_DATA[playerid][Vip] > 0)
  9798. {
  9799. format(Str, sizeof (Str), ""W"Welcome "ORAN"%s.\n\n"W"-------------------\nAdmin: "ORAN"%s\n"W"VIP: "ORAN"%d",Name(playerid), LevelName(P_DATA[playerid][Level]), P_DATA[playerid][Vip]);
  9800. if(P_DATA[playerid][VIPTag])
  9801. {
  9802. Delete3DTextLabel(P_DATA[playerid][Tag3D]);
  9803. P_DATA[playerid][Tag3D] = Create3DTextLabel("VIP Member", Color:BLUE, 0.0, 0.0, 0.0, 90.0, 0, 1);
  9804.  
  9805. }
  9806. }
  9807. else if(P_DATA[playerid][Level] > 0 && P_DATA[playerid][Vip] <= 0)
  9808. format(Str, sizeof (Str), ""W"Welcome "ORAN"%s.\n\n"W"-------------------\nAdmin: "ORAN"%s",Name(playerid), LevelName(P_DATA[playerid][Level]));
  9809.  
  9810. else if(P_DATA[playerid][Level] <= 0 && P_DATA[playerid][Vip] > 0)
  9811. {
  9812. format(Str, sizeof (Str), ""W"Welcome "ORAN"%s.\n\n"W"-------------------\nVIP: "ORAN"%d",Name(playerid), P_DATA[playerid][Vip]);
  9813.  
  9814. if(P_DATA[playerid][VIPTag])
  9815. {
  9816. Delete3DTextLabel(P_DATA[playerid][Tag3D]);
  9817. P_DATA[playerid][Tag3D] = Create3DTextLabel("VIP Member", Color:BLUE, 0.0, 0.0, 0.0, 90.0, 0, 1);
  9818.  
  9819. }
  9820. }
  9821. else if(P_DATA[playerid][Level] == 0 && P_DATA[playerid][Vip] == 0)
  9822. format(Str, sizeof (Str), ""W"Welcome "ORAN"%s.\n\n"W"-------------------",Name(playerid));
  9823.  
  9824. format(Str, sizeof (Str), "%s\n"W"Online: "ORAN"%s\n"W"Kills: "ORAN"%d\n"W"Deaths: "ORAN"%d"W"\n-------------------\n",
  9825. Str,
  9826. FormatOnline(playerid),
  9827. P_DATA[playerid][Kills],
  9828. P_DATA[playerid][Deaths]);
  9829.  
  9830. SPD(playerid, 9000, BOX, ""W"Succesfully logged in!", Str, "Close", "");
  9831. }
  9832. else
  9833. {
  9834. format(Str, sizeof (Str), ""BLUE"Auto-Login:\n\n"W"You have been succesfully logged in by the system!\nYou can disable the Auto-Login from the cPanel("BLUE"/PCP"W")");
  9835. SPD(playerid, 9000, BOX, ""W"Succesfully logged in!", Str, "Close", "");
  9836. }
  9837. }
  9838. else
  9839. {
  9840. --P_DATA[playerid][LogFail];
  9841.  
  9842. new zStr[256];
  9843.  
  9844. if(P_DATA[playerid][LogFail] != 0)
  9845. {
  9846. format(zStr, sizeof (zStr), ""ORAN"ERROR:"W" Wrong password! You have "ORAN"%d"W" tries left!\n\n"W"Please write your password!", P_DATA[playerid][LogFail]);
  9847.  
  9848. #if SECURITY_QUESTION == true
  9849.  
  9850. SPD(playerid, Dialog:Login2, INPUT, ""W"Account login error", zStr, "Login", "Forg. Pass");
  9851.  
  9852. #else
  9853.  
  9854. SPD(playerid, Dialog:Login2, INPUT, ""W"Account login error", zStr, "Login", "Kick");
  9855.  
  9856. #endif
  9857. }
  9858. else if(P_DATA[playerid][LogFail] <= 0)
  9859. {
  9860. GameTextForPlayer(playerid, "~r~Kicked from the server~n~~w~REASON: ~g~Exceeding login fails.", 60000, 3);
  9861. KickEx(playerid, .zReason = "Exceeding login tries", .tell = true);
  9862. }
  9863. }
  9864. }
  9865. }
  9866.  
  9867. CMD:mutecheck(PARAMS)
  9868. {
  9869. if(!P_DATA[playerid][Muted]) return SendClientMessage(playerid, Color:ORAN, "SERVER: "W"You are not muted!");
  9870.  
  9871. if(P_DATA[playerid][MutedTime] > 0)
  9872. {
  9873. FormatMSG(playerid, Color:ORAN, "SERVER:"W" You will be unmuted after "ORAN"%d"W" seconds!", P_DATA[playerid][MutedTime]);
  9874. }
  9875. else if(P_DATA[playerid][MutedTime] == 0)
  9876. {
  9877. SendClientMessage(playerid, Color:ORAN, "SERVER:"W" You will never be unmuted automatically! (Even after connect!)");
  9878. }
  9879. return 1;
  9880. }
  9881.  
  9882. Public:GodLike()
  9883. {
  9884. foreach(Player, i)
  9885. {
  9886. if(GetPVarInt(i, "0_God") == 1 || P_DATA[i][God])
  9887. {
  9888. new Float: H;
  9889. GetPlayerHealth(i, H);
  9890. if(H < 300) SetPlayerHealth(i, 9999);
  9891. }
  9892. if(GetPVarInt(i, "0_CarGod") == 1 || P_DATA[i][CarGod])
  9893. {
  9894. if(IsPlayerInAnyVehicle(i))
  9895. {
  9896. SetVehicleHealth(GetPlayerVehicleID(i), 1000);
  9897. RepairVehicle(GetPlayerVehicleID(i));
  9898. }
  9899. }
  9900. }
  9901. }
  9902. GetPlayerIPEx(playerid)
  9903. {
  9904. new pIP[30];
  9905. GetPlayerIp(playerid, pIP, sizeof(pIP));
  9906. return pIP;
  9907. }
  9908.  
  9909. SavePlayerData(playerid)
  9910. {
  9911. new Query[700];
  9912. if(AccountExist(Name(playerid)))
  9913. {
  9914. format(Query, sizeof(Query), "UPDATE `Accounts` SET \
  9915. `Online` = '%s', \
  9916. `Level` = '%d', \
  9917. `VIP` = '%d', \
  9918. `Rank` = '%d', \
  9919. `Autologin` = '%d', \
  9920. `Money` = '%d', \
  9921. `Score` = '%d', \
  9922. `Kills` = '%d', \
  9923. `Deaths` = '%d', \
  9924. `Cookies` = '%d', \
  9925. `Positive` = '%d', \
  9926. `Negative` = '%d' WHERE `Name` = '%s'",
  9927. FormatOnline(playerid),
  9928. P_DATA[playerid][Level],
  9929. P_DATA[playerid][Vip],
  9930. P_DATA[playerid][Rank],
  9931. P_DATA[playerid][pAuto],
  9932. GetPlayerMoney(playerid),
  9933. GetPlayerScore(playerid),
  9934. P_DATA[playerid][Kills],
  9935. P_DATA[playerid][Deaths],
  9936. P_DATA[playerid][Cookies],
  9937. P_DATA[playerid][Positive],
  9938. P_DATA[playerid][Negative],
  9939. Name(playerid));
  9940. DB::Query(_DB, Query);
  9941. format(Query, sizeof(Query), "UPDATE `Accounts` SET \
  9942. `Messages` = '%d', \
  9943. `Commands` = '%d', \
  9944. `fCommands` = '%d', \
  9945. `Warns` = '%d', \
  9946. `Kicks` = '%d', \
  9947. `God` = '%d', \
  9948. `Cargod` = '%d', \
  9949. `ACCPSav` = '%d', \
  9950. `BlockPM` = '%d', \
  9951. `Boost` = '%d', \
  9952. `bSpeed` = '%f', \
  9953. `WearTag` = '%d', \
  9954. `Incred` = '%d', \
  9955. `Spin` = '%d' WHERE `Name` = '%s'",
  9956. P_DATA[playerid][Msgs],
  9957. P_DATA[playerid][Cmds],
  9958. P_DATA[playerid][fCmds],
  9959. P_DATA[playerid][Warns],
  9960. P_DATA[playerid][Kicks],
  9961. P_DATA[playerid][God],
  9962. P_DATA[playerid][CarGod],
  9963. P_DATA[playerid][Accp_Saved],
  9964. P_DATA[playerid][BAPMs],
  9965. P_DATA[playerid][Boost],
  9966. Float:P_DATA[playerid][bSpeed],
  9967. P_DATA[playerid][VIPTag],
  9968. P_DATA[playerid][Incred],
  9969. P_DATA[playerid][Spin],
  9970. Name(playerid));
  9971. DB::Query(_DB, Query);
  9972. }
  9973. else
  9974. {
  9975. printf("Account: %s doesn't exist! Server tried to save data on it!", Name(playerid));
  9976. }
  9977.  
  9978.  
  9979. format(Query, sizeof (Query),"SELECT `Key` FROM `Top` WHERE `Name` = '%s' LIMIT 1", Name(playerid));
  9980.  
  9981. new DBResult:Q_RESULT;
  9982. Q_RESULT = DB::Query(_DB, Query);
  9983. if(DB::Valid(Q_RESULT))
  9984. {
  9985. DB::Free(Q_RESULT);
  9986. format(Query, sizeof (Query),"UPDATE `Top` SET `Kills` = '%d',`Deaths` = '%d',`Hours` = '%d',`Rank` = '%d',`Ratio` = '%f',`Negative` = '%d',`Positive` = '%d' WHERE `Name` = '%s'",
  9987. P_DATA[playerid][Kills],
  9988. P_DATA[playerid][Deaths],
  9989. P_DATA[playerid][Hours],
  9990. P_DATA[playerid][Rank],
  9991. (Float:P_DATA[playerid][Kills] / Float:P_DATA[playerid][Deaths]),
  9992. P_DATA[playerid][Negative],
  9993. P_DATA[playerid][Positive],
  9994. Name(playerid));
  9995. DB::Free(Q_RESULT);
  9996. DB::Query(_DB, Query);
  9997.  
  9998. }
  9999. else
  10000. {
  10001. format(Query, sizeof (Query), "INSERT INTO `Top` (`Name`,`Kills`,`Deaths`,`Hours`,`Rank`,`Ratio`,`Negative`,`Positive`) VALUES('%s','%d','%d','%d','%d','%f','%d','%d')",
  10002. Name(playerid),
  10003. P_DATA[playerid][Kills],
  10004. P_DATA[playerid][Deaths],
  10005. P_DATA[playerid][Hours],
  10006. P_DATA[playerid][Rank],
  10007. (Float:P_DATA[playerid][Kills] / Float:P_DATA[playerid][Deaths]),
  10008. P_DATA[playerid][Negative],
  10009. P_DATA[playerid][Positive]);
  10010.  
  10011. DB::Query(_DB, Query);
  10012.  
  10013. }
  10014. #if TRACK_ACCOUNTS == true
  10015.  
  10016. new
  10017. Str[24],fStr[2_0_0_0], Player = playerid;
  10018.  
  10019. format(Str, sizeof(Str) + strlen(STATS_LOC), ""#STATS_LOC"%s.ini", Name(Player));
  10020.  
  10021. new
  10022. Online[3];
  10023. TotalGameTime(Player, Online[0], Online[1], Online[2]);
  10024. format(fStr, 2_0_0_0, "Date: %s (saved on disconnect)\r\n------------------------------------------\r\n\
  10025. Registration Date: %s\r\n\
  10026. IP: %s\r\n\
  10027. Account ID: %d\r\n\
  10028. Level: %d\r\n\
  10029. VIP: %d\r\n\
  10030. Rank: %d\r\n\
  10031. Commands Used: %d\r\n\
  10032. Failed Commands: %d\r\n\
  10033. Messages Sent: %d\r\n\
  10034. Cookies: %d\r\n",
  10035. zDate (),
  10036. GPVSEx(Player, "AccountDate"),
  10037. PlayerIP[Player],
  10038. P_DATA[Player][AccID],
  10039. P_DATA[Player][Level],
  10040. P_DATA[Player][Vip],
  10041. P_DATA[Player][Rank],
  10042. P_DATA[Player][Cmds],
  10043. P_DATA[Player][fCmds],
  10044. P_DATA[Player][Msgs],
  10045. P_DATA[Player][Cookies]);
  10046. format(fStr, 2_0_0_0, "%s\
  10047. Online: %d:%d:%d\r\n\
  10048. Respect: %d/-%d\r\n\
  10049. Money: %d\r\n\
  10050. Score: %d\r\n\
  10051. Deaths: %d\r\n\
  10052. Kills: %d\r\n\
  10053. Ratio: %.3f\r\n\
  10054. Kicks Received: %d\r\n",
  10055. fStr,
  10056. Online[0], Online[1], Online[2],
  10057. P_DATA[Player][Positive],
  10058. P_DATA[Player][Negative],
  10059. GetPlayerMoney(Player),
  10060. GetPlayerScore(Player),
  10061. P_DATA[Player][Deaths],
  10062. P_DATA[Player][Kills],
  10063. (Float:P_DATA[Player][Deaths] / Float:P_DATA[Player][Kills]),
  10064. P_DATA[Player][Kicks]);
  10065.  
  10066. new
  10067. File:Stats = fopen(Str, io_append);
  10068.  
  10069. if(Stats)
  10070. {
  10071. if(fexist(Str)) fwrite(Stats, "\r\n\r\n\r\n");
  10072. fwrite(Stats, fStr);
  10073. fclose(Stats);
  10074. }
  10075.  
  10076. #endif
  10077. return 1;
  10078. }
  10079.  
  10080. RegisterPlayer(playerid, returndialog, inputtext[])
  10081. {
  10082. if(!strlen(inputtext) || strlen(inputtext) < MIN_PASS_LEN || strlen(inputtext) > MAX_PASS_LEN)
  10083. return ShowPlayerDialog
  10084. (
  10085. playerid,
  10086. returndialog,
  10087. DIALOG_STYLE_INPUT,
  10088. ""W"Register an account",
  10089. ""ORAN"ERROR:"W" An error has occured while trying to register the account, please try again!!\n\n\
  10090. Please write your desired password.", "Register", "Kick");
  10091.  
  10092. new Buf[129], Query[500], zStr[450];
  10093.  
  10094. WP_Hash(Buf, (129), inputtext);
  10095. format(Query, sizeof(Query), "INSERT INTO `Accounts` \
  10096. VALUES(NULL, '%s', '%s', '%s', '00:00:00', '%s', '0', '0', \
  10097. '0', '0', '2000', '0', '0', '0', '0', '0', '0', \
  10098. '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', \
  10099. '0', '0', '%s', '%s', '%s', '0', '0', '0')", GetPlayerIPEx(playerid), Name(playerid), Buf, zDate(), inputtext, GPVSEx(playerid, "Question"), GPVSEx(playerid, "Answer"));
  10100. DB::Query(_DB, Query);
  10101. format(Query, sizeof(Query), "SELECT `Key` FROM `Accounts` WHERE `Name` = '%s'", Name(playerid));
  10102. new DBResult:Result = DB::Query(_DB, Query);
  10103.  
  10104. if(Result)
  10105. {
  10106. if(DB::Valid(Result))
  10107. {
  10108. new Field[15];
  10109. DB::GetField(Result, "Key", Field, sizeof(Field));
  10110. S_DATA[sAccounts] = strval(Field);
  10111. P_DATA[playerid][AccID] = strval(Field);
  10112.  
  10113. DB::Free(Result);
  10114. }
  10115. }
  10116.  
  10117. #if SECURITY_QUESTION == true
  10118.  
  10119. format(zStr, sizeof (zStr), ""W"Account succesfully created!\n\n\
  10120. "ORAN"["W" Account Information "ORAN"]\n\
  10121. "W"Account: "BLUE"%s\n\
  10122. "W"Password: "BLUE"%s\n\
  10123. "W"Account ID: "BLUE"%d\n\
  10124. "W"Created On: "BLUE"%s\n", Name(playerid), inputtext, S_DATA[sAccounts], zDate());
  10125.  
  10126. format(zStr, sizeof (zStr), "%s\
  10127. "W"Secret Question: "BLUE"%s\n\
  10128. "W"Secret Answer: "BLUE"%s\n\n\n\
  10129. Thanks for registering an account.\n\
  10130. Please procceed with login.", zStr, GPVSEx(playerid, "Question"), GPVSEx(playerid, "Answer"));
  10131.  
  10132. #else
  10133.  
  10134. format(zStr, sizeof (zStr), ""W"Account succesfully created!\n\n\
  10135. "ORAN"["W" Account Information "ORAN"]\n\
  10136. "W"Account: "BLUE"%s\n\
  10137. "W"Password: "BLUE"%s\n\
  10138. "W"Account ID: "BLUE"%d\n\
  10139. "W"Created On: "BLUE"%s\n\n\
  10140. Thanks for registering an account.\n\
  10141. Please procceed with login.", Name(playerid), inputtext, S_DATA[sAccounts], zDate());
  10142.  
  10143. #endif
  10144. SPD(playerid, Dialog:Login, BOX, ""W"Account Information", zStr, "Continue", "");
  10145.  
  10146. new INI:
  10147. Accounts = INI_Open(USER_ID);
  10148. INI_WriteInt(Accounts, "Accounts_Created", S_DATA[sAccounts]);
  10149. INI_WriteString(Accounts, "Last_Account", Name(playerid));
  10150. INI_WriteString(Accounts, "Last_Account_Date", zDate());
  10151. INI_Close(Accounts);
  10152. return 1;
  10153. }
  10154. FormatOnline(playerid)
  10155. {
  10156. new zStr[15], T[3];
  10157. TotalGameTime(playerid, T[0], T[1], T[2]);
  10158. format(zStr, sizeof (zStr), "%d:%d:%d", T[0], T[1], T[2]);
  10159. return zStr;
  10160. }
  10161. ClearVars(playerid)
  10162. {
  10163. DestroyVehicle(P_DATA[playerid][GiveCar]);
  10164. Delete3DTextLabel(P_DATA[playerid][Tag3D]);
  10165.  
  10166. P_DATA[playerid][Kills] = 0;
  10167. P_DATA[playerid][Deaths] = 0;
  10168. P_DATA[playerid][Hours] = 0;
  10169. P_DATA[playerid][Rank] = 0;
  10170. P_DATA[playerid][Msgs] = 0;
  10171. P_DATA[playerid][Cmds] = 0;
  10172. P_DATA[playerid][fCmds] = 0;
  10173. P_DATA[playerid][Cookies] = 0;
  10174. P_DATA[playerid][Negative] = 0;
  10175. P_DATA[playerid][Positive] = 0;
  10176. P_DATA[playerid][Money] = 0;
  10177. P_DATA[playerid][Score] = 0;
  10178. P_DATA[playerid][Banned] = 0;
  10179. P_DATA[playerid][Kicks] = 0;
  10180. P_DATA[playerid][Logged] = 0;
  10181. P_DATA[playerid][Muted] = 0;
  10182. P_DATA[playerid][Frozen] = 0;
  10183. P_DATA[playerid][Jailed] = 0;
  10184. P_DATA[playerid][MutedTime] = 0;
  10185. P_DATA[playerid][JailTime] = 0;
  10186. P_DATA[playerid][tLevel] = 0;
  10187. P_DATA[playerid][PMSent] = 0;
  10188. P_DATA[playerid][RepMSG] = EOS;
  10189. P_DATA[playerid][Warns] = 0;
  10190. P_DATA[playerid][aCar] = -1;
  10191. P_DATA[playerid][pAuto] = 0;
  10192. P_DATA[playerid][MutedAll] = 0;
  10193. P_DATA[playerid][Accp_Saved] = 0;
  10194. P_DATA[playerid][A_Color] = 0;
  10195. P_DATA[playerid][A_Component1] = 0;
  10196. P_DATA[playerid][A_Component2] = 0;
  10197. P_DATA[playerid][A_Component3] = 0;
  10198. P_DATA[playerid][A_Component4] = 0;
  10199. P_DATA[playerid][A_Wheels] = 0;
  10200. P_DATA[playerid][Spin] = 0;
  10201. P_DATA[playerid][VIPTag] = 0;
  10202.  
  10203. P_DATA[playerid][Spec_ID] = 0xFFFF;
  10204. P_DATA[playerid][Spec_Type] = ADMIN_SPEC_TYPE_NONE;
  10205. }
  10206.  
  10207. Public:ParseUserID(name[], value[])if(!strcmp(name, "Accounts_Created")) S_DATA[sAccounts] = strval(value);
  10208.  
  10209. Public:LoadServerData(name[], value[])
  10210. {
  10211. if(!strcmp(name, INI_Server_Info[0][isName])) S_DATA[AntiSpam] = strval(value);
  10212. if(!strcmp(name, INI_Server_Info[1][isName])) S_DATA[AntiCSpam] = strval(value);
  10213. if(!strcmp(name, INI_Server_Info[2][isName])) S_DATA[Ping] = strval(value);
  10214. if(!strcmp(name, INI_Server_Info[3][isName])) S_DATA[RCONProt] = strval(value);
  10215. if(!strcmp(name, INI_Server_Info[4][isName])) S_DATA[TellPlayer] = strval(value);
  10216. if(!strcmp(name, INI_Server_Info[5][isName])) S_DATA[Chat] = strval(value);
  10217. if(!strcmp(name, INI_Server_Info[6][isName])) S_DATA[ReadPM] = strval(value);
  10218. if(!strcmp(name, INI_Server_Info[7][isName])) S_DATA[ReadCMD] = strval(value);
  10219. if(!strcmp(name, INI_Server_Info[8][isName])) S_DATA[AKA] = strval(value);
  10220. if(!strcmp(name, INI_Server_Info[9][isName])) S_DATA[ShowFunction] = strval(value);
  10221. if(!strcmp(name, INI_Server_Info[10][isName])) S_DATA[AntiRepeat] = strval(value);
  10222. if(!strcmp(name, INI_Server_Info[11][isName])) S_DATA[AutoLogin] = strval(value);
  10223. if(!strcmp(name, INI_Server_Info[12][isName])) S_DATA[AnnRank] = strval(value);
  10224. if(!strcmp(name, INI_Server_Info[13][isName])) S_DATA[AntiAD] = strval(value);
  10225. if(!strcmp(name, INI_Server_Info[14][isName])) S_DATA[AdminChat] = strval(value);
  10226. if(!strcmp(name, INI_Server_Info[15][isName])) S_DATA[VipChat] = strval(value);
  10227. }
  10228.  
  10229.  
  10230. Public:LoadPlayerData(playerid)
  10231. {
  10232. new Query[750], DBResult:Result;
  10233.  
  10234. format(Query, 750, "SELECT `IP`, `Level`, `VIP`, \
  10235. `Rank`, `Money`, `Score`, \
  10236. `Kills`, `Deaths`, `Cookies`, \
  10237. `Positive`, `Negative`, `Messages`, \
  10238. `Commands`, `fCommands`, `Warns`, \
  10239. `Kicks`, `God`, `Cargod`, \
  10240. `ACCP`, `ACCPSav`, `BlockPM`, \
  10241. `Key`, `Boost`, `bSpeed` `JoinDate`, `Online`, \
  10242. `Spin`, `WearTAG`, `Incred` FROM `Accounts` WHERE `Name` = '%s';", Name(playerid));
  10243. Result = DB::Query(_DB, Query);
  10244.  
  10245. if(Result)
  10246. {
  10247. if(DB::Valid(Result))
  10248. {
  10249. new Field[30];
  10250.  
  10251. _GetField<"Key">Store<AccID>
  10252. _GetField<"Level">Store<Level>
  10253. _GetField<"VIP">Store<Vip>
  10254. _GetField<"Rank">Store<Rank>
  10255. _GetField<"Kills">Store<Kills>
  10256. _GetField<"Deaths">Store<Deaths>
  10257. _GetField<"Cookies">Store<Cookies>
  10258. _GetField<"Positive">Store<Positive>
  10259. _GetField<"Negative">Store<Negative>
  10260. _GetField<"Messages">Store<Msgs>
  10261. _GetField<"Commands">Store<Cmds>
  10262. _GetField<"fCommands">Store<fCmds>
  10263. _GetField<"Warns">Store<Warns>
  10264. _GetField<"Kicks">Store<Kicks>
  10265. _GetField<"God">Store<God>
  10266. _GetField<"Cargod">Store<CarGod>
  10267. _GetField<"ACCPSav">Store<Accp_Saved>
  10268. _GetField<"BlockPM">Store<BAPMs>
  10269. _GetField<"Boost">Store<Boost>
  10270. _GetField<"Spin">Store<Spin>
  10271. _GetField<"WearTAG">Store<VIPTag>
  10272. _GetField<"Incred">Store<Incred>
  10273.  
  10274. DB::GetField(Result, "bSpeed", Field, sizeof(Field));
  10275. P_DATA[playerid][bSpeed] = floatstr(Field);
  10276.  
  10277. DB::GetField(Result, "IP", Field, sizeof(Field));
  10278. PlayerIP[playerid] = Field;
  10279.  
  10280. DB::GetField(Result, "Money", Field, sizeof(Field));
  10281. GivePlayerMoney(playerid, strval(Field));
  10282.  
  10283. DB::GetField(Result, "Score", Field, sizeof(Field));
  10284. SetPlayerScore(playerid, GetPlayerScore(playerid) + strval(Field));
  10285.  
  10286. DB::GetField(Result, "ACCP", Field, sizeof(Field));
  10287. SetPVarString(playerid, "ACCP_DATA", Field);
  10288.  
  10289. DB::GetField(Result, "Online", Field, sizeof(Field));
  10290. SetPVarString(playerid, "Online", Field);
  10291.  
  10292. DB::GetField(Result, "JoinDate", Field, sizeof(Field));
  10293. SetPVarString(playerid, "AccountDate", Field);
  10294.  
  10295. DB::Free(Result);
  10296. }
  10297. }
  10298. }
  10299.  
  10300. Public:UnMutePlayer(playerid)
  10301. {
  10302. --P_DATA[playerid][MutedTime];
  10303.  
  10304. if(!P_DATA[playerid][MutedTime])
  10305. {
  10306. KillTimer(MuteTimer[playerid]);
  10307. UnMutePlayer(playerid);
  10308. P_DATA[playerid][MutedTime] = 0;
  10309. P_DATA[playerid][Muted] = 0;
  10310.  
  10311. SendClientMessage(playerid, -1, ""ORAN"SERVER:"W" You have been unmuted by the system!");
  10312. #if SAVE_MUTE == true
  10313.  
  10314. new
  10315. Query[256];
  10316. format(Query, 256, "DELETE FROM `Muted` WHERE `IP` = '%s'", GetPlayerIPEx(playerid));
  10317. DB::Query(_DB, Query);
  10318.  
  10319. #endif
  10320. }
  10321. else if(P_DATA[playerid][MutedTime] == 1){
  10322. GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~r~~h~MUTE INFO~n~~r~~h~One~w~ minute left", 10000, 3);}
  10323.  
  10324. else if(P_DATA[playerid][MutedTime] > 1)
  10325. {
  10326. new Str[129];
  10327. format(Str, 129, "~n~~n~~n~~n~~n~~n~~n~~n~~r~~h~MUTE INFO~n~~r~~h~%d~w~ minutes left", P_DATA[playerid][JailTime]);
  10328. GameTextForPlayer(playerid, Str, 10000, 3);
  10329. }
  10330. return 1;
  10331. }
  10332. GPVSEx(playerid, zPVSTR[] )
  10333. {
  10334. new zStr[129];
  10335. GetPVarString(playerid, zPVSTR, zStr, 129);
  10336. return zStr;
  10337. }
  10338.  
  10339. BanEx2(playerid, zAdmin[] = "System", zReason[] = "No Reason")
  10340. {
  10341. new
  10342. zStr[256];
  10343. #if SAVE_IN_LOGS == true
  10344. new
  10345. File:zFile;
  10346.  
  10347. format(zStr, sizeof (zStr), "Player: %s[%i] has been banned by \"%s\" with reason \"%s\" on %s\r\n",
  10348. Name(playerid),
  10349. playerid,
  10350. zAdmin,
  10351. zReason,
  10352. zDate());
  10353.  
  10354.  
  10355. zFile = fopen(BAN_LOG, io_append);
  10356. if(zFile)
  10357. {
  10358. fwrite(zFile, zStr);
  10359. fclose(zFile);
  10360. }
  10361. #else
  10362. #pragma unused zAdmin
  10363. #endif
  10364.  
  10365.  
  10366. new Query[129];
  10367. format(Query, 129, "INSERT INTO `Banlist` VALUES('%s', '%s', '%s', '%s', '%s')", GetPlayerIPEx(playerid), Name(playerid), zReason, zAdmin, zDate());
  10368. FormatMSG(playerid, Color:ORAN, "SERVER:"W" You have been banned from this server! "W"["GREY" %s"W"]", zReason);
  10369. KickAfter(playerid);
  10370.  
  10371.  
  10372.  
  10373. return 1;
  10374. }
  10375.  
  10376.  
  10377.  
  10378. Public:KickAfterTimer(playerid) return Kick(playerid);
  10379. KickAfter(playerid, time = 1200 ){ SetTimerEx("KickAfterTimer", time, false, "i", playerid);}
  10380.  
  10381. BadRcon(zIP[], zPassword[], zAdmin[] = "System", zReason[] = "RCON Login Attempt")
  10382. {
  10383. new
  10384. zStr[256];
  10385. #if SAVE_IN_LOGS == true
  10386. new
  10387. File:zFile;
  10388.  
  10389. format(zStr, sizeof (zStr), "IP \"%s\" has been banned by \"%s\" with reason \"%s\" and password \"%s\" on %s\r\n",
  10390. zIP,
  10391. zAdmin,
  10392. zReason,
  10393. zPassword,
  10394. zDate());
  10395.  
  10396.  
  10397. zFile = fopen(RCON_LOG, io_append);
  10398. if(zFile)
  10399. {
  10400. fwrite(zFile, zStr);
  10401. fclose(zFile);
  10402. }
  10403. #else
  10404. #pragma unused zPassword
  10405. #endif
  10406. format(zStr, sizeof (zStr), ""ORAN"Ban Info: "W"IP "ORAN"\"%s\""W" has been IP banned by "ORAN"\"%s\" "W"with reason"ORAN" \"%s\"",
  10407. zIP,
  10408. zAdmin,
  10409. zReason);
  10410.  
  10411. SendMessageToAdmins(.zMessage = zStr);
  10412.  
  10413.  
  10414. format(zStr, sizeof (zStr), "banip %s", zIP);
  10415. SendRconCommand(zStr);
  10416. return 1;
  10417. }
  10418. KickEx(playerid, zAdmin[] = "System", zReason[] = "No Reason", tell = true)
  10419. {
  10420. new zStr[256];
  10421. #if SAVE_IN_LOGS == true
  10422. new
  10423. File:zFile;
  10424.  
  10425. format(zStr, sizeof (zStr), "Player: %s[%i] has been kicked by \"%s\" with reason \"%s\" on %s\r\n",
  10426. Name(playerid),
  10427. playerid,
  10428. zAdmin,
  10429. zReason,
  10430. zDate());
  10431.  
  10432.  
  10433. zFile = fopen(KICK_LOG, io_append);
  10434. if(zFile)
  10435. {
  10436. fwrite(zFile, zStr);
  10437. fclose(zFile);
  10438. }
  10439. #endif
  10440. if(tell)
  10441. {
  10442.  
  10443. format(zStr, sizeof (zStr), ""ORAN"Kick Info: "W"Player "ORAN"%s[%i]"W" has been kicked by "ORAN"\"%s\" "W"with reason"ORAN" \"%s\"",
  10444. Name(playerid),
  10445. playerid,
  10446. zAdmin,
  10447. zReason);
  10448.  
  10449. SendMessageToAdmins(.zMessage = zStr);
  10450.  
  10451. }
  10452.  
  10453. P_DATA[playerid][Kicks] += 1;
  10454.  
  10455. new Query[120];
  10456.  
  10457. if(AccountExist(Name(playerid)))
  10458. {
  10459. format(Query, 120, "UPDATE `Accounts` SET `Kicks` = '%d' WHERE `Name` = '%s'", P_DATA[playerid][Kicks], Name(playerid));
  10460. DB::Query(_DB, Query);
  10461. }
  10462.  
  10463.  
  10464. KickAfter(playerid);
  10465. return 1;
  10466. }
  10467.  
  10468. SendMessageToAdmins(zColor = -1, zMessage[], level = 1)
  10469. {
  10470. foreach(Player, A)
  10471. {
  10472. if(P_DATA[A][Level] >= level)
  10473. {
  10474. SendClientMessage(A, zColor, zMessage);
  10475. }
  10476. }
  10477. return 1;
  10478. }
  10479.  
  10480. zDate(ms = false)
  10481. {
  10482. new zStr[30];
  10483. if(ms)
  10484. {
  10485. new Date[6];
  10486. getdate(Date[0], Date[1], Date[2]);
  10487. gettime(Date[3], Date[4], Date[5]);
  10488. format(zStr, sizeof (zStr), "%d/%d/%d %d:%d:%d", Date[2], Date[1], Date[0], Date[3], Date[4], Date[5]);
  10489. }
  10490. else
  10491. {
  10492. new Date[5];
  10493. getdate(Date[0], Date[1], Date[2]);
  10494. gettime(Date[3], Date[4]);
  10495. format(zStr, sizeof (zStr), "%d/%d/%d %d:%d", Date[2], Date[1], Date[0], Date[3], Date[4]);
  10496. }
  10497. return zStr;
  10498. }
  10499.  
  10500.  
  10501. Name(playerid)
  10502. {
  10503. new zName[MAX_PLAYER_NAME];
  10504. GetPlayerName(playerid, zName, MAX_PLAYER_NAME);
  10505. return zName;
  10506. }
  10507.  
  10508. TotalGameTime(playerid, &h=0, &m=0, &s=0)
  10509. {
  10510. P_DATA[playerid][TotalTime] = ((gettime() - P_DATA[playerid][ConnTime]) + (P_DATA[playerid][Hours]*60*60) + (P_DATA[playerid][Minutes]*60) + (P_DATA[playerid][Seconds]));
  10511.  
  10512. h = floatround(P_DATA[playerid][TotalTime] / 3600, floatround_floor);
  10513. m = floatround(P_DATA[playerid][TotalTime] / 60, floatround_floor) % 60;
  10514. s = floatround(P_DATA[playerid][TotalTime] % 60, floatround_floor);
  10515.  
  10516. return P_DATA[playerid][TotalTime];
  10517. }
  10518.  
  10519.  
  10520. Public:VehicleOccupied(v)
  10521. {
  10522. foreach(Player, i)
  10523. {
  10524. if(IsPlayerInVehicle(i, v)) return 1;
  10525. }
  10526. return 0;
  10527. }
  10528. SendError(playerid, error[])
  10529. {
  10530. new Str[256];
  10531. format(Str, sizeof (Str), "* "GREY"%s", error);
  10532. SendClientMessage(playerid, Color:ORAN, Str);
  10533. return 1;
  10534. }
  10535. SendUsage(playerid, usage[], function[] = "don't send function" )
  10536. {
  10537. new Str[256];
  10538. format(Str, sizeof (Str), "Usage: {FFFFFF} %s", usage);
  10539. SendClientMessage(playerid, Color:GREE, Str);
  10540. if(strcmp(function, "don't send function") && S_DATA[ShowFunction])
  10541. {
  10542. format(Str, sizeof (Str), "Function: {FFFFFF} %s", function);
  10543. SendClientMessage(playerid, Color:FUNC, Str);
  10544. }
  10545.  
  10546. return 1;
  10547. }
  10548. MiniFormat(number, extra[] = ";")
  10549. {
  10550. new fStr[256];
  10551. if(strcmp(extra, ";"))format(fStr, sizeof (fStr), "%d %s", number, extra);
  10552. else format(fStr, sizeof (fStr), "%d", number);
  10553. return fStr;
  10554. }
  10555.  
  10556. EX(ex)
  10557. {
  10558. new ex2[10];
  10559. format(ex2, sizeof (ex2), "Yes | %d", ex);
  10560. return ex2;
  10561. }
  10562. stock IsValidSkin(SkinID)
  10563. {
  10564. switch(SkinID)
  10565. {
  10566. case 0..41: return 1; case 43..64: return 1; case 66..73: return 1;
  10567. case 75..85: return 1; case 87..118: return 1; case 120..148: return 1;
  10568. case 150..207: return 1; case 209..264: return 1; case 274..288: return 1;
  10569. case 290..299: return 1;
  10570. default: return 0;
  10571. }
  10572. return 0;
  10573. }
  10574. IsValidWeapon(weaponid)
  10575. {
  10576. switch(weaponid)
  10577. {
  10578. case 1..18: return 1;
  10579. case 22..46: return 1;
  10580. }
  10581. return 0;
  10582. }
  10583. GetVModelFromName(vName[])
  10584. {
  10585. for (new i = 400; i <= 611; i++)
  10586. if(strfind(vNames[i - 400], vName, true) != -1)
  10587. return i;
  10588.  
  10589. return -1;
  10590. }
  10591. GetWeaponIDFromName(WeaponName[])
  10592. {
  10593. if(strfind("molotov", WeaponName, true) !=-1) return 18;
  10594. for (new i = 0; i <= 46; i++)
  10595. {
  10596. switch(i)
  10597. {
  10598. case 0, 19, 20, 21, 44, 45: continue;
  10599. default:
  10600. {
  10601. new name[32]; GetWeaponName(i, name, 32);
  10602. if(strfind(name, WeaponName, true) != -1)
  10603. return i;
  10604. }
  10605. }
  10606. }
  10607. return -1;
  10608. }
  10609. stock GetServerHostName()
  10610. {
  10611. new gString[128];
  10612. GetServerVarAsString("hostname", gString, sizeof(gString));
  10613. return gString;
  10614. }
  10615. stock IsNumeric(string[])
  10616. {
  10617. for (new i = 0, j = strlen(string);i < j; i++)
  10618. {
  10619. if(string[i] > '9' || string[i] < '0')
  10620. return 0;
  10621. }
  10622. return 1;
  10623. }
  10624. stock
  10625. FormatNumber(
  10626. { _, Float, Text3D, Menu, Text, DB, DBResult, bool, File, hex, bit, bit_byte, Bit }:xVariable, iDecimals = -1, iThousandSeparator = ',', iDecimalPoint = '.', iTag = tagof(xVariable))
  10627. {
  10628. static
  10629. s_szReturn[32],
  10630. s_szThousandSeparator[2] = { ' ', EOS },
  10631. s_iDecimalPos,
  10632. s_iChar,
  10633. s_iSepPos
  10634. ;
  10635.  
  10636. if(iTag == tagof(bool:))
  10637. {
  10638. if(xVariable)
  10639. memcpy(s_szReturn, "true", 0, 5 * (cellbits / 8));
  10640. else
  10641. memcpy(s_szReturn, "false", 0, 6 * (cellbits / 8));
  10642.  
  10643. return s_szReturn;
  10644. }
  10645. else if(iTag == tagof(Float:))
  10646. {
  10647. if(iDecimals == -1)
  10648. iDecimals = 8;
  10649.  
  10650. format(s_szReturn, sizeof(s_szReturn), "%.*f", iDecimals, xVariable);
  10651. }
  10652. else if(iTag == tagof(hex:) || iTag == tagof(Hex:))
  10653. {
  10654. format(s_szReturn, sizeof(s_szReturn), "0x" "%04h%04h", (xVariable & (0xFFFF0000)) >>> 16, xVariable & (0x0000FFFF));
  10655.  
  10656. return s_szReturn;
  10657. }
  10658. else if(iTag == tagof(bit:) || iTag == tagof(Bit:))
  10659. {
  10660. format(s_szReturn, sizeof(s_szReturn), "0b" "%08b%08b%08b%08b", (xVariable & 0xFF000000) >>> 24, (xVariable & 0x00FF0000) >>> 16, (xVariable & 0x0000FF00) >>> 8, (xVariable & 0x000000FF));
  10661.  
  10662. return s_szReturn;
  10663. }
  10664. else if(iTag == tagof(bit_byte:))
  10665. {
  10666. format(s_szReturn, sizeof(s_szReturn), "0b" "%08b", (xVariable & 0x000000FF));
  10667.  
  10668. return s_szReturn;
  10669. }
  10670. else
  10671. {
  10672. format(s_szReturn, sizeof(s_szReturn), "%d", xVariable);
  10673.  
  10674. if(iDecimals > 0)
  10675. {
  10676. strcat(s_szReturn, ".");
  10677.  
  10678. while (iDecimals--)
  10679. strcat(s_szReturn, "0");
  10680. }
  10681. }
  10682.  
  10683. s_iDecimalPos = strfind(s_szReturn, ".");
  10684.  
  10685. if(s_iDecimalPos == -1)
  10686. s_iDecimalPos = strlen(s_szReturn);
  10687. else
  10688. s_szReturn[s_iDecimalPos] = iDecimalPoint;
  10689.  
  10690. if(s_iDecimalPos >= 4 && iThousandSeparator)
  10691. {
  10692. s_szThousandSeparator[0] = iThousandSeparator;
  10693.  
  10694. s_iChar = s_iDecimalPos;
  10695. s_iSepPos = 0;
  10696.  
  10697. while (--s_iChar > 0)
  10698. {
  10699. if(++s_iSepPos == 3)
  10700. {
  10701. strins(s_szReturn, s_szThousandSeparator, s_iChar);
  10702.  
  10703. s_iSepPos = 0;
  10704. }
  10705. }
  10706. }
  10707. return s_szReturn;
  10708. }
  10709.  
  10710. stock AccountExist(name[])
  10711. {
  10712. new Buffer[240], Entry, DBResult:Result;
  10713.  
  10714. format(Buffer, sizeof(Buffer), "SELECT `Key` FROM `Accounts` WHERE `Name` = '%s'",name);
  10715. Result = DB::Query(_DB, Buffer);
  10716.  
  10717. if(Result)
  10718. {
  10719. if(DB::Valid(Result))
  10720. {
  10721. Entry = 1;
  10722. DB::Free(Result);
  10723. }
  10724. else Entry = 0;
  10725. }
  10726. return Entry;
  10727. }
  10728. Public:Display()
  10729. {
  10730. print("\n\n\n\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124");
  10731. print("\124\124\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\124\124");
  10732. print("\124\124\t \48\65\100\109\105\110 \118"#Version"\t\t\124\124");
  10733. print("\124\124\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\124\124");
  10734. print("\124\124\t\t\t\t\124\124");
  10735. print("\124\124\t\77\97\100\101 \98\121 \90\104\51\114\48\t\t\124\124");
  10736. print("\124\124\t\t\t\t\124\124");
  10737. print("\124\124\t\76\111\97\100\101\100 \83\117\99\99\101\115\102\117\108\108\121\t\124\124");
  10738. print("\124\124\t\t\t\t\124\124");
  10739. printf("\124\124\t%s\t\t\124\124", zDate());
  10740. print("\124\124\t\t\t\t\124\124");
  10741. print("\124\124\t\84\121\112\101 \33\104\101\108\112 \105\110 \99\111\110\115\111\108\101\t\124\124");
  10742. print("\124\124\t\t\t\t\124\124");
  10743. print("\124\124\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\t\124\124");
  10744. print("\124\124 \75\101\101\112 \116\104\101 \99\114\101\100\105\116\115\33 \124\t\124\124");
  10745. print("\124\124\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\45\t\124\124");
  10746. print("\124\124\t\t\t\t\124\124");
  10747. print("\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\124\n\n\n");
  10748. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement