Advertisement
Guest User

Untitled

a guest
Sep 16th, 2017
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 394.97 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. - 0Admin was planned to be the most unique admin script ever, beating the
  10. existing one on performance and realiability.
  11. The goal was achieved, I've used the best ways to build this script.
  12. It uses SQLite, and Y_Ini in the same time for performance.
  13. The command processor is ZCMD and I've used SSCANF to gain the best
  14. performance you could get at the moment.
  15. Using Regular Expresions(RegEx) for a better search. Examples are the:
  16. Anti-Advertising functions.
  17.  
  18. **************
  19. ** You may not sell this script under any circumstances.
  20. For personal use only.
  21. ** You may edit this script on your like. But don't claim it as yours.
  22. ** Do whatever YOU LIKE! But don't sell or change credits.
  23. ** Respect these rules!
  24. **************
  25.  
  26. ..::Changelog::..
  27. [V1.0]
  28. - Initial Release.
  29.  
  30. [V1.1]
  31. - Repaired Anti-IP Advertising.
  32. - Added a define for the security question.
  33. - Removed "Start Event" from /PCP.
  34. - Added new commands:
  35. "/ann /ann2 /cpass /time /aka"
  36. - Added stats stabilizer. Player won't get wrong information whe his stats
  37. will be changed from the include, trough the gamemode.
  38. - Repaired 0Admin_F.inc include, found errors and mistakes.
  39. - 0Admin_F.inc now saves the stats directly into the database.
  40. - Added commands "/report" and "/respect" because it was requested.
  41. - Fixed crashing while setting player kills trough "/setstats"
  42. - Fixed a mistype in "/vips".
  43.  
  44.  
  45. Upcoming:
  46. [V1.2]
  47. - Temporary Ban(tempban)
  48. - Anti-Swear system.
  49. - Security upgrade to SQLite database.
  50. - Forbidden weapons list.
  51.  
  52. =======================================================================
  53.  
  54. ------------------------------(Level 0 [Member])--------------------------------/*
  55. - The member, is just a player playing on the server without any
  56. superior abilities. */
  57.  
  58. [V1.0]
  59. /register - Register an account in the database.
  60. /login - Login into account.
  61. /stats - View your stats.
  62. /pm - Send a personal message.
  63. /admins - View online Administrators.
  64. /vips - View online VIP Members.
  65. /top - View the top. Best kills, deaths, most hours online etc.
  66. /cookies - Show your current cookies amount.
  67. /buycookies - Buy some cookies!
  68. /eatcookie - Eat cookie, gain health.
  69. /buycookiesjar - Buy a jar of 20 cookies.
  70. /giftcookie - Gift a cookie to a player!
  71. /cookieshelp - More information about the cookies system.
  72.  
  73. [V1.1]
  74. /time - View current time,
  75. /cpass - Change password
  76.  
  77. ----------------------------(Level 1 [Helper])----------------------------------/*
  78. - The Helper has the role to maintain PLEASURE on server.
  79. - To ensure players got what they need, as time, weather. */
  80.  
  81. [V1.0]
  82. /goto - Go to someone's position.
  83. /gotopos - Go to the position set, x, y, z.
  84. /getip - Get someone's IP Adress.
  85. /settime - Set someone's time.
  86. /spawn - Spawn a player.
  87. /acar - Spawn your personal Admin car.
  88. /accp - Tune your admin car. Components, colors, nitro.
  89. Save coponents, load components, discard components.
  90. /jailed - View jailed players and the jail time.
  91. /frozen - View frozem players.
  92. /muted - View muted players and the mute time.
  93.  
  94. [V1.1]
  95. - Nothing.
  96. ------------------------(Level 2 [Mini Moderator])------------------------------/*
  97. - The mini moderator serves as help when the superiors are offline.
  98. - His job is to keep the server quiet if there's a fight.
  99. - To keep away hackers by disarming them or removing money. */
  100.  
  101. [V1.0]
  102. /disarm - Remove someone's weapons.
  103. /bankrupt - Remove someone's money.
  104. /tplayer - Teleport a player to another player.
  105. /eject - Eject a player from the vehicle.
  106. /heal - Heal yourself.
  107. /spec - Spectate a player.
  108. /specoff - Stop spectating a player.
  109. /show - Send a game text to the specified player.
  110. /setskin - Set someone's skin.
  111. /[un]freeze - Freeze or unfreeze the specified player.
  112. /[un]mute - Mute or unmute a player with specified time.
  113. /aweapons - Give yourself the best weapons.
  114. /healcar - Heal someone's car.
  115. /setvhealth - Set someone's vehicle health.
  116. /carcolor - Change someone's vehicle colors.
  117.  
  118. [V1.1]
  119. /aka - View the aka list of a player.
  120. /ann - Send an announcement to the server.
  121. /ann2 - Send an announcement with style and custom time.
  122. ----------------------------(Level 3 [Moderator])-------------------------------/*
  123. - The Moderator has the role to keep the server clean. Clean from idiots and
  124. spammers, make sure the chat is CLEAR when someone fights.
  125. - The moderator can warn a player for bad behaviour.
  126. - He can jail or Unjail a specified player.
  127. - He can manipulate players data, cookies, score, money, skin etc.. */
  128.  
  129. [V1.0]
  130. /giveweapon - Give someone a weapon with specified ammo.
  131. /warn - Warn a player, at 3 warns player will be kicked!
  132. /healall - Heall all players on the server.
  133. /heal - Heal a specified player.
  134. /aweapons - Give yourself some weapons.
  135. /givecar - Give someone a car.
  136. /write - Write something in the chat, without name in front.
  137. /destroyv - Destroy a vehicle ID.
  138. /[un]jail - Jail or Unjail a specified player.
  139. /slap - Slap a player make him loose -25 health.
  140. /clearchat - Clear the chat.
  141. /akill - Kill a player.
  142. /explode - Explode a player.
  143. /setalltime - Set everyone's time.
  144. /setallweather - Set everyone's weather.
  145.  
  146. - The below commands are self explanatory.
  147. /set(cookies|health|armour|score|cash|skin|time|weather|world|interior|drunk|respect|wanted)
  148.  
  149. [V1.1]
  150. - Nothing
  151. --------------------------(Level 4 [Administrator])-----------------------------/*
  152. - Doesn't have a specified role, he can pretty much do whatever he likes.
  153. - His actions may not be judged.
  154. - Can manipulate everyone's data. */
  155.  
  156. [V1.0]
  157. - Set everyone's x .
  158. /setall(health|armour|score|cash|skin|world|interior|drunk|cookies|respect|wanted)
  159.  
  160. - Give everyone x.
  161. /giveall(health|armour|score|cash|cookies|wanted|weapon)
  162.  
  163. /kick - Kick a player from the server.
  164. /wcheck - Check a player's weapons.
  165. /setdeaths - Set someone's deaths.
  166. /setkills - Set someone's kills.
  167. /2012 - Fuck up someone's game, 0 money, 0 score, 0 everything.
  168. /resetallrespect- Change everyone's respect. Negatie and Positive.
  169. /killall - Kill everyone on the server.
  170. /[un]muteall - Mute/Unmute everyone, this mute won't save!
  171. /[un]freezeall - Freeze/Unfreeze all, this freeze won't save!
  172. /spawnall - Spawn all players.
  173. /2012all - Fuck up everyone's game!
  174. /chat - You can manipulate the chat. Spam it, clear it, [un]block it.
  175. /slapall - Slap everyone!
  176. /disarmall - Disarm everyone in the server.
  177. /explodeall - Explode everone.
  178.  
  179. [V1.1]
  180. - Nothing
  181. -------------------------------(Level 5 [Owner])--------------------------------/*
  182. - He is the boss, the boss of everyone, he can do whatever he likes!!!
  183. - He can ban you, LIKE A BOSS!
  184. - He can change you, LIKE A BOSS!
  185. - He can delete you, LIKE A BOSS! */
  186.  
  187. [V1.0]
  188. /setlevel - Change someone's level.
  189. /settemplevel - Set someone's temporary level, on disconnect, level will be reseted.
  190. /ban - Ban a player.
  191. /unban - Unban a player, remove his name from the banlist in the database.
  192. /acp - Open a dialog where you can manipulate server features. Such as, antispam, anti-ad etc.
  193. /respawncars - Respawn all unoccupied vehicles in the server.
  194. /removeacc - Delete a player's account from the database.
  195. /setonline - Change someone's online time.
  196. /setstat - Open a dialog where you can manipulate a specified ID.
  197. /fake - Show the fake list commands.
  198. /fakechat - Send a fake chat of a certain user.
  199. /fakecmd - Send a fake command, or make him execute a command.
  200. /fakecon - Send a face connection to the server.
  201. /fakedisc - Send a fake disconnection from the server.
  202. /fakedeath - Send a fake death.
  203. /kickall - Kick everyone from the server.
  204. /banall - Ban everyone from the server!
  205.  
  206. [V1.1]
  207. - Nothing
  208.  
  209. #endif
  210. //Main Include
  211. #include <a_samp>
  212.  
  213.  
  214. /*-----------------------------------------------
  215. Don't change this otherwise whirlpool won't work!*/
  216. #define MAX_INI_ENTRY_TEXT 130
  217. #undef MAX_PLAYER_NAME
  218. #define MAX_PLAYER_NAME 24
  219. /*-----------------------------------------------*/
  220.  
  221. //Includes
  222. #include < YSI/Y_ini >
  223. #include < sscanf2 >
  224. #include < zcmd >
  225. #include < foreach >
  226. #include < regex >
  227. //#include YSI/y_scripting
  228.  
  229. //Version of the script.
  230. #define Version "1.1"
  231.  
  232. #pragma dynamic 46500
  233. //Colors:
  234. #define ORAN "{FF5500}"
  235. #define GREE "{94ED40}"
  236. #define BLUE "{4097ED}"
  237. #define W "{FFFFFF}"
  238. #define GREY "{C3C3C3}"
  239.  
  240.  
  241. //Tags:
  242. #define Dialog: _:DIALOG_
  243. #define Color: _:COL_
  244.  
  245.  
  246. //Shortcuts
  247. #define D: = 906 //If you have Dialog Problems, please change here, the higher, the better!
  248. #define PARAMS playerid, params[]
  249. #define SPD ShowPlayerDialog
  250. #define LIST DIALOG_STYLE_LIST
  251. #define INPUT DIALOG_STYLE_INPUT
  252. #define BOX DIALOG_STYLE_MSGBOX
  253. #define CaseDialog<%0> case(Dialog:%0):
  254. #define iDialog<%0> if(dialogid == Dialog:%0)
  255. #define GetVehicleName(%0) vNames[(%0) - 400]
  256. #define Freeze(%0) TogglePlayerControllable((%0), false)
  257. #define UnFreeze(%0) TogglePlayerControllable((%0), true)
  258. #define Col(%0,%1) ChangeVehicleColor(GetPlayerVehicleID(playerid), (%0), ((%0) & (zC = %1)))
  259. #define db_GetField DB::get_field_assoc
  260. #define db_Query DB::query
  261. #define db_Free DB::free_result
  262. #define db_Valid DB::num_rows
  263. #define DB:: db_
  264.  
  265. /*
  266. =======================================
  267. ==| Bellow choose your own settings |==
  268. =======================================
  269. */
  270.  
  271. //----------------------------------------
  272. #define SECURITY_QUESTION false /*true - Will enable the security question so user can retrieve their password.
  273. false - Won't.*/
  274. //----------------------------------------
  275. #define STATS_STABILIZER false /*true - Stats will be stabilized, uses OnPlayerUpdate, unchek in case of lag...
  276. false - Won't.*/
  277. //----------------------------------------
  278. #define SAVE_IN_LOGS true /*true - It will save on file when player gets kicked/banned/muted etc..
  279. false - It won't save.*/
  280. //----------------------------------------
  281. #define SAVE_MUTE true /*true - Mute with mute time will be saved and on connect it will be re-applied!
  282. false - Mute won't be saved and it will be disabled on connect/disconnect*/
  283. //----------------------------------------
  284. #define SAVE_FREEZE true /*true - Player will be frozen after re-connect
  285. false - Player will be able to move after reconnection.*/
  286. //----------------------------------------
  287. #define SAVE_JAIL true /*true - Player after reconection will be jailed for the amount of time set
  288. false - Player after reconnection won't go to jail!*/
  289. //----------------------------------------
  290. #define USE_RANKS true /*true - Tell player when reaching x kills his new rank!
  291. false - Don't use ransk at all!*/
  292. //----------------------------------------
  293. #define PRINT_RANKS false /* true - Will print the created rank names in the console.
  294. false - Will do the opposite! Won't show them in console!*/
  295. //----------------------------------------
  296. #define UPDATE_TOP_ALWAYS true /*true - The top x players file will be update once a kill/death or whatever stat is, has occured.
  297. false - It will update only on disconnect.*/
  298. //----------------------------------------
  299. #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
  300. false - Not gonna happen! Only when admin uses !stats <id> in console or /rcon !stats id in game.*/
  301.  
  302. //ATTENTION: KEEP THE SYMBOM INSIDE ' '.
  303. #define ADMIN_CHAT_SYMBOL '@' //Choose symbol1 to let vip members talk among them. Use same symbol on both for 1 usage.
  304. #define ADMIN_CHAT_SYMBOL2 '#' //Choose symbol2 to let vip members talk among them. Use same symbol on both for 1 usage.
  305. #define VIP_CHAT_SYMBOL '*' //Choose symbol1 to let Admins talk among them. Use same symbol on both for 1 usage.
  306. #define VIP_CHAT_SYMBOL2 '$' //Choose symbol2 to let Admins talk among them. Use same symbol on both for 1 usage.
  307.  
  308. //Start defining here the way you like!
  309. #define MIN_PASS_LEN (4) //Minimum characters a password must have. (On register)
  310. #define MAX_PASS_LEN (20) //Maximum characters a password must have. (On register)
  311. #define MAX_PASS_FAIL (4) //Define how many tries a player has to login.
  312. #define MAX_RCON_ATTEMPTS 3 //Define how many tries a player must have to enter the right RCON Password.
  313. #define MIN_PING_LIMIT 100 //Minimum ping an admin must enter on the cPanel, category, "Ping Kicker"
  314. #define MAX_PING_LIMIT 3000 //Maximum ping an admin must enter on the cPanel, category, "Ping Kicker"
  315. #define IPGKICK 1 //Minimun level for admin to not be kicked by the Ping Kicker.
  316. #define LOW_SPAM_RATE (1300) //Each how many seconds the spam rate drops
  317. #define GOD_TICK_RATE (500) //Once every x ms/seconds the god will update. (If causes lag increase number)
  318. #define MINIMUM_SPAM (3) //Minimum spam message for the anti-spam to be triggered!
  319. #define MEDIUM_SPAM (10) //Medium spam messages for the player to be kicked for spamming.
  320. #define MAXIMUM_SPAM (16) //Maximum spam messages for the player to be BANNED for spamming.
  321. #define MIN_CMD_SPAM (7) //Minimun commands spam for the player to be kicked for commands spamming.
  322. #define MAX_CMD_SPAM (16) //Maximum commands spam for the player to be BANNED for commands spamming
  323. #define MAX_COOKIE_COST 95 //How much a cookie costs!
  324. #define MAX_P_WARNS 3 //Max warns for the player to achieve to get kicked!
  325. #define MAX_TOP_LIMIT 15 //Max how many players will be shown in the top x players!
  326. #define MAX_SHOW_PER_ROW 6 //Define here how many players should be shoed on /vips /admins /muted etc per row!
  327. #define MAX_RANK_LEN (50) //Define here the max rank name lenght!
  328. #define EXTRA_MINUTES 15 /*Define how many +minutes of mute or jail the player will receive
  329. after evading with a different IP but same name, or same IP but different name*/
  330. //Files
  331. #define LOGS_LOC "0Admin/Logs/" //The location where the server will print a log of a ban/kick
  332. #define KICK_LOG "0Admin/Logs/KickLog.ini" //Naming the Kick Log
  333. #define BAN_LOG "0Admin/Logs/BanLog.ini" //Naming the Ban Log
  334. #define RCON_LOG "0Admin/Logs/RCONFails.ini" //Printing in the log what IP tried to break the RCON and with what password!
  335. #define REPORT_LOG "0Admin/Logs/Reports.ini" //Where the report logs will be saved
  336. #define SETRANK_LOG "0Admin/Logs/SetRank.ini" //A log where it will store the player that has changed rank etc..
  337. #define SETLEVEL_LOG "0Admin/Logs/SetLevel.ini" //A log where it will store the player that has changed level etc..
  338. #define SETVIP_LOG "0Admin/Logs/SetVip.ini" //A log where it will store the player that has changed vip etc..
  339. #define PMS_LOG "0Admin/Logs/PMs.ini" //Where all Personal Messages will be stored!
  340. #define WARNS_LOG "0Admin/Logs/Warns.ini" //Where the warns will be stored!
  341. #define VIPCHAT_LOG "0Admin/Logs/VIP Chat.ini" //Here saves everything admins chat trough the Admin Chat.
  342. #define ADMINCHAT_LOG "0Admin/Logs/Admin Chat.ini" //Here stores all the messages sent by VIP members
  343. #define USER_ID "0Admin/Account_ID.ini" //Saving how many accounts have been created and which was the last one
  344. #define AKA_FILE "0Admin/AKA.ini" //Sacing the AKA(Also Known As) of a player!
  345. #define SERVER_FILE "0Admin/SVSettings.ini" //The server data, where Autologin Antispam anti whatever will asve!
  346. #define DATABASE_LOC "0Admin/Database.db" //Define here where the database with the top x players and muted/jaled/frozen
  347. #define STATS_LOC "0Admin/Stats/" //Where the file of the player creates when admins uses !stats <id> in console.
  348.  
  349. //For the /SETSTAT command
  350. #define NAME 0
  351. #define MONEY 1
  352. #define SCORE 2
  353. #define COOKIES 3
  354. #define RESPECT 4
  355. #define KILLS 5
  356. #define DEATHS 6
  357. #define MESSAGES 7
  358. #define COMMANDS 8
  359. #define FCOMMANDS 9
  360. #define ONLINE 10
  361. #define LEVEL 11
  362. #define VLEVEL 12
  363. #define CPASS 13
  364. #define BACCOUNT 14
  365. #define DACCOUNT 15
  366.  
  367. #define ADMIN_SPEC_TYPE_NONE 0
  368. #define ADMIN_SPEC_TYPE_PLAYER 1
  369. #define ADMIN_SPEC_TYPE_VEHICLE 2
  370.  
  371.  
  372. //Shortcuts
  373.  
  374. #define CreateTable(%0,%1,%2)\
  375. DB::Query((%0), "CREATE TABLE IF NOT EXISTS " "`"%1"`" %2)
  376.  
  377.  
  378. //----------------------------------------
  379. #define Public:%0(%1) forward %0(%1);\
  380. public %0(%1)
  381.  
  382. //----------------------------------------
  383. #define FormatMSG(%0,%1,%2,%3)\
  384. do{\
  385. format(_S_T_R_, sizeof (_S_T_R_), (%2), %3);\
  386. SendClientMessage((%0),(%1), _S_T_R_);\
  387. }\
  388. while (False)
  389.  
  390. //----------------------------------------
  391. #define SendAdminCMD(%0,%1,%2)\
  392. do{\
  393. foreach(Player, zI){\
  394. if(P_DATA[zI][Level]> 1){\
  395. if(zI != (%0)){\
  396. format(_S_T_R_, sizeof (_S_T_R_), (%1), %2);\
  397. SendClientMessage(zI,Color:GREY, _S_T_R_);\
  398. }\
  399. }\
  400. }\
  401. }\
  402. while (False)
  403.  
  404. //----------------------------------------
  405. #define LevelCheck(%0,%1)\
  406. do{\
  407. if(P_DATA[(%0)][Level] < (%1) && !IsPlayerAdmin((%0))){\
  408. if(S_DATA[TellPlayer]){\
  409. new Str[256];\
  410. format(Str, 256, "SERVER:"W" You must be an admin level "ORAN"%d"W" to use this command!", (%1));\
  411. return SendClientMessage((%0), Color:ORAN, Str);\
  412. }else return 0;\
  413. }\
  414. }\
  415. while(False)
  416.  
  417. //----------------------------------------
  418. #define LoginCheck(%0) \
  419. do{\
  420. if(!P_DATA[(%0)][Logged])\
  421. {\
  422. if(S_DATA[TellPlayer])\
  423. {\
  424. return SendClientMessage((%0), Color:ORAN, "SERVER:"W" You must be logged in to use this command!");\
  425. }else return 0;\
  426. }\
  427. }\
  428. while(False)
  429.  
  430. //----------------------------------------
  431. #define SaveInLog(%0,%1,%2) \
  432. do\
  433. {\
  434. new File:_File = fopen((%0), io_append);\
  435. format(_S_T_R_, sizeof (_S_T_R_), %1 "\r\n", %2);\
  436. if((_File))\
  437. {\
  438. fwrite((_File), _S_T_R_);\
  439. fclose((_File));\
  440. }\
  441. }\
  442. while(False)
  443.  
  444. //----------------------------------------
  445. #define FileExist(%0);\
  446. if(!fexist(%0))\
  447. {\
  448. printf("MISSING FILE: \"%s\" doesn't exist, created by the system", %0);\
  449. new File:uFile = fopen(%0, io_write); fclose(uFile);\
  450. Fail = true;\
  451. }
  452.  
  453. //----------------------------------------
  454. #define CheckImune(%0,%1); \
  455. if(P_DATA[(%0)][Level] < P_DATA[(%1)][Level]) \
  456. return SendError(%0, "You are not allowed to use this command on this admin!");
  457.  
  458. //----------------------------------------
  459. #define VipCheck(%0, %1); \
  460. if(P_DATA[(%0)][Vip] < %1 && !IsPlayerAdmin(%0)) \
  461. return format(_S_T_R_, 256, "SERVER:"W" You must be a VIP level "ORAN"%d"W" to use this command!", %0),\
  462. SendClientMessage((%0), Color:ORAN, _S_T_R_);
  463.  
  464. //----------------------------------------
  465. #define CheckComponents(%0,%1)\
  466. if(!strcmp(GPVSEx((%0), "Type"), "None") && !P_DATA[(%0)][A_Component1] &&\
  467. !P_DATA[(%0)][A_Component2] && !P_DATA[(%0)][A_Component3] &&\
  468. !P_DATA[(%0)][A_Component4] && !P_DATA[(%0)][A_Wheels] &&\
  469. !P_DATA[(%0)][A_Color])\
  470. return SendError((%0), %1),cmd_accp((%0), "")
  471.  
  472. //----------------------------------------
  473. #define PRESSED(%0) \
  474. (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
  475.  
  476. //----------------------------------------
  477. #define RELEASED(%0) \
  478. (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))
  479.  
  480. //----------------------------------------
  481. #define OpenWriteClose(%0,%1,%2,%3);\
  482. {\
  483. new INI:%1 = INI_Open((%0));\
  484. INI_WriteInt((%1), %2, (%3));\
  485. INI_Close((%1));\
  486. }
  487. //----------------------------------------
  488. #define _0CMD(%0) \
  489. if(!strcmp(cmd, "!0" %0, true))
  490.  
  491. //----------------------------------------
  492. #define Triadic(%0)\
  493. (%0) ? ("Enabled") : ("Disabled")
  494.  
  495. //----------------------------------------
  496. #define CONSOLE(%0) \
  497. if(!strcmp(cmd, (%0), true, .length = strlen((%0))))
  498.  
  499. //----------------------------------------
  500. #define PrintError(%0) \
  501. print("\n----------------\n" %0 "\n----------------\n")
  502.  
  503. //----------------------------------------
  504. #define PrintErrorEx(%0,%1) \
  505. printf("\n----------------\n" %0 "\n----------------\n", %1)
  506.  
  507. //----------------------------------------
  508. #define loop(%0,%1) \
  509. for(new _%0; (_%0) != (%1); (_%0)++)
  510.  
  511. //----------------------------------------
  512. #define _GetField<%0>Store<%1>\
  513. DB::GetField(Result, %0, (Field), sizeof((Field)));\
  514. P_DATA[playerid][%1] = strval(Field);
  515.  
  516. //----------------------------------------
  517. #define Show(%0) \
  518. ShowPlayerDialog(playerid, Dialog:Empty, BOX, ""W"Your Commands:", (%0), "Close", "")
  519.  
  520. //----------------------------------------
  521. #define Detour<%0,%1> \
  522. CMD:%0(PARAMS) return cmd_%1(playerid, "");
  523.  
  524. native WP_Hash(buffer[], len, const str[]);
  525.  
  526. stock
  527. bool:False = false,
  528. _S_T_R_[256];
  529.  
  530. enum
  531. Colors
  532. {
  533. COL_ORAN = 0xFF5500FF,
  534. COL_GREY = 0xC3C3C3FF,
  535. COL_GREE = 0xADEB50FF,
  536. COL_FUNC = 0xFFA640FF,
  537. COL_BLUE = 0x4097EDFF,
  538. COL_WHITE = -1
  539. };
  540.  
  541. enum
  542. Dialogs
  543. {
  544. Dialog:Register D:+1, Dialog:Register1 D:+2,
  545. Dialog:Login D:+3, Dialog:Login2 D:+4,
  546. Dialog:Login3 D:+5, Dialog:Stats D:+6,
  547. Dialog:cPanel D:+7, Dialog:cPanel_Back D:+8,
  548. Dialog:cPanel_Ping D:+9, Dialog:cPanel2 D:+10,
  549. Dialog:Empty D:+11, Dialog:ACCP D:+12,
  550. Dialog:ACCP_NOS D:+13, Dialog:ACCP_COLORS D:+14,
  551. Dialog:ACCP_C_C D:+15, Dialog:ACCP_WHEELS D:+16,
  552. Dialog:ACCP_COMPS D:+17, Dialog:ACCP_SAVE D:+18,
  553. Dialog:ACCP_LOAD D:+19, Dialog:ACCP_DISCARD D:+20,
  554. Dialog:SetStatsSure D:+21, Dialog:SetStatsTrue D:+22,
  555. Dialog:TOP D:+23, Dialog:TOP_SELECT D:+24,
  556. Dialog:TOP_RESPECT D:+25, Dialog:CLICK D:+26,
  557. Dialog:CLICK_PM D:+27, Dialog:CLICK_RP D:+28,
  558. Dialog:CLICK_MONEY D:+29, Dialog:CLICK_REPORT D:+30,
  559. Dialog:PCP D:+31, Dialog:NAME D:+32,
  560. Dialog:MONEY D:+33, Dialog:SCORE D:+34,
  561. Dialog:COOKIES D:+35, Dialog:RESPECT D:+36,
  562. Dialog:KILLS D:+37, Dialog:DEATHS D:+38,
  563. Dialog:MESSAGES D:+39, Dialog:COMMANDS D:+40,
  564. Dialog:FCOMMANDS D:+41, Dialog:ONLINE D:+42,
  565. Dialog:LEVEL D:+43, Dialog:VLEVEL D:+44,
  566. Dialog:CPASS D:+45, Dialog:BACCOUNT D:+46,
  567. Dialog:DACCOUNT D:+47, Dialog:RESPECT_NEG D:+48,
  568. Dialog:RESPECT_POS D:+49, Dialog:ONLINE_H D:+50,
  569. Dialog:ONLINE_M D:+51, Dialog:ONLINE_S D:+52,
  570. Dialog:SAnswer D:+53, Dialog:SAnswer2 D:+54,
  571. Dialog:SQuestion D:+55, Dialog:ForgPass D:+56,
  572. Dialog:PCPBack D:+57, Dialog:PCPShout D:+58
  573.  
  574. };
  575. enum
  576. P_ENUM_DATA
  577. {
  578. Money, Score, MutedAll, Level,
  579. Vip, Rank, Msgs, Cmds,
  580. fCmds, Kills, Deaths, Negative,
  581. Positive, God, CarGod, Boost,
  582. Banned, Kicks, LogFail, Logged,
  583. Muted, Frozen, Jailed, cmgddon,
  584. Hours, Minutes, Seconds, TotalTime,
  585. ConnTime, AccID, MutedTime, JailTime,
  586. SpamMSG, cSpam, tLevel, PMSent,
  587. RepMSG[128], Warns, Cookies, aCar,
  588. pAuto, GiveCar, Spec_ID, Spec_Type,
  589. NosTimer, Accp_Saved, A_Color, Spin,
  590. A_Component1, A_Component2, A_Component3, A_Component4,
  591. A_Wheels, Incred, BAPMs, VIPTag,
  592. Text3D:Tag3D, Float:bSpeed
  593. };
  594. enum
  595. S_ENUM_DATA
  596. {
  597. AntiSpam, AntiCSpam, Ping, sAccounts,
  598. RconFails, RCONProt, TellPlayer, Chat,
  599. ReadPM, ReadCMD, AKA, ShowFunction,
  600. AntiRepeat, AutoLogin, AnnRank, AntiAD,
  601. sCMDS, sMSGS, sCrashes, sDisc,
  602. sConn, sKB, sPlayers, sRecord,
  603. sD, sM, sY, RecordBy[MAX_PLAYER_NAME],
  604. sH, sMi, sS, VipChat,
  605. AdminChat
  606. };
  607.  
  608. enum INI_Enum_NV { iName[15], iValue };
  609. enum INI_Server_Enum_NV { isName[15], isValue };
  610. enum WHEELS_E { iWheel, iwName[15] };
  611. enum vCOLORS_E { ivColor, ivcRGB[9], ivcName[15] };
  612. enum vCOMPONENTS_E { iComponent, icName[20] };
  613. enum RANKS_E { iRank, irName[MAX_RANK_LEN] };
  614.  
  615.  
  616. new
  617. bool:Fail = false;
  618.  
  619.  
  620. new
  621. DB:_DB,
  622. PlayerIP[MAX_PLAYERS][50],
  623. P_DATA[MAX_PLAYERS][P_ENUM_DATA],
  624. S_DATA[S_ENUM_DATA],
  625. MuteTimer[MAX_PLAYERS],
  626. JailTimer[MAX_PLAYERS],
  627. PlayerText3D:ZaAdminCar[MAX_PLAYERS],
  628. StatsString[800],
  629. WhosStats[129],
  630.  
  631. _Levels[][] =
  632. {
  633. { "Member" },
  634. { "Helper" },
  635. { "Mini Moderator" },
  636. { "Moderator" },
  637. { "Administrator" },
  638. { "Owner" }
  639. },
  640.  
  641. #if USE_RANKS == true
  642.  
  643. //When you add/remove a rank, count each rank and insert here the number:
  644. #define TOTAL_RANKS (12)
  645.  
  646. _Ranks[TOTAL_RANKS][RANKS_E] =
  647. {
  648. /* Kills Rank Name */
  649. { 0, "Looser" },
  650. { 25, "Easy Killa'" },
  651. { 50, "Baby Killer" },
  652. { 75, "e-Gangsta" },
  653. { 100, "Boss" },
  654. { 150, "Lil' Psycho" },
  655. { 200, "Psycho" },
  656. { 300, "Unstopable" },
  657. { 400, "Elite Killer" },
  658. { 600, "Godlike killer!" },
  659. { 800, "INSANE KILLER" },
  660. { 1000, "The God of Deathmatch" }//Last row must NOT have the ','
  661. },
  662. #endif
  663.  
  664. ACCP_Components[7][vCOMPONENTS_E] =
  665. {
  666. /* Model Component Name */
  667. { 1019, "Twin Exhaust" },
  668. { 1018, "Upswept Exhaust" },
  669. { 1001, "Win Spoiler" },
  670. { 1023, "Fury Spoiler" },
  671. { 1003, "Alpha Spoiler" },
  672. { 1087, "Hydraulics" },
  673. { 1017, "Skirt" }
  674. },
  675.  
  676. ACCP_Colors[16][vCOLORS_E] =
  677. {
  678. /* CarCol RRGGBB Color Name */
  679. { 1, "{FFFFFF}", "White" },
  680. { 0, "{000000}", "Black" },
  681. { 2, "{2a77a1}", "Light Blue" },
  682. { 3, "{840510}", "Dark Red" },
  683. { 25, "{253739}", "Dark Grey" },
  684. { 85, "{87446f}", "Soft Magenta" },
  685. { 6, "{d68f11}", "Orange" },
  686. { 109, "{bdbdc5}", "Grey" },
  687. { 49, "{d6dbd5}", "White Grey" },
  688. { 86, "{34603f}", "Green" },
  689. { 113, "{5f272a}", "Brown" },
  690. { 126, "{ed6aae}", "Pinky" },
  691. { 51, "{305045}", "Dark Green" },
  692. { 12, "{5e7e8d}", "Soft Blue" },
  693. { 102, "{ab9d83}", "Easy Color" },
  694. { 65, "{8f8c47}", "Ugly Green" }
  695. },
  696.  
  697.  
  698. Wheels[17][WHEELS_E] =
  699. {
  700. /* Model Wheel Name */
  701. { 1_025, "Offroad" },
  702. { 1_073, "Shadow" },
  703. { 1_074, "Mega" },
  704. { 1_075, "Rimshine" },
  705. { 1_076, "Wires" },
  706. { 1_077, "Classic" },
  707. { 1_078, "Twist" },
  708. { 1_079, "Cutter" },
  709. { 1_080, "Switch" },
  710. { 1_081, "Grove" },
  711. { 1_082, "Import" },
  712. { 1_083, "Dollar" },
  713. { 1_084, "Trance" },
  714. { 1_085, "Atomic" },
  715. { 1_096, "Ahab" },
  716. { 1_097, "Virtual" },
  717. { 1_098, "Access" }
  718. },
  719. SpamColors[35] =
  720. {
  721. 0xFBBA00FF, 0xB4B5B7AA, 0xAFAFAFAA, 0x0000BBAA, 0x800080AA,
  722. 0x000000AA, 0x33AA33AA, 0xA52A2AAA, 0xFFA00AFF, 0xFF560AFF,
  723. 0xFFD8B0FF, 0xFFD876FF, 0xFFBF3BFF, 0xFFC628FF, 0xFF4D28FF,
  724. 0xFFFF28FF, 0xC0C0C0AA, 0xFFDD80FF, 0x00DD37FF, 0x2C2727AA,
  725. 0xC968FCFF, 0xC9C0FCFF, 0xA790FCFF, 0x0097FFFF, 0xFF6463FF,
  726. 0x00DDFFFF, 0x00DDFF15, 0xC500FFFF, 0x33AA33AA, 0x00DD37FF
  727. },
  728. INI_Server_Info[16][INI_Server_Enum_NV] =
  729. {
  730. /* Feature Value */
  731. { "AntiSpam", 1 },
  732. { "AntiCMDSpam", 1 },
  733. { "MaxPing", 750 },
  734. { "RconProtect", 1 },
  735. { "TellPlayer", 1 },
  736. { "BlockChat", 0 },
  737. { "ReadPMs", 0 },
  738. { "ReadCommands", 0 },
  739. { "AKA", 1 },
  740. { "ShowFunction", 1 },
  741. { "AntiRepeat", 1 },
  742. { "AutoLogin", 0 },
  743. { "AnnRank", 1 },
  744. { "AntiAdv", 1 },
  745. { "AdminChat", 1 },
  746. { "VipChat", 1 }
  747. },
  748. vNames[212][] =
  749. {
  750. {"Landstalker"}, {"Bravura"}, {"Buffalo"}, {"Linerunner"}, {"Perrenial"}, {"Sentinel"}, {"Dumper"},
  751. {"Firetruck"}, {"Trashmaster"}, {"Stretch"}, {"Manana"}, {"Infernus"}, {"Voodoo"}, {"Pony"}, {"Mule"},
  752. {"Cheetah"}, {"Ambulance"}, {"Leviathan"}, {"Moonbeam"}, {"Esperanto"}, {"Taxi"}, {"Washington"},
  753. {"Bobcat"}, {"Mr Whoopee"}, {"BF Injection"}, {"Hunter"}, {"Premier"}, {"Enforcer"}, {"Securicar"},
  754. {"Banshee"}, {"Predator"}, {"Bus"},{"Rhino"}, {"Barracks"}, {"Hotknife"}, {"Trailer 1"}, {"Previon"},
  755. {"Coach"}, {"Cabbie"}, {"Stallion"}, {"Rumpo"}, {"RC Bandit"}, {"Romero"}, {"Packer"}, {"Monster"},
  756. {"Admiral"}, {"Squalo"}, {"Seasparrow"}, {"Pizzaboy"}, {"Tram"}, {"Trailer 2"}, {"Turismo"},
  757. {"Speeder"}, {"Reefer"}, {"Tropic"}, {"Flatbed"}, {"Yankee"}, {"Caddy"}, {"Solair"}, {"Berkley's RC Van"},
  758. {"Skimmer"}, {"PCJ-6_0_0"}, {"Faggio"}, {"Freeway"}, {"RC Baron"}, {"RC Raider"}, {"Glendale"}, {"Oceanic"},
  759. {"Sanchez"}, {"Sparrow"}, {"Patriot"}, {"Quad"}, {"Coastguard"}, {"Dinghy"}, {"Hermes"}, {"Sabre"},
  760. {"Rustler"}, {"ZR-3_5_0"}, {"Walton"}, {"Regina"}, {"Comet"},{"BMX"}, {"Burrito"}, {"Camper"}, {"Marquis"},
  761. {"Baggage"}, {"Dozer"}, {"Maverick"}, {"News Chopper"}, {"Rancher"}, {"FBI Rancher"}, {"Virgo"}, {"Greenwood"},
  762. {"Jetmax"}, {"Hotring"}, {"Sandking"}, {"Blista Compact"}, {"Police Maverick"},{"Boxville"}, {"Benson"},
  763. {"Mesa"}, {"RC Goblin"}, {"Hotring Racer A"}, {"Hotring Racer B"},{"Bloodring Banger"},{"Rancher"},
  764. {"Super GT"}, {"Elegant"}, {"Journey"}, {"Bike"}, {"Mountain Bike"}, {"Beagle"}, {"Cropdust"}, {"Stunt"},
  765. {"Tanker"}, {"Roadtrain"}, {"Nebula"}, {"Majestic"}, {"Buccaneer"}, {"Shamal"}, {"Hydra"}, {"FCR-900"},
  766. {"NRG-500"}, {"HPV1000"}, {"Cement Truck"}, {"Tow Truck"}, {"Fortune"}, {"Cadrona"}, {"FBI Truck"},
  767. {"Willard"}, {"Forklift"}, {"Tractor"}, {"Combine"}, {"Feltzer"}, {"Remington"}, {"Slamvan"},
  768. {"Blade"}, {"Freight"}, {"Streak"}, {"Vortex"}, {"Vincent"}, {"Bullet"}, {"Clover"}, {"Sadler"},
  769. {"Firetruck LA"}, {"Hustler"}, {"Intruder"}, {"Primo"}, {"Cargobob"}, {"Tampa"}, {"Sunrise"}, {"Merit"},
  770. {"Utility"}, {"Nevada"}, {"Yosemite"}, {"Windsor"}, {"Monster A"}, {"Monster B"}, {"Uranus"}, {"Jester"},
  771. {"Sultan"}, {"Stratum"}, {"Elegy"}, {"Raindance"}, {"RC Tiger"}, {"Flash"}, {"Tahoma"}, {"Savanna"},
  772. {"Bandito"}, {"Freight Flat"}, {"Streak Carriage"}, {"Kart"}, {"Mower"}, {"Duneride"}, {"Sweeper"},
  773. {"Broadway"}, {"Tornado"}, {"AT-400"}, {"DFT-30"}, {"Huntley"}, {"Stafford"}, {"BF-400"}, {"Newsvan"},
  774. {"Tug"}, {"Trailer 3"}, {"Emperor"}, {"Wayfarer"}, {"Euros"}, {"Hotdog"}, {"Club"}, {"Freight Carriage"},
  775. {"Trailer 3"}, {"Andromada"}, {"Dodo"}, {"RC Cam"}, {"Launch"}, {"Police Car LSPD"},{"Police Car SFPD"},
  776. {"Police _LVPD"}, {"Police Ranger"}, {"Picador"}, {"SWAT. Van"}, {"Alpha"}, {"Phoenix"}, {"Glendale"},
  777. {"Sadler"}, {"Luggage Trailer A"}, {"Luggage Trailer B"}, {"Stair Trailer"},{"Boxville"}, {"Farm Plow"},
  778. {"Utility Trailer"}
  779.  
  780. };
  781. #if USE_RANKS == true
  782.  
  783. new _RankNames[sizeof(_Ranks)][MAX_RANK_LEN];
  784.  
  785. #endif
  786.  
  787.  
  788. public OnPlayerUpdate(playerid)
  789. {
  790. #if STATS_STABILIZER == true
  791.  
  792. if(P_DATA[playerid][Kills] != GetPVarInt((playerid), "0_Kills"))
  793. P_DATA[(playerid)][Kills] = GetPVarInt((playerid), "0_Kills");
  794.  
  795. if(P_DATA[playerid][Deaths] != GetPVarInt((playerid), "0_Deaths"))
  796. P_DATA[(playerid)][Deaths] = GetPVarInt((playerid), "0_Deaths");
  797.  
  798. if(P_DATA[playerid][Level] != GetPVarInt((playerid), "0_Level"))
  799. P_DATA[(playerid)][Level] = GetPVarInt((playerid), "0_Level");
  800.  
  801. if(P_DATA[playerid][Vip] != GetPVarInt((playerid), "0_Vip"))
  802. P_DATA[(playerid)][Vip] = GetPVarInt((playerid), "0_Vip");
  803.  
  804. if(P_DATA[playerid][Cookies] != GetPVarInt((playerid), "0_Cookies"))
  805. P_DATA[(playerid)][Cookies] = GetPVarInt((playerid), "0_Cookies");
  806.  
  807. if(P_DATA[playerid][God] != GetPVarInt((playerid), "0_God"))
  808. P_DATA[(playerid)][God] = GetPVarInt((playerid), "0_God");
  809.  
  810. if(P_DATA[playerid][CarGod] != GetPVarInt((playerid), "0_CarGod"))
  811. P_DATA[(playerid)][CarGod] = GetPVarInt((playerid), "0_CarGod");
  812.  
  813. if(P_DATA[playerid][Positive] != GetPVarInt((playerid), "0_Positive"))
  814. P_DATA[(playerid)][Positive] = GetPVarInt((playerid), "0_Positive");
  815.  
  816. if(P_DATA[playerid][Negative] != GetPVarInt((playerid), "0_Negative"))
  817. P_DATA[(playerid)][Negative] = GetPVarInt((playerid), "0_Negative");
  818.  
  819. if(P_DATA[playerid][Boost] != GetPVarInt((playerid), "0_Boost"))
  820. P_DATA[(playerid)][Boost] = GetPVarInt((playerid), "0_Boost");
  821.  
  822. if(P_DATA[playerid][Rank] != GetPVarInt((playerid), "0_Rank"))
  823. P_DATA[(playerid)][Rank] = GetPVarInt((playerid), "0_Rank");
  824.  
  825. #endif
  826. return 1;
  827. }
  828.  
  829. public OnFilterScriptInit()
  830. {
  831. if(fexist("0Admin/"))
  832. {
  833. #if SAVE_IN_LOGS == true
  834. if(fexist(LOGS_LOC))
  835. {
  836. FileExist(VIPCHAT_LOG);
  837. FileExist(ADMINCHAT_LOG);
  838. FileExist(WARNS_LOG);
  839. FileExist(PMS_LOG);
  840. FileExist(SETRANK_LOG);
  841. FileExist(SETLEVEL_LOG);
  842. FileExist(SETVIP_LOG);
  843. FileExist(KICK_LOG);
  844. FileExist(BAN_LOG);
  845. FileExist(RCON_LOG);
  846. FileExist(REPORT_LOG);
  847. }
  848. else print("MISSING FOLDER: Folder \""#LOGS_LOC"\" doesn't exist! Please create it!"),
  849. Fail = true;
  850.  
  851. #endif
  852.  
  853. FileExist(AKA_FILE);
  854. if(!fexist(USER_ID))
  855. {
  856. printf("MISSING FILE: \""#USER_ID"\" doesn't exist, created by the system");
  857. new File:uFile = fopen(USER_ID, io_append);
  858. if(uFile)
  859. {
  860. fwrite(uFile, "Accounts_Created = 0\r\nLast_Account = None\r\nLast_Account_Date = Never");
  861. fclose(uFile);
  862. }
  863. Fail = true;
  864. }
  865.  
  866. if(!fexist(STATS_LOC))
  867. {
  868. print("MISSING FOLDER: Folder \""#STATS_LOC"\" doesn't exist! Please create it!");
  869. Fail = true;
  870. }
  871. }else print("MISSING FOLDER: The main folder \"/0Admin/\" is missing from the \"scriptfiles\""),
  872. Fail = true;
  873.  
  874. _DB = db_open(DATABASE_LOC);
  875.  
  876. new String[750];
  877. strcat(String, "CREATE TABLE IF NOT EXISTS `Accounts` ", 750);
  878. strcat(String, "(`Key` INTEGER PRIMARY KEY AUTOINCREMENT, \
  879. `IP` TEXT, \
  880. `Name` TEXT, \
  881. `Password` TEXT, \
  882. `Online` TEXT, \
  883. `JoinDate` TEXT, \
  884. `Level` NUMERIC, \
  885. `VIP` NUMERIC, \
  886. `Rank` NUMERIC, \
  887. `Autologin` NUMERIC, \
  888. `Money` NUMERIC, \
  889. `Score` NUMERIC, \
  890. `Kills` NUMERIC, \
  891. `Deaths` NUMERIC, \
  892. `Cookies` NUMERIC, \
  893. `Positive` NUMERIC, \
  894. `Negative` NUMERIC, \
  895. `Messages` NUMERIC, \
  896. `Commands` NUMERIC, \
  897. `fCommands` NUMERIC, \
  898. `Warns` NUMERIC, \
  899. `Kicks` NUMERIC, \
  900. `God` NUMERIC, \
  901. `Cargod` NUMERIC,", 750);
  902.  
  903. strcat(String, " `ACCP` NUMERIC, \
  904. `ACCPSav` TEXT, \
  905. `BlockPM` NUMERIC, \
  906. `Boost` NUMERIC, \
  907. `bSpeed` NUMERIC, \
  908. `RPassword` TEXT, \
  909. `Question` TEXT, \
  910. `Answer` TEXT, \
  911. `WearTAG` NUMERIC, \
  912. `Spin` NUMERIC, \
  913. `Incred` NUMERIC)", 750);
  914.  
  915. DB::Query(_DB, String);
  916. CreateTable(_DB, "Top", "(`Key` INTEGER PRIMARY KEY AUTOINCREMENT, `Name` TEXT,`Kills` NUMERIC,`Deaths` NUMERIC,`Hours` NUMERIC,`Rank` NUMERIC,`Ratio` TEXT,`Negative` NUMERIC,`Positive` NUMERIC)");
  917.  
  918. #if SAVE_MUTE == true
  919. CreateTable(_DB, "Muted", "(`Key` INTEGER PRIMARY KEY AUTOINCREMENT, `IP` TEXT,`Muted` NUMERIC,`Time` NUMERIC,`RealName` TEXT)");
  920. #endif
  921.  
  922. #if SAVE_JAIL == true
  923. CreateTable(_DB, "Jailed", "(`Key` INTEGER PRIMARY KEY AUTOINCREMENT, `IP` TEXT,`Jailed` NUMERIC,`Time` NUMERIC,`RealName` TEXT)");
  924. #endif
  925.  
  926. #if SAVE_FREEZE == true
  927. CreateTable(_DB, "Frozen", "(`Key` INTEGER PRIMARY KEY AUTOINCREMENT, `IP` TEXT,`Frozen` NUMERIC,`RealName` TEXT)");
  928. #endif
  929.  
  930. CreateTable(_DB, "Banlist", "(`IP` TEXT,`Name` TEXT, `Reason` TEXT, `Admin` TEXT, `BanDate` TEXT)");
  931. CreateTable(_DB, "Positive", "(`Key` INTEGER PRIMARY KEY AUTOINCREMENT, `Name` TEXT,`Expiration` TEXT)");
  932. CreateTable(_DB, "Negative", "(`Key` INTEGER PRIMARY KEY AUTOINCREMENT, `Name` TEXT,`Expiration` TEXT)");
  933. CreateTable(_DB, "ServerStats", "(`Key` INTEGER PRIMARY KEY AUTOINCREMENT, `Commands`,`Messages`,`Crashes`,`Quits`,`Kicks/Bans`,`Connections`,`Uptime`)");
  934. CreateTable(_DB, "Record", "(`Players`,`Date`,`Time`,`By`,`DateOLD`,`TimeOLD`,`ByOLD`)");
  935.  
  936. new
  937. DBResult: R1;
  938.  
  939. R1 = DB::Query(_DB, "SELECT `Players`, `Date`, `Time`, `By` FROM `Record`");
  940.  
  941. if(R1)
  942. {
  943. if(DB::Valid(R1))
  944. {
  945. new Field[64];
  946.  
  947. DB::GetField(R1, "Players", Field, 64);
  948. S_DATA[sRecord] = strval(Field);
  949.  
  950. DB::GetField(R1, "Date", Field, 64);
  951. sscanf(Field, "p</>iii", S_DATA[sD], S_DATA[sM], S_DATA[sY]);
  952.  
  953. DB::GetField(R1, "Time", Field, 64);
  954. sscanf(Field, "p<:>iii", S_DATA[sH], S_DATA[sMi], S_DATA[sS]);
  955.  
  956. DB::GetField(R1, "By", Field, 64);
  957. format(S_DATA[RecordBy], MAX_PLAYER_NAME, "%s", Field);
  958.  
  959. DB::Free(R1);
  960. }
  961. else
  962. {
  963. DB::Free(R1);
  964. DB::Query(_DB, "INSERT INTO `Record` VALUES('0','0/0/0','0:0:0','Nobody','0/0/0','0:0:0','Nobody')");
  965. }
  966. }
  967. SetTimer("PingKick", 2000, true);
  968. SetTimer("LowerSpam", LOW_SPAM_RATE, true);
  969. SetTimer("GodLike", GOD_TICK_RATE, true);
  970.  
  971.  
  972. INI_ParseFile(USER_ID, "ParseUserID" );
  973. INI_ParseFile(SERVER_FILE, "LoadServerData");
  974.  
  975. if(S_DATA[Ping] < 100 && S_DATA[Ping] != 0)
  976. {
  977. new RandomPing = 600 + random(300);
  978. printf("WARNING: Ping Kicker was under 100, randomly set to: %d", RandomPing);
  979. S_DATA[Ping] = (RandomPing);
  980. }
  981. #if USE_RANKS == true
  982.  
  983. #if PRINT_RANKS == true
  984.  
  985. print("Ranks created succesfully!\n----------------------------");
  986.  
  987. #endif
  988. for (new r = 0; r < sizeof(_Ranks); r++)
  989. {
  990. format(_RankNames[r], MAX_RANK_LEN, "%s", _Ranks[r][irName]);
  991. #if PRINT_RANKS == true
  992.  
  993. printf("Rank: %s | Kills requiered: %d", _RankNames[r], _Ranks[r][iRank]);
  994.  
  995. #endif
  996. }
  997.  
  998. #endif
  999.  
  1000. if(Fail == true)
  1001. {
  1002. print(#\n\n\nWARNING:);
  1003. print(#----------------\n- When a file is missing","# the system will create it.);
  1004. print(#- However","# if you get a folder error","# you must create the folder on your own!);
  1005. print(#- If a folder or a file is deleted while the server runs","# problems may occur!\n\n);
  1006. }
  1007. if(fexist("/0Admin/"))
  1008. {
  1009. if(!fexist(SERVER_FILE))
  1010. {
  1011. printf("MISSING FILE: \""#SERVER_FILE"\" doesn't exist, created by the system");
  1012. print("Thew following atributions have been added to the following features:");
  1013.  
  1014. new INI:ServerFile = INI_Open(SERVER_FILE),
  1015. pStr[512];
  1016. print("\n==========================================");
  1017. print("||\tFeature\t\tState\tValue\t||");
  1018. print("||--------------------------------------||");
  1019.  
  1020. for(new i = 0; i < sizeof(INI_Server_Info); ++i)
  1021. {
  1022. INI_WriteInt(ServerFile, INI_Server_Info[i][isName], INI_Server_Info[i][isValue]);
  1023. format(pStr, sizeof (pStr), "||\t%s%s| %s%s",
  1024. INI_Server_Info[i][isName],
  1025. (i == 2 || i == 6 || i == 8 || i == 12 || i == 13 || i == 15) ? ("\t\t") : ("\t"),
  1026. (INI_Server_Info[i][isValue]) ? ((i == 2) ? (EX(INI_Server_Info[i][isValue])) : ("Yes")) : ("No"),
  1027. (INI_Server_Info[i][isValue]) ? ((i == 2) ? ("\t||") : ("\t\t||")) : ("\t\t||"));
  1028. print(pStr);
  1029. }
  1030.  
  1031. print("==================\t\t\t||");
  1032. print("\t\t|| Copyright Zh3r0 2011 ||");
  1033. print("\t\t==========================\n\n\n");
  1034. INI_Close(ServerFile);
  1035. INI_ParseFile(SERVER_FILE, "LoadServerData");
  1036. }
  1037. }
  1038. if(!Fail) SetTimer("Display", 800, 0);
  1039.  
  1040.  
  1041. /*new
  1042. cmdBuffer[32],
  1043. commandCount;
  1044.  
  1045. for(new it = 0; it < Scripting_GetPublicsCount(); it++) {
  1046. Scripting_GetPublic(it, cmdBuffer);
  1047.  
  1048. if(!strcmp(cmdBuffer, "cmd_", false, 4)) {
  1049. strdel(cmdBuffer, 0, 4);
  1050. strins(cmdBuffer, "/", 0);
  1051. strins(cmdBuffer, "\r\n", strlen(cmdBuffer));
  1052. printf(#%d. %s, it - 47, cmdBuffer);
  1053. new File:F = fopen("Cmds.txt", io_append);
  1054.  
  1055. if(F)
  1056. {
  1057. fwrite(F, cmdBuffer);
  1058. fclose(F);
  1059. }
  1060.  
  1061. commandCount++;
  1062. }
  1063. }
  1064. printf(#A total of %d commands, commandCount);*/
  1065. return 1;
  1066. }
  1067. stock CountZCMDCmds() {
  1068. new
  1069. cmdBuffer[32],
  1070. commandCount;
  1071.  
  1072. for(new it = 0; it < Scripting_GetPublicsCount(); it++) {
  1073. Scripting_GetPublic(it, cmdBuffer);
  1074.  
  1075. if(!strcmp(cmdBuffer, "cmd_", false, 4)) {
  1076. commandCount++;
  1077. }
  1078. }
  1079.  
  1080. return commandCount;
  1081. }
  1082. public OnFilterScriptExit()
  1083. {
  1084.  
  1085. db_close(_DB);
  1086.  
  1087. if(fexist(SERVER_FILE))
  1088. {
  1089. new INI:ServerFile = INI_Open(SERVER_FILE);
  1090.  
  1091. INI_WriteInt(ServerFile, INI_Server_Info[0][isName], S_DATA[AntiSpam]);
  1092. INI_WriteInt(ServerFile, INI_Server_Info[1][isName], S_DATA[AntiCSpam]);
  1093. INI_WriteInt(ServerFile, INI_Server_Info[2][isName], S_DATA[Ping]);
  1094. INI_WriteInt(ServerFile, INI_Server_Info[3][isName], S_DATA[RCONProt]);
  1095. INI_WriteInt(ServerFile, INI_Server_Info[4][isName], S_DATA[TellPlayer]);
  1096. INI_WriteInt(ServerFile, INI_Server_Info[5][isName], S_DATA[Chat]);
  1097. INI_WriteInt(ServerFile, INI_Server_Info[6][isName], S_DATA[ReadPM]);
  1098. INI_WriteInt(ServerFile, INI_Server_Info[7][isName], S_DATA[ReadCMD]);
  1099. INI_WriteInt(ServerFile, INI_Server_Info[8][isName], S_DATA[AKA]);
  1100. INI_WriteInt(ServerFile, INI_Server_Info[9][isName], S_DATA[ShowFunction]);
  1101. INI_WriteInt(ServerFile, INI_Server_Info[10][isName], S_DATA[AntiRepeat]);
  1102. INI_WriteInt(ServerFile, INI_Server_Info[11][isName], S_DATA[AutoLogin]);
  1103. INI_WriteInt(ServerFile, INI_Server_Info[12][isName], S_DATA[AnnRank]);
  1104. INI_WriteInt(ServerFile, INI_Server_Info[13][isName], S_DATA[AntiAD]);
  1105. INI_WriteInt(ServerFile, INI_Server_Info[14][isName], S_DATA[AdminChat]);
  1106. INI_WriteInt(ServerFile, INI_Server_Info[15][isName], S_DATA[VipChat]);
  1107. INI_Close(ServerFile);
  1108. }
  1109. return 1;
  1110. }
  1111. public OnRconCommand(cmd[])
  1112. {
  1113. new
  1114. Player, P2, Reason[129];
  1115.  
  1116.  
  1117. if(!strcmp(cmd, ">", true, .length = 1))
  1118. {
  1119. if(!sscanf(cmd[1], "s[129]", Reason))
  1120. {
  1121. FormatMSG(0, Color:BLUE, "Zh3r0: "W"%s", Reason);
  1122. }
  1123. }
  1124. CONSOLE("!stats")
  1125. {
  1126. if(!sscanf(cmd[6], "uD(0)", Player, P2))
  1127. {
  1128. if(Player != (0xFFFF))
  1129. {
  1130. new
  1131. Str[24],fStr[500];
  1132.  
  1133. format(Str, sizeof(Str) + strlen(STATS_LOC), ""#STATS_LOC"%s.ini", Name(Player));
  1134.  
  1135.  
  1136. format(fStr, sizeof (fStr), "Date: %s\r\n------------------------------------------\r\n\
  1137. Registration Date: %s\r\n\
  1138. IP: %s\r\n\
  1139. Account ID: %d\r\n\
  1140. Level: %d\r\n\
  1141. VIP: %d\r\n\
  1142. Rank: %d\r\n\
  1143. Commands Used: %d\r\n\
  1144. Failed Commands: %d\r\n\
  1145. Messages Sent: %d\r\n\
  1146. Cookies: %d\r\n\
  1147. Online: %s\r\n\
  1148. Respect: %d/-%d\r\n\
  1149. Money: %d\r\n\
  1150. Score: %d\r\n\
  1151. Deaths: %d\r\n\
  1152. Kills: %d\r\n\
  1153. Ratio: %.3f\r\n\
  1154. Kicks Received: %d\r\n",
  1155. zDate (),
  1156. GPVSEx(Player, "AccountDate"),
  1157. PlayerIP[Player],
  1158. P_DATA[Player][AccID],
  1159. P_DATA[Player][Level],
  1160. P_DATA[Player][Vip],
  1161. P_DATA[Player][Rank],
  1162. P_DATA[Player][Cmds],
  1163. P_DATA[Player][fCmds],
  1164. P_DATA[Player][Msgs],
  1165. P_DATA[Player][Cookies],
  1166. FormatOnline(Player),
  1167. P_DATA[Player][Positive],
  1168. P_DATA[Player][Negative],
  1169. GetPlayerMoney(Player),
  1170. GetPlayerScore(Player),
  1171. P_DATA[Player][Deaths],
  1172. P_DATA[Player][Kills],
  1173. (Float:P_DATA[Player][Deaths] / Float:P_DATA[Player][Kills]),
  1174. P_DATA[Player][Kicks]);
  1175.  
  1176.  
  1177.  
  1178. if(P2 > 0) print(fStr);
  1179. printf("\n---------------------------------------------------------------------\n\
  1180. # %s's stats saved inside\n\n# "STATS_LOC"%s.ini\n\n# Open for his account details.\n\
  1181. ---------------------------------------------------------------------\n\
  1182. Type !stats <id> 1 to see them in the console.", Name(Player), Name(Player));
  1183. new
  1184. File:Stats = fopen(Str, io_append);
  1185.  
  1186. if(Stats)
  1187. {
  1188. if(fexist(Str)) fwrite(Stats, "\r\n\r\n\r\n");
  1189. fwrite(Stats, fStr);
  1190. fclose(Stats);
  1191. }
  1192. }
  1193. else PrintError("Player not connected!");
  1194. }
  1195. else PrintError("Invalid Syntax");
  1196. }
  1197. CONSOLE("!warn")
  1198. {
  1199. if(!sscanf(cmd[5], "u", Player))
  1200. {
  1201. if(Player != (0xFFFF))
  1202. {
  1203. ++P_DATA[Player][Warns];
  1204.  
  1205. if(P_DATA[Player][Warns] != MAX_P_WARNS){
  1206. printf(" >>> You warned %s. (Warn Level: %d/"#MAX_P_WARNS")", Name(Player), P_DATA[Player][Warns]);}
  1207.  
  1208. else if(P_DATA[Player][Warns] >= MAX_P_WARNS){
  1209. P_DATA[Player][Warns] = 0,
  1210. 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]);}
  1211.  
  1212. 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]);
  1213. SendAdminCMD(Player, "Owner of the server warned player %s. ("ORAN"%d"GREY"/"ORAN""#MAX_P_WARNS")", Name(Player), P_DATA[Player][Warns]);
  1214. }
  1215. else PrintError("Player not connected!");
  1216. }
  1217. else PrintError("Invalid Syntax");
  1218. }
  1219. CONSOLE("!2012")
  1220. {
  1221. if(!sscanf(cmd[5], "u", Player))
  1222. {
  1223. if(Player != (0xFFFF))
  1224. {
  1225. for (new w = 0; w < 11; w++)
  1226. {SetPlayerSkillLevel(Player, w, 0);}
  1227.  
  1228. SetPlayerHealth(Player, 0.1); SetPlayerArmour(Player, 0.0);
  1229. SetPlayerTime(Player, 0, 0); SetPlayerWeather(Player, -66);
  1230. SetPlayerWantedLevel(Player, 6); SetPlayerSkin(Player, 159);
  1231. ResetPlayerWeapons(Player); GivePlayerWeapon(Player, 10, 1);
  1232. ResetPlayerMoney(Player); SetPlayerScore(Player, 0);
  1233. SetPlayerDrunkLevel(Player, 99999);
  1234.  
  1235. printf(" >>> You fucked up %s's game!.", Name(Player));
  1236. SendClientMessage(Player, Color:GREY, "You have been fucked up by the owner of the server!");
  1237. SendAdminCMD(Player, "Owner of the server fucked up player %s", Name(Player));
  1238.  
  1239. new
  1240. String[MAX_PLAYER_NAME];
  1241.  
  1242. format(String, MAX_PLAYER_NAME, "[NUB]%s", Name(Player));
  1243. if(strfind(Name(Player), "[NUB]", false, 0)) SetPlayerName(Player, String);
  1244. }
  1245. else PrintError("Player not connected!");
  1246. }
  1247. else PrintError("Invalid Syntax");
  1248. }
  1249. CONSOLE("!kill")
  1250. {
  1251. if(!sscanf(cmd[5], "u", Player))
  1252. {
  1253. if(Player != (0xFFFF))
  1254. {
  1255. SetPlayerHealth(Player, 0.0);
  1256.  
  1257. printf(" >>> You killed %s.", Name(Player));
  1258. SendClientMessage(Player, Color:GREY, "You have been killed by the owner of the server!");
  1259. SendAdminCMD(Player, "Owner of the server killed player %s", Name(Player));
  1260. }
  1261. else PrintError("Player not connected!");
  1262. }
  1263. else PrintError("Invalid Syntax");
  1264. }
  1265. CONSOLE("!setonline")
  1266. {
  1267. new
  1268. T[3];
  1269. if(!sscanf(cmd[10], "udD(0)D(0)", Player, T[0], T[1], T[2]))
  1270. {
  1271. if(Player != (0xFFFF))
  1272. {
  1273. if(T[1] > 60 || T[1] < 0) return PrintError("Invalid minutes!");
  1274. if(T[2] > 60 || T[2] < 0) return PrintError("Invalid seconds!");
  1275.  
  1276. P_DATA[Player][Hours] = T[0];
  1277. P_DATA[Player][Minutes] = T[1];
  1278. P_DATA[Player][Seconds] = T[2];
  1279.  
  1280. P_DATA[Player][ConnTime] = gettime();
  1281.  
  1282. printf(" >>> You set %s's online time to %d:%d:%d.",Name(Player), T[0], T[1], T[2]);
  1283. 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]);
  1284. 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]);
  1285. }
  1286. else PrintError("Player not connected!");
  1287. }
  1288. else PrintError("Invalid Syntax");
  1289. }
  1290. CONSOLE("!spawn")
  1291. {
  1292. if(!sscanf(cmd[6], "u", Player))
  1293. {
  1294. if(Player != (0xFFFF))
  1295. {
  1296. SpawnPlayer(Player);
  1297.  
  1298. printf(" >>> You spawned %s.", Name(Player));
  1299. SendClientMessage(Player, Color:GREY, "You have been spawned by the owner of the server!");
  1300. SendAdminCMD(Player, "Owner of the server spawned player %s", Name(Player));
  1301. }
  1302. else PrintError("Player not connected!");
  1303. }
  1304. else PrintError("Invalid Syntax");
  1305. }
  1306. CONSOLE("!unfreeze")
  1307. {
  1308. if(!sscanf(cmd[9], "u", Player))
  1309. {
  1310. if(Player != (0xFFFF))
  1311. {
  1312. if(P_DATA[Player][Frozen])
  1313. {
  1314. P_DATA[Player][Frozen] = 0;
  1315. UnFreeze(Player);
  1316.  
  1317. #if SAVE_FREEZE == true
  1318.  
  1319. new Query[256], DBResult:Result;
  1320. format(Query, 256, "SELECT `Key` FROM `Frozen` WHERE `IP` = '%s'", GetPlayerIPEx(Player));
  1321. Result = DB::Query(_DB, Query);
  1322.  
  1323. if(Result)
  1324. {
  1325. if(DB::Valid(Result))
  1326. {
  1327. DB::Free(Result);
  1328. format(Query, 256, "DELETE FROM `Frozen` WHERE `IP` = '%s'", GetPlayerIPEx(Player));
  1329. DB::Query(_DB, Query);
  1330. }
  1331. else DB::Free(Result);
  1332. }
  1333.  
  1334. #endif
  1335.  
  1336. printf(" >>> You unfroze %s.", Name(Player));
  1337. SendClientMessage(Player, Color:GREY, "You have been unfrozen by the owner of the server!");
  1338. SendAdminCMD(Player, "Owner of the server unfrozen player %s", Name(Player));
  1339. }
  1340. else PrintError("Player is is not frozen!");
  1341. }
  1342. else PrintError("Player not connected!");
  1343. }
  1344. else PrintError("Invalid Syntax");
  1345. }
  1346. CONSOLE("!freeze")
  1347. {
  1348. if(!sscanf(cmd[7], "u", Player))
  1349. {
  1350. if(Player != (0xFFFF))
  1351. {
  1352. if(!P_DATA[Player][Frozen])
  1353. {
  1354. P_DATA[Player][Frozen] = 1;
  1355. Freeze(Player);
  1356.  
  1357. #if SAVE_FREEZE == true
  1358.  
  1359. new
  1360. Query[256],
  1361. DBResult:R1;
  1362. format(Query, sizeof(Query), "SELECT `Key` FROM `Frozen` WHERE `IP` = '%s'", GetPlayerIPEx(Player));
  1363. R1 = DB::Query(_DB, Query);
  1364.  
  1365. if(R1)
  1366. {
  1367. if(!DB::Valid(R1))
  1368. {
  1369. DB::Free(R1);
  1370. format(Query, sizeof(Query), "INSERT INTO `Frozen` VALUES(NULL, '%s', '1', '%s')",GetPlayerIPEx(Player), Name(Player));
  1371. DB::Query(_DB, Query);
  1372. }
  1373. else
  1374. {
  1375. DB::Free(R1);
  1376. format(Query, sizeof(Query), "UPDATE `Frozen` SET `Frozen` = '1', `RealName` = '%s' WHERE `IP` = '%s'", Name(Player), GetPlayerIPEx(Player));
  1377. DB::Query(_DB, Query);
  1378. }
  1379. }
  1380.  
  1381. #endif
  1382.  
  1383. printf(" >>> You froze %s.", Name(Player));
  1384. SendClientMessage(Player, Color:GREY, "You have been frozen by the owner of the server!");
  1385. SendAdminCMD(Player, "Owner of the server froze player %s", Name(Player));
  1386. }
  1387. else PrintError("Player is already frozen!");
  1388. }
  1389. else PrintError("Player not connected!");
  1390. }
  1391. else PrintError("Invalid Syntax");
  1392. }
  1393. CONSOLE("!unmute")
  1394. {
  1395. if(!sscanf(cmd[7], "u", Player))
  1396. {
  1397. if(Player != (0xFFFF))
  1398. {
  1399. if(P_DATA[Player][Muted])
  1400. {
  1401. P_DATA[Player][Muted] = 0;
  1402. P_DATA[Player][MutedTime] = 0;
  1403.  
  1404. KillTimer(MuteTimer[Player]);
  1405.  
  1406. #if SAVE_MUTE == true
  1407.  
  1408. new
  1409. Query[256];
  1410. format(Query, 256, "DELETE FROM `Muted` WHERE `IP` = '%s'", GetPlayerIPEx(Player));
  1411. DB::Query(_DB, Query);
  1412.  
  1413. #endif
  1414.  
  1415. printf(" >>> You unmuted %s.", Name(Player));
  1416. SendClientMessage(Player, Color:GREY, "You have been unmuted by the owner of the server!");
  1417. SendAdminCMD(Player, "Owner of the server unmuted player %s", Name(Player));
  1418. }
  1419. else PrintError("Player is not muted!");
  1420. }
  1421. else PrintError("Player not connected!");
  1422. }
  1423. else PrintError("Invalid Syntax");
  1424. }
  1425. CONSOLE("!mute")
  1426. {
  1427. if(!sscanf(cmd[5], "uD(0)", Player, P2))
  1428. {
  1429. if(Player != (0xFFFF))
  1430. {
  1431. if(!P_DATA[Player][Muted])
  1432. {
  1433.  
  1434. if(!P2)
  1435. {
  1436. P_DATA[Player][Muted] = 1;
  1437. P_DATA[Player][MutedTime] = 0;
  1438.  
  1439.  
  1440. #if SAVE_MUTE == true
  1441.  
  1442. new
  1443. pQue[256];
  1444.  
  1445. format(pQue, 256, "SELECT `Key` FROM `Muted` WHERE `IP` = '%s'", GetPlayerIPEx(Player));
  1446. new DBResult:R1 = DB::Query(_DB, pQue);
  1447.  
  1448. if(R1)
  1449. {
  1450. if(!DB::Valid(R1))
  1451. {
  1452. DB::Free(R1);
  1453. format(pQue, sizeof (pQue), "INSERT INTO `Muted` VALUES(NULL, '%s', '1', '0', '%s')", GetPlayerIPEx(Player), Name(Player));
  1454. DB::Query(_DB, pQue);
  1455. }
  1456. else
  1457. {
  1458. DB::Free(R1);
  1459. format(pQue, sizeof (pQue), "UPDATE `Muted` SET `Muted` = '1', `Time` = '0', `RealName` = '%s' WHERE `IP` = '%s'", Name(Player), GetPlayerIPEx(Player));
  1460. DB::Query(_DB, pQue);
  1461. }
  1462. }
  1463.  
  1464. #endif
  1465. printf(" >>> You muted %s forever", Name(Player));
  1466. SendAdminCMD(INVALID_PLAYER_ID, "The owner of the server muted player "ORAN"%s[%i]"GREY" forever.", Name(Player), Player);
  1467. SendClientMessage(Player, Color:GREY, "You have been muted forever by the owner of the server!");
  1468. }
  1469. else
  1470. {
  1471. P_DATA[Player][Muted] = 1;
  1472.  
  1473. 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);
  1474. FormatMSG(Player, Color:GREY, "You have been muted by the owner of the server! "W"["GREE"Time: "W"%d"GREY" seconds"W"]", P2);
  1475.  
  1476. #if SAVE_MUTE == true
  1477.  
  1478. new
  1479. pQue[256];
  1480.  
  1481. format(pQue, 256, "SELECT `Key` FROM `Muted` WHERE `IP` = '%s'", GetPlayerIPEx(Player));
  1482. new DBResult:R1 = DB::Query(_DB, pQue);
  1483.  
  1484. if(R1)
  1485. {
  1486. if(!DB::Valid(R1))
  1487. {
  1488. DB::Free(R1);
  1489. format(pQue, sizeof (pQue), "INSERT INTO `Muted` VALUES(NULL, '%s', '1', '%d', '%s')", GetPlayerIPEx(Player), P2, Name(Player));
  1490. DB::Query(_DB, pQue);
  1491. }
  1492. else
  1493. {
  1494. DB::Free(R1);
  1495. format(pQue, sizeof (pQue), "UPDATE `Muted` SET `Muted` = '1', `Time` = '%d', `RealName` = '%s' WHERE `IP` = '%s'", P2, Name(Player), GetPlayerIPEx(Player));
  1496. DB::Query(_DB, pQue);
  1497. }
  1498. }
  1499.  
  1500. #endif
  1501. printf(" >>> You muted %s for %d seconds!", Name(Player), P2);
  1502.  
  1503. KillTimer(MuteTimer[Player]);
  1504. MuteTimer[Player] = SetTimerEx("UnMutePlayer", P2, true, "i", Player);
  1505. P_DATA[Player][MutedTime] = P2;
  1506. }
  1507. }else PrintError("Player is already muted!");
  1508. }
  1509. else PrintError("Player not connected!");
  1510. }
  1511. else PrintError("Invalid Syntax");
  1512. }
  1513. CONSOLE("!ban")
  1514. {
  1515. if(!sscanf(cmd[4], "uS(No Reason)[129]", Player, Reason))
  1516. {
  1517. if(Player != (0xFFFF))
  1518. {
  1519. printf(" >>> You banned %s from the server", Name(Player));
  1520. printf(" >>> REASON: %s", Reason);
  1521. SendClientMessage(Player, Color:GREY, " * You have been banned from the server by the owner. ");
  1522. FormatMSG(Player, Color:BLUE, "REASON: "W"%s", Reason);
  1523. SendAdminCMD(INVALID_PLAYER_ID, ""BLUE"%s"GREY" has been banned from the server by the server owner!", Name(Player));
  1524. BanEx2(Player, "CONSOLE OWNER", Reason);
  1525. }
  1526. else PrintError("Player not connected!");
  1527. }
  1528. else PrintError("Invalid Syntax");
  1529. return 1;
  1530. }
  1531. CONSOLE("!kick")
  1532. {
  1533. if(!sscanf(cmd[5], "uS(No Reason)[129]", Player, Reason))
  1534. {
  1535. if(Player != (0xFFFF))
  1536. {
  1537. printf(" >>> You kicked %s from the server", Name(Player));
  1538. printf(" >>> REASON: %s", Reason);
  1539. SendClientMessage(Player, Color:GREY, " * You have been kicked from the server by the owner. ");
  1540. FormatMSG(Player, Color:BLUE, "REASON: "W"%s", Reason);
  1541. KickEx(Player, "CONSOLE OWNER", Reason, false);
  1542. SendAdminCMD(INVALID_PLAYER_ID, ""BLUE"%s"GREY" has been kicked from the server by the server owner!", Name(Player));
  1543. }
  1544. else PrintError("Player not connected!");
  1545. }
  1546. else PrintError("Invalid Syntax");
  1547. return 1;
  1548. }
  1549. CONSOLE("!setrank")
  1550. {
  1551. if(!sscanf(cmd[8], "ud", Player, P2))
  1552. {
  1553. if(Player != (0xFFFF))
  1554. {
  1555. if(P2 > 0 || P2 < sizeof(_Ranks) - 1)
  1556. {
  1557. #if SAVE_IN_LOGS == true
  1558. 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());
  1559. #endif
  1560.  
  1561. 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));
  1562.  
  1563. printf(" >>> You %s %s to rank to %d | %s.", (P_DATA[Player][Rank] < P2) ? ("promoved") : ("demoted"), Name(Player), P2, RankName(P2));
  1564.  
  1565. P_DATA[Player][Rank] = P2;
  1566. }
  1567. else PrintErrorEx("Maximu rank level is: %d", sizeof(_Ranks) - 1);
  1568. }
  1569. else PrintError("Player not connected!");
  1570. }
  1571. else PrintError("Invalid Syntax");
  1572. return 1;
  1573. }
  1574. CONSOLE("!setvip")
  1575. {
  1576. if(!sscanf(cmd[7], "ud", Player, P2))
  1577. {
  1578. if(Player != (0xFFFF))
  1579. {
  1580. if(P2 < 5 || P2 > 0)
  1581. {
  1582. #if SAVE_IN_LOGS == true
  1583.  
  1584. 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());
  1585. #endif
  1586. P_DATA[Player][Vip] = P2;
  1587. printf(" >>> You %s %s's VIP level to %d.",(P_DATA[Player][Vip] < P2) ? ("promoved") : ("demoted"), Name(Player), P2);
  1588. 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);
  1589. }
  1590. else PrintError("Min. VIP: 0 | Max. VIP: 3");
  1591. }
  1592. else PrintError("Player not connected!");
  1593. }
  1594. else PrintError("Invalid Syntax");
  1595. return 1;
  1596. }
  1597. CONSOLE("!setlevel")
  1598. {
  1599. if(!sscanf(cmd[9], "ud", Player, P2))
  1600. {
  1601. if(Player != (0xFFFF))
  1602. {
  1603. if(P2 < 5 || P2 > 0)
  1604. {
  1605. #if SAVE_IN_LOGS == true
  1606. 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());
  1607. #endif
  1608.  
  1609. printf(" >>> You %s %s as %s of the server! (Level: %d)", (P_DATA[Player][Level] < P2) ? ("promoved") : ("demoted"), Name(Player), LevelName(P2), P2);
  1610.  
  1611. P_DATA[Player][Level] = P2;
  1612. 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);
  1613. }
  1614. else PrintError("Min. level: 0 | Max. level: 5");
  1615. }
  1616. else PrintError("Player not connected!");
  1617. }
  1618. else PrintError("Invalid Syntax");
  1619. return 1;
  1620. }
  1621. _0CMD("cmds")
  1622. {
  1623. print("Commands trough console of 0Admin System V"#Version"");
  1624. print("------------------------------------------------------\n");
  1625. print(" !setlevel <id> <level>\t!setvip <id> <vip>" );
  1626. print(" !setrank <id> <rank>\t\t!ranks <no params>");
  1627. print(" !kick <id> <reason>\t\t!ban <id> <reason>");
  1628. print(" ![un]mute <id> <time>\t\t![un]freeze <id>");
  1629. print(" ![un]jail <id> <time>\t\t!spawn <id>" );
  1630. print(" !setonline <id> <h> <m> <s>\t!kill <id>" );
  1631. print(" !2012 <id>\t\t\t!stats <id>" );
  1632. }
  1633. _0CMD("features")
  1634. {
  1635.  
  1636. new
  1637. pStr[1_5];
  1638.  
  1639. if(!S_DATA[Ping]) pStr = "\tN/A"; else format(pStr, 1_5, "\t\t%d", S_DATA[Ping]);
  1640. print ("-------------------------------------------------");
  1641. print ("| Feature\t\tState\t\tValue\t|" );
  1642. print ("-------------------------------------------------");
  1643.  
  1644. printf("| Anti Spam\t\t%s%sN/A\t|\n\
  1645. | Anti CMD Spam\t%s%sN/A\t|\n\
  1646. | Ping Kicker\t\t%s%s\t|\n\
  1647. | RCON Protection\t%s%sN/A\t|\n\
  1648. | Tell Player\t\t%s%sN/A\t|\n\
  1649. | Block Chat\t\t%s%sN/A\t|\n\
  1650. | Read PM\t\t%s%sN/A\t|\n\
  1651. | Read Commands\t%s\tN/A\t|",
  1652. Triadic(S_DATA[AntiSpam] ),
  1653. S_DATA[AntiSpam] ? ("\t\t") :("\t"),
  1654. Triadic(S_DATA[AntiCSpam]),
  1655. S_DATA[AntiCSpam] ? ("\t\t") :("\t"),
  1656. Triadic(S_DATA[Ping] ),pStr,
  1657. Triadic(S_DATA[RCONProt] ),
  1658. S_DATA[RCONProt] ? ("\t\t") :("\t"),
  1659. Triadic(S_DATA[TellPlayer]),
  1660. S_DATA[TellPlayer] ? ("\t\t") :("\t"),
  1661. Triadic(S_DATA[Chat] ),
  1662. S_DATA[Chat] ? ("\t\t") :("\t"),
  1663. Triadic(S_DATA[ReadPM] ),
  1664. S_DATA[ReadPM] ? ("\t\t") :("\t"),
  1665. Triadic(S_DATA[ReadCMD] ));
  1666.  
  1667. printf("| AKA\t\t\t%s%sN/A\t|\n\
  1668. | Show Function\t%s%sN/A\t|\n\
  1669. | Anti Repeat\t\t%s%sN/A\t|\n\
  1670. | Auto Login\t\t%s%sN/A\t|\n\
  1671. | Announce Rank\t%s%sN/A\t|\n\
  1672. | Anti Advertising\t%s%sN/A\t|",
  1673. Triadic(S_DATA[AKA] ),
  1674. S_DATA[AKA] ? ("\t\t") :("\t"),
  1675. Triadic(S_DATA[ShowFunction]),
  1676. S_DATA[ShowFunction] ? ("\t\t") :("\t"),
  1677. Triadic(S_DATA[AntiRepeat] ),
  1678. S_DATA[AntiRepeat] ? ("\t\t") :("\t"),
  1679. Triadic(S_DATA[AutoLogin] ),
  1680. S_DATA[AutoLogin] ? ("\t\t") :("\t"),
  1681. Triadic(S_DATA[AnnRank] ),
  1682. S_DATA[AnnRank] ? ("\t\t") :("\t"),
  1683. Triadic(S_DATA[AntiAD] ),
  1684. S_DATA[AntiAD] ? ("\t\t") :("\t"));
  1685. print ("-------------------------------------------------");
  1686. }
  1687. _0CMD("info")
  1688. {
  1689. print("\n\n\n");
  1690. print("Informations about 0Admin System V"#Version"");
  1691. print("------------------------------------------------------\n");
  1692. print(" - The idea of creating a new and optimised Admin System came\n\
  1693. to me when i was seeing all these new and old fashioned admin\n\
  1694. scripts with the oldest functions and less optimisation.\n\
  1695. So i decided to start working on a new and unique admin script\n\
  1696. that everyone will enjoy no mather what server you own,\n\
  1697. Stunt, RP, Freeroam, Trucking, etc.\n");
  1698. print(" - The system is provided with the fastest functions like sscanf\n\
  1699. ZCMD - the almost fastest command processor and of course\n\
  1700. using Regular Expresions to detect an advertising in chat.\n\n \
  1701. - The system is mostly based on dialogs, for example Control Panel\n\
  1702. which is available for Admins and VIP or regular members to control\n\
  1703. and use them whenever they need with a vast ease.\n");
  1704. print(" - The basic idea was to let all kind of people that don't know\n\
  1705. the basics or it's new into this kind of game. That's the main\n\
  1706. reason for using so many dialogs, because many don't really know\n\
  1707. or forgot commands name, so I decidede to pack everything up\n\
  1708. and insert it into a dialog.\n");
  1709. print(" - The story ends here, main reason was told. ");
  1710. print("------------------------------------------------------\n");
  1711.  
  1712. }
  1713. _0CMD("credits")
  1714. {
  1715. print("\n\n\n");
  1716. print("Credits to those that helped building 0Admin System V"#Version"");
  1717. print("-------------------------------------------------------------------\n");
  1718. print(" > Helpers: " );
  1719. print("\t sOnGoKu - Helped with the major tests and always reliable" );
  1720. print("\t ScEpTyK - Testing." );
  1721. print("\t Rock - Testing the Anti-Mute/Jail/Freeze." );
  1722. print("\t XpLoD - Gave me some ideas for the script." );
  1723. print("\t FarSe - Opened to me the way of SQLite and its magic.\n" );
  1724. print(" > Scipts:" );
  1725. print("\t Y_Less - For Y_Ini, sscanf2 and foreach also optimisation tips.");
  1726. print("\t ZeeX - For ZCMD, the almost fastest command processor");
  1727. print("\t Fro1sha - Regular expressions\n" );
  1728. print("-------------------------------------------------------------------");
  1729. print(" > And the creator is Zh3r0." );
  1730. print("------" );
  1731. }
  1732. if(!strcmp(cmd, "!help", true))
  1733. {
  1734. print("\n\n\n");
  1735. print("Help for 0Admin System V"#Version"");
  1736. print("--------------------------------------------------------");
  1737. print(" # Type !0cmds to use a command inside a server." );
  1738. print(" # Type !0credits to see the credits." );
  1739. print(" # Type !0info to see informations about this system." );
  1740. print(" # Type !0FAQ for answers to your problems." );
  1741. print(" # Type !0svstats to see the stats of the server." );
  1742. print(" # Type !0features to see enabled/disabled features." );
  1743. print("--------------------------------------------------------");
  1744. print(" > Check often the forums for new updates!");
  1745. print("------");
  1746. }
  1747. if(!strcmp(cmd, "reload0", true))
  1748. {
  1749. SendRconCommand("reloadfs 0Admin");
  1750. print("Reloading 0Admin!");
  1751. }
  1752. return 1;
  1753. }
  1754.  
  1755. #if USE_RANKS == true
  1756. CheckRank(killer, rank)
  1757. {
  1758. if(P_DATA[killer][Kills] == _Ranks[rank][iRank])
  1759. return 1;
  1760.  
  1761. return 0;
  1762. }
  1763. AnnounceRank(killer, rank)
  1764. {
  1765. new Str[256];
  1766. format(Str, sizeof (Str), "RANK UP: "GREY" You are now a member with Rank "ORAN"%d"GREY" |"ORAN" %s", rank, RankName(rank));
  1767. SendClientMessage(killer, Color:ORAN, Str);
  1768. SetPVarInt(killer, "0_Rank", rank);
  1769. P_DATA[killer][Rank] = rank;
  1770. if(S_DATA[AnnRank])
  1771. {
  1772. 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));
  1773. foreach(Player, k){
  1774. if(k != killer){
  1775. SendClientMessage(k, Color:GREY, Str);
  1776. }
  1777. }
  1778. }
  1779. #if UPDATE_TOP_ALWAYS == true
  1780.  
  1781. new
  1782. Query[256],
  1783. DBResult: R1;
  1784.  
  1785.  
  1786. format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(killer));
  1787. R1 = DB::Query(_DB, Query);
  1788.  
  1789. if(R1)
  1790. {
  1791. if(DB::Valid(R1))
  1792. {
  1793. DB::Free(R1);
  1794. format(Query, sizeof(Query), "UPDATE `Top` SET `Rank` = '%d' WHERE `Name` = '%s'", rank, Name(killer));
  1795. DB::Query(_DB, Query);
  1796. }
  1797. else
  1798. {
  1799. DB::Free(R1);
  1800. format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`, `Rank`) VALUES('%s','%d')", Name(killer), rank);
  1801. DB::Query(_DB, Query);
  1802. }
  1803. }
  1804. #endif
  1805. }
  1806. #endif
  1807.  
  1808. public OnPlayerDeath(playerid, killerid, reason)
  1809. {
  1810. if(killerid != INVALID_PLAYER_ID)
  1811. {
  1812. P_DATA[killerid][Kills]++;
  1813. SetPVarInt(killerid, "0_Kills", GetPVarInt(killerid, "0_Kills") + 1);
  1814. }
  1815. P_DATA[playerid][Deaths]++;
  1816. SetPVarInt(playerid, "0_Deaths",GetPVarInt(playerid, "0_Deaths") + 1);
  1817.  
  1818. #if UPDATE_TOP_ALWAYS == true
  1819.  
  1820. new
  1821. Query[256],
  1822. DBResult:R1;
  1823.  
  1824.  
  1825. format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(playerid));
  1826. R1 = DB::Query(_DB, Query);
  1827.  
  1828. if(R1)
  1829. {
  1830. if(DB::Valid(R1))
  1831. {
  1832. DB::Free(R1);
  1833. 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));
  1834. DB::Query(_DB, Query);
  1835. }
  1836. else
  1837. {
  1838. DB::Free(R1);
  1839. 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]));
  1840. DB::Query(_DB, Query);
  1841. }
  1842. }
  1843. if(killerid != (0xFFFF))
  1844. {
  1845. format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(killerid));
  1846. R1 = DB::Query(_DB, Query);
  1847.  
  1848. if(R1)
  1849. {
  1850. 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));
  1851. 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]));
  1852.  
  1853. DB::Free(R1);
  1854. DB::Query(_DB, Query);
  1855. }
  1856. }
  1857.  
  1858.  
  1859. #endif
  1860.  
  1861. #if USE_RANKS == true
  1862.  
  1863. if (CheckRank(killerid, 1))AnnounceRank(killerid, 1);
  1864. else if(CheckRank(killerid, 2))AnnounceRank(killerid, 2);
  1865. else if(CheckRank(killerid, 3))AnnounceRank(killerid, 3);
  1866. else if(CheckRank(killerid, 4))AnnounceRank(killerid, 4);
  1867. else if(CheckRank(killerid, 5))AnnounceRank(killerid, 5);
  1868. else if(CheckRank(killerid, 6))AnnounceRank(killerid, 6);
  1869. else if(CheckRank(killerid, 7))AnnounceRank(killerid, 7);
  1870. else if(CheckRank(killerid, 8))AnnounceRank(killerid, 8);
  1871.  
  1872. #endif
  1873. return 1;
  1874. }
  1875. CMD:gmx(PARAMS)
  1876. {
  1877. SendRconCommand("gmx");
  1878. return 1;
  1879. }
  1880.  
  1881. Detour<acmds,0cmds>
  1882. Detour<ahelp,0cmds>
  1883. Detour<admincmds,0cmds>
  1884. Detour<ac,0cmds>
  1885.  
  1886.  
  1887. CMD:arules(PARAMS)
  1888. {
  1889. LoginCheck(playerid);
  1890.  
  1891. new String[2_000];
  1892.  
  1893. switch(P_DATA[playerid][Level])
  1894. {
  1895. case 0:
  1896. {
  1897. strcat(String, ""W"["BLUE"0"W"] "BLUE"Member"W"\n\
  1898. - Don't do anything stupid.\n\
  1899. - You are just a player under rules!", 2_000);
  1900. }
  1901. case 1:
  1902. {
  1903. strcat(String, ""W"["BLUE"1"W"] "BLUE"Helper"W"\n\
  1904. - Make sure players have what they need, like time, weather.\n\
  1905. - Make sure when a player asks for help to give them the appropriate response.\n\
  1906. - You are just a helper! Don't act cocky! Act like a helper!\n\
  1907. - Dealing with players that surpass your abillities? Ask for help to the superiors!\n\n", 2_000);
  1908. }
  1909. case 2:
  1910. {
  1911. strcat(String, "["BLUE"2"W"] "BLUE"Mini Moderator"W"\n\
  1912. - You have somewhat control over the players. You can mute/freeze them.\n\
  1913. - If you notice a hacker or someone with illegal weapons, use "BLUE"/disarm"W".\n\
  1914. - When a players asks for something, do it, like change skin, heal car etc..\n\
  1915. - Use "BLUE"/bankrupt"W" to remove player's money if you they hack.\n\n", 2_000);
  1916. }
  1917. case 3:
  1918. {
  1919. strcat(String, "["BLUE"3"W"] "BLUE"Moderator"W"\n\
  1920. - You are a full moderator, your job is to take care of the server while superiors are offline\n\
  1921. - Make sure nobody spams the chat, use "BLUE"/clearchat"W" to clear the chat just in case.\n\
  1922. - You can manipulate player's account, like set his time,skin,cookies,money,score,kills etc..\n\
  1923. - Your abilities are high enough! Use with caution!\n\n", 2_000);
  1924. }
  1925. case 4:
  1926. {
  1927. strcat(String, "["BLUE"4"W"] "BLUE"Administrator"W"\n\
  1928. - No proper rules for you.\n\
  1929. - Do whatever you think it's right.\n\
  1930. - Lower level member may not judge your actions.\n\n", 2_000);
  1931. }
  1932. case 5:
  1933. {
  1934. strcat(String, "["BLUE"5"W"] "BLUE"Owner"W"\n\
  1935. - Lower level member may not judge your actions.\n\
  1936. - Do whatever you want.", 2_000);
  1937. }
  1938. }
  1939.  
  1940. Show(String);
  1941. return 1;
  1942. }
  1943.  
  1944. CMD:0cmds(PARAMS)
  1945. {
  1946. LoginCheck(playerid);
  1947.  
  1948.  
  1949. switch(P_DATA[playerid][Level])
  1950. {
  1951. case 0:
  1952. {
  1953. Show(""BLUE"Normal Member"W"\n\
  1954. /register /login /stats /pm /admins /vips /top /time changepass(/cpass)\n\
  1955. /cookies /buycookies /eatcookie /buycookiesjar /giftcookie /cookieshelp\n\n\
  1956. "BLUE"Remember to read the rules of your level!!");
  1957.  
  1958. }
  1959. case 1:
  1960. {
  1961. Show(""BLUE"Helper"W"\n\
  1962. /goto /gotopos /getip /settime /spawn /acar /jailed /frozen\n\
  1963. /muted /car /acar /accp /unblock /cargod /god\n\n\
  1964. "BLUE"Remember to read the rules at "BLUE"/arules!");
  1965. }
  1966. case 2:
  1967. {
  1968. Show(""BLUE"Mini Moderator"W"\n\
  1969. /disarm /bankrupt /tplayer /eject /heal /spec /show /setskin\n\
  1970. /[un]freeze /[un]mute /aweapons /healcar /setvhealth /carcolor\n\
  1971. /ann /ann2 /aka\n\
  1972. "BLUE"Remember to read the rules at "BLUE"/arules!");
  1973. }
  1974. case 3:
  1975. {
  1976. Show(""BLUE"Moderator"W"\n\
  1977. /giveweapon /warn /healall /heal /aweapons /givecar /write /destroyv\n\
  1978. /[un]jail /slap /clearchat /akill /explode /setalltime /setallweather\n\
  1979. /set(cookies|health|armour|score|cash|skin|time|weather|world|interior|drunk|respect|wanted)\n\n\
  1980. "BLUE"Remember to read the rules at "BLUE"/arules!");
  1981. }
  1982. case 4:
  1983. {
  1984. new Str[600];
  1985. strcat(Str, \
  1986. ""BLUE"Administrator"W"\n\
  1987. /setall(health|armour|score|cash|skin|world|interior|drunk|cookies|respect|wanted)\n\
  1988. /giveall(h(ealth)|armour|score|cash|cookies|wanted|weapon)\n\
  1989. /kick /wcheck /setdeaths /setkills /2012 /resetallrespect /killall\n", 600);
  1990.  
  1991. strcat(Str, \
  1992. "/[un]muteall /[un]freezeall /spawnall /2012all /chat /slapall\n\
  1993. /disarmall /explodeall\n\n\
  1994. "BLUE"Remember to read the rules at "BLUE"/arules!", 600);
  1995.  
  1996. Show(Str);
  1997. }
  1998. case 5:
  1999. {
  2000. Show(""BLUE"Owner"W"\n\
  2001. /setlevel /settemplevel /ban /unban /acp /respawncars /removeacc\n\
  2002. /setonline /setstat /fake /fakechat /fakecmd /fakecon /fakedisc /fakedeath\n\
  2003. /kickall /banall\n\n\
  2004. "BLUE"Remember to read the rules at "BLUE"/arules!");
  2005.  
  2006. }
  2007. }
  2008. return 1;
  2009. }
  2010. CMD:announce2(PARAMS)
  2011. {
  2012. SendClientMessage(playerid, Color:GREY, "Use "BLUE"/ann2"GREY" instead!");
  2013. return 1;
  2014. }
  2015. CMD:announce(PARAMS)
  2016. {
  2017. SendClientMessage(playerid, Color:GREY, "Use "BLUE"/ann"GREY" instead!");
  2018. return 1;
  2019. }
  2020. CMD:changepass(PARAMS)
  2021. {
  2022. SendClientMessage(playerid, Color:GREY, "Use "BLUE"/cpass"GREY" instead!");
  2023. return 1;
  2024. }
  2025. CMD:cpass(PARAMS)
  2026. {
  2027. LoginCheck(playerid);
  2028.  
  2029. new OldPass[MAX_PASS_LEN], NewPass[MAX_PASS_LEN];
  2030. if(sscanf(params, "s[20]s[20]", OldPass, NewPass)) return SendUsage(playerid, "/cpass "GREY"<old pass> <new pass>", "Will change your password.");
  2031. else
  2032. {
  2033. if(strlen(NewPass) < MIN_PASS_LEN || strlen(NewPass) > MAX_PASS_LEN)
  2034. return SendError(playerid, "The new password has an invalid length!");
  2035.  
  2036. new Query[300], DBResult:Result, Buf[129];
  2037. WP_Hash(Buf, 129, OldPass);
  2038. format(Query, 300, "SELECT `Key` FROM `Accounts` WHERE `Name` = '%s' AND `Password` = '%s'", Name(playerid), Buf);
  2039. Result = DB::Query(_DB, Query);
  2040.  
  2041. if(Result)
  2042. {
  2043. if(DB::Valid(Result))
  2044. {
  2045. DB::Free(Result);
  2046. WP_Hash(Buf, 129, NewPass);
  2047. format(Query, 300, "UPDATE `Accounts` SET `Password` = '%s', `RPassword` = '%s' WHERE `Name` = '%s'", Buf, OldPass, Name(playerid));
  2048. DB::Query(_DB, Query);
  2049.  
  2050. FormatMSG(playerid, Color:GREY, "Password changed! New password is: "BLUE"%s", NewPass);
  2051. SendAdminCMD(playerid, "PLayer "ORAN"%s[%i]"GREY" changed his password!", Name(playerid), playerid);
  2052. }
  2053. else
  2054. {
  2055. DB::Free(Result);
  2056. return SendError(playerid, "Old Password doesn't match the current password!");
  2057. }
  2058. }
  2059. }
  2060. return 1;
  2061. }
  2062.  
  2063.  
  2064. CMD:ann2(PARAMS)
  2065. {
  2066. LoginCheck(playerid);
  2067. LevelCheck(playerid, 2);
  2068.  
  2069. new Announce[129], Time, Style;
  2070. 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)");
  2071. else
  2072. {
  2073. if(Style > 6 || Style < 0) return SendError(playerid, "Style: 0-6");
  2074. GameTextForAll(Announce, Time, Style );
  2075. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" used command "ORAN"/ann2", Name(playerid), playerid);
  2076. SendClientMessage(playerid, Color:GREY, "Announce sent!");
  2077. }
  2078. return 1;
  2079. }
  2080. CMD:ann(PARAMS)
  2081. {
  2082. LoginCheck(playerid);
  2083. LevelCheck(playerid, 2);
  2084.  
  2085. new Announce[129];
  2086. if(sscanf(params, "s[129]", Announce)) return SendUsage(playerid, "/ann "GREY"<text>", "Will show a text in the middle of the screen!");
  2087. else
  2088. {
  2089. GameTextForAll(Announce, 7000, 3 );
  2090. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" used command "ORAN"/ann", Name(playerid), playerid);
  2091. SendClientMessage(playerid, Color:GREY, "Announce sent!");
  2092. }
  2093. return 1;
  2094. }
  2095. CMD:aka(PARAMS)
  2096. {
  2097. LoginCheck(playerid);
  2098. LevelCheck(playerid, 2);
  2099.  
  2100. new Player;
  2101. if(sscanf(params, "u", Player)) return SendUsage(playerid, "/aka "GREY"<id>", "Will show the aka list of a player");
  2102. else
  2103. {
  2104. if(Player == 0xFFFF)
  2105. return SendError(playerid, "Player not connected!");
  2106.  
  2107. INI_ParseFile(AKA_FILE, "LoadAKA", .bExtra = true, .extra = Player);
  2108.  
  2109. if(strlen(GPVSEx(Player, "pAKA")) > 3)
  2110. {
  2111. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" is viewing the aka list of "ORAN"%s[%i]", Name(playerid), playerid, Name(Player), Player);
  2112. FormatMSG(playerid, Color:GREY, "Player "ORAN"%s"GREY" has used the following names: "ORAN"%s"GREY".", Name(Player), GPVSEx(Player, "pAKA"));
  2113. }
  2114. else
  2115. {
  2116. SendError(playerid, "An error has occured");
  2117. }
  2118. }
  2119. return 1;
  2120. }
  2121. CMD:unblock(PARAMS)
  2122. {
  2123. LoginCheck(playerid);
  2124. LevelCheck(playerid, 1);
  2125.  
  2126. new Player;
  2127. if(sscanf(params, "u", Player)) return SendUsage(playerid, "/unblock "GREY"<id>", "Will unstuck a player");
  2128. else
  2129. {
  2130. TogglePlayerControllable(Player, true);
  2131.  
  2132. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" unblocked player "ORAN"%s[%i]", Name(playerid), playerid, Name(Player), Player);
  2133. FormatMSG(playerid, Color:GREY, "You unstucked player "ORAN"%s[%i]", Name(Player), Player);
  2134. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" unblocked you", Name(playerid), playerid);
  2135. }
  2136. return 1;
  2137. }
  2138. CMD:time(PARAMS)
  2139. {
  2140. LoginCheck(playerid);
  2141.  
  2142. new T[2], Str[10];
  2143. gettime(T[0], T[1]);
  2144. format(Str, 10, "~r~%d~w~:~r~%d", T[0], T[1]);
  2145. GameTextForPlayer(playerid, Str, 3000, 1);
  2146.  
  2147. return 1;
  2148. }
  2149. CMD:cargod(PARAMS)
  2150. {
  2151. LoginCheck(playerid);
  2152. LevelCheck(playerid, 1);
  2153.  
  2154. switch(P_DATA[playerid][CarGod])
  2155. {
  2156. case false:
  2157. {
  2158. P_DATA[playerid][CarGod] = 1;
  2159. SetPVarInt(playerid, "0_CarGod", 1);
  2160. SendClientMessage(playerid, Color:GREY, "Vehicle God has been activated!");
  2161. }
  2162. case true:
  2163. {
  2164. P_DATA[playerid][CarGod] = 0;
  2165. SetPVarInt(playerid, "0_CarGod", 0);
  2166. SendClientMessage(playerid, Color:GREY, "Vehicle God has been deactivated!");
  2167.  
  2168. }
  2169. }
  2170. return 1;
  2171. }
  2172. CMD:god(PARAMS)
  2173. {
  2174. LoginCheck(playerid);
  2175. LevelCheck(playerid, 1);
  2176.  
  2177. switch(P_DATA[playerid][God])
  2178. {
  2179. case false:
  2180. {
  2181. P_DATA[playerid][God] = 1;
  2182. SetPVarInt(playerid, "0_God", 1);
  2183. SendClientMessage(playerid, Color:GREY, "Godlike has been activated!");
  2184. }
  2185. case true:
  2186. {
  2187. P_DATA[playerid][God] = 0;
  2188. SetPVarInt(playerid, "0_God", 0);
  2189. SendClientMessage(playerid, Color:GREY, "Godlike has been deactivated!");
  2190.  
  2191. }
  2192. }
  2193. return 1;
  2194. }
  2195.  
  2196.  
  2197. CMD:pcp(PARAMS)
  2198. {
  2199. LoginCheck(playerid);
  2200.  
  2201. SPD(playerid, Dialog:PCP, LIST, "Player control panel", PcPanel(playerid), "ON/Select", "OFF/Exit");
  2202. return 1;
  2203. }
  2204.  
  2205. CMD:record(playerid)
  2206. {
  2207. LoginCheck(playerid);
  2208.  
  2209. new
  2210. Str[1024];
  2211. format(Str, sizeof (Str), ""W"Record details:\n\n\
  2212. "GREE"NEW RECORD:\n\
  2213. "GREY"Broken by: "BLUE"%s\n\
  2214. "GREY"Date: "BLUE"%d/%d/%d\n\
  2215. "GREY"Time: "BLUE"%d:%d:%d\n\
  2216. "GREY"Record: "BLUE"%d "GREY"players",
  2217. S_DATA[RecordBy],
  2218. S_DATA[sD], S_DATA[sM], S_DATA[sY],
  2219. S_DATA[sH], S_DATA[sMi], S_DATA[sS],
  2220. S_DATA[sRecord]);
  2221.  
  2222. new
  2223. Field[4][64],
  2224. DBResult: R1;
  2225.  
  2226. R1 = DB::Query(_DB, "SELECT `ByOLD`, `DateOLD`, `TimeOLD` FROM `Record`;");
  2227. if(DB::Valid(R1))
  2228. {
  2229. DB::GetField(R1, "ByOLD", Field[0], 64);
  2230. DB::GetField(R1, "DateOLD", Field[1], 64);
  2231. DB::GetField(R1, "TimeOLD", Field[2], 64);
  2232. DB::Free(R1);
  2233. }
  2234. else
  2235. {
  2236. DB::Free(R1);
  2237. Field[0] = "Nobody"; Field[1] = "Never"; Field[2] = "Never";
  2238. }
  2239. format(Str, sizeof (Str), "%s\n\n{FF0000}OLD RECORD:\n\
  2240. "GREY"Broken by: "ORAN"%s\n\
  2241. "GREY"Date: "ORAN"%s\n\
  2242. "GREY"Time: "ORAN"%s\n\
  2243. "GREY"Record: "ORAN"%d "GREY"players",
  2244. Str,
  2245. Field[0], Field[1], Field[2], S_DATA[sRecord] - 1);
  2246. SPD(playerid, Dialog:Empty, BOX, ""W"Players record!", Str, "Close", "");
  2247. return 1;
  2248. }
  2249.  
  2250. public OnPlayerConnect(playerid)
  2251. {
  2252. if(IsPlayerNPC(playerid)) return 1;
  2253.  
  2254. new DBResult:bResult, bQuery[129];
  2255. format(bQuery, 129, "SELECT `IP`, `Reason`, `Admin`, `BanDate` FROM `Banlist` WHERE `Name` = '%s';", Name(playerid));
  2256. bResult = DB::Query(_DB, bQuery);
  2257.  
  2258. new bField[4][129], Field[50];
  2259. if(bResult)
  2260. {
  2261. if(DB::Valid(bResult))
  2262. {
  2263. DB::GetField(bResult, "Reason", bField[0], 129);
  2264. DB::GetField(bResult, "Admin", bField[1], 129);
  2265. DB::GetField(bResult, "BanDate", bField[2], 129);
  2266.  
  2267. DB::Free(bResult);
  2268. for (new i = 0; i < 10; i++)SendClientMessage(playerid, -1, " ");
  2269.  
  2270. SendClientMessage(playerid, Color:ORAN, "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *");
  2271. SendClientMessage(playerid, Color:ORAN, "BANNED:"W" Sorry to inform you, but this account is "ORAN"banned"W" from this server!");
  2272. FormatMSG(playerid, ~1, "You were banned by Administrator "ORAN"%s"W" on "ORAN"%s"W" with the following reason:", bField[1], bField[2]);
  2273. SendClientMessage(playerid, Color:ORAN, bField[0]);
  2274.  
  2275. KickEx(playerid, "System", "Banned Account", true);
  2276.  
  2277. return 0;
  2278. }
  2279. else
  2280. {
  2281. DB::Free(bResult);
  2282.  
  2283. new DBResult:bResult2;
  2284. format(bQuery, 129, "SELECT `IP`, `Name`, `Reason`, `Admin`, `BanDate` FROM `Banlist` WHERE `IP` = '%s';", GetPlayerIPEx(playerid));
  2285. bResult2 = DB::Query(_DB, bQuery);
  2286.  
  2287. if(bResult2)
  2288. {
  2289. if(DB::Valid(bResult2))
  2290. {
  2291. loop(i, 4){ bField[_i][0] = '\0'; }
  2292. DB::GetField(bResult2, "IP", bField[3], 129);
  2293. if(!strcmp(GetPlayerIPEx(playerid), bField[3]))
  2294. {
  2295. DB::GetField(bResult2, "Reason", bField[0], 129);
  2296. DB::GetField(bResult2, "Admin", bField[1], 129);
  2297. DB::GetField(bResult2, "BanDate", bField[2], 129);
  2298.  
  2299. DB::Free(bResult2);
  2300. loop(o, 10){ SendClientMessage(playerid, -1, " "); }
  2301.  
  2302. SendClientMessage(playerid, Color:ORAN, "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *");
  2303. SendClientMessage(playerid, Color:ORAN, "BANNED:"W" Sorry to inform you, but this account is "ORAN"banned"W" from this server!");
  2304. FormatMSG(playerid, -1, "You were banned by Administrator "ORAN"%s"W" on "ORAN"%s"W" with the following reason:", bField[1], bField[2]);
  2305. SendClientMessage(playerid, Color:ORAN, bField[0]);
  2306.  
  2307. KickEx(playerid, "System", "Banned Account", true);
  2308. return 0;
  2309. }
  2310. }else DB::Free(bResult2);
  2311. }
  2312. }
  2313. }
  2314.  
  2315. S_DATA[sPlayers] ++;
  2316.  
  2317. if(S_DATA[sRecord] < S_DATA[sPlayers])
  2318. {
  2319. new
  2320. Date[6],
  2321. Query[256];
  2322.  
  2323. getdate(Date[2], Date[1], Date[0]);
  2324. gettime(Date[3], Date[4], Date[5]);
  2325.  
  2326. if(!strlen(S_DATA[RecordBy])) format(S_DATA[RecordBy], MAX_PLAYER_NAME, "Nobody");
  2327. 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'",\
  2328. 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]);
  2329.  
  2330. DB::Query(_DB, Query);
  2331.  
  2332. getdate(S_DATA[sY], S_DATA[sM], S_DATA[sD]);
  2333. gettime(S_DATA[sH], S_DATA[sMi], S_DATA[sS]);
  2334.  
  2335.  
  2336. SendClientMessage(playerid, -1, " ");
  2337. SendClientMessage(playerid, -1, " ");
  2338. SendClientMessage(playerid, -1, " ");
  2339. SendClientMessage(playerid, Color:BLUE, "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ");
  2340. 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]);
  2341. SendClientMessage(playerid, Color:GREY, "Use "BLUE"/record"GREY" to check more details!");
  2342. SendClientMessage(playerid, Color:BLUE, "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ");
  2343. SendClientMessage(playerid, -1, " ");
  2344. SendClientMessage(playerid, -1, " ");
  2345. foreach(Player, i)
  2346. {
  2347. if(i != playerid)
  2348. {
  2349. 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]);
  2350. SendClientMessage(i, Color:GREY, "Use "BLUE"/record"GREY" to check more details!");
  2351. }
  2352. }
  2353. format(S_DATA[RecordBy], MAX_PLAYER_NAME, "%s", Name(playerid));
  2354. S_DATA[sRecord] = S_DATA[sPlayers];
  2355. }
  2356.  
  2357. format(PlayerIP[playerid], 50, "%s", GetPlayerIPEx(playerid));
  2358.  
  2359. SetPVarInt(playerid, "FirstConnection", 1);
  2360. new String[256];
  2361.  
  2362. if(!S_DATA[AKA])
  2363. {
  2364. format(String, sizeof (String), "%s["W"%i"ORAN"]"W" Has joined the server!", Name(playerid), playerid);
  2365. SendClientMessageToAll(Color:ORAN, String);
  2366. }
  2367. else
  2368. {
  2369. INI_ParseFile(AKA_FILE, "LoadAKA", .bExtra = true, .extra = playerid);
  2370.  
  2371.  
  2372. if(strlen(GPVSEx(playerid, "pAKA")) < 3)
  2373. {
  2374. format(String, sizeof (String), "%s["W"%i"ORAN"]"W" Has joined the server!", Name(playerid), playerid);
  2375. }
  2376. else if(!strcmp(GPVSEx(playerid, "pAKA"), Name(playerid), true))
  2377. {
  2378. format(String, sizeof (String), "%s["W"%i"ORAN"]"W" Has joined the server!", Name(playerid), playerid);
  2379. }
  2380. 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"));
  2381.  
  2382. foreach(Player, i)
  2383. {
  2384. if(P_DATA[i][Level] > 2)
  2385. {
  2386. if(i != playerid)SendClientMessage(i, Color:ORAN, String);
  2387. }
  2388. else
  2389. {
  2390. format(String, sizeof (String),"%s["W"%i"ORAN"]"W" Has joined the server!", Name(playerid), playerid);
  2391. SendClientMessage(i, Color:ORAN, String);
  2392. }
  2393. }
  2394.  
  2395. new pIP[30];
  2396. GetPlayerIp(playerid, pIP, 30);
  2397.  
  2398.  
  2399. //INI_ParseFile(AKA_FILE, "LoadAKA", .bExtra = true, .extra = playerid);
  2400. if(!strlen(GPVSEx(playerid, "pAKA")))
  2401. {
  2402. new INI: pAka = INI_Open(AKA_FILE);
  2403. INI_WriteString(pAka, pIP, Name(playerid));
  2404. INI_Close(pAka);
  2405. }
  2406. else
  2407. {
  2408. if(strfind(GPVSEx(playerid, "pAKA"), Name(playerid), true) == -1)
  2409. {
  2410. new Str[256];
  2411. format (Str, 256, "%s,%s", GPVSEx(playerid, "pAKA"), Name(playerid));
  2412. new INI: pAka = INI_Open(AKA_FILE);
  2413. INI_WriteString(pAka, pIP, Str);
  2414. INI_Close(pAka);
  2415. }
  2416. }
  2417. }
  2418. P_DATA[playerid][ConnTime] = gettime();
  2419. P_DATA[playerid][LogFail] = MAX_PASS_FAIL;
  2420. P_DATA[playerid][Spec_ID] = 0xFFFF;
  2421. P_DATA[playerid][Spec_Type] = ADMIN_SPEC_TYPE_NONE;
  2422.  
  2423. ClearVars(playerid);
  2424.  
  2425.  
  2426. #if SAVE_FREEZE == true
  2427.  
  2428. new Query[256];
  2429.  
  2430. format(Query, sizeof (Query), "SELECT `Key`, `Frozen`, `RealName` FROM `Frozen` WHERE `IP` = '%s';", GetPlayerIPEx(playerid));
  2431. new DBResult:Result1 = DB::Query(_DB, Query);
  2432.  
  2433. if(Result1)
  2434. {
  2435. if(DB::Valid(Result1))
  2436. {
  2437. new xField[64];
  2438.  
  2439. DB::GetField(Result1, "RealName", xField, 64);
  2440. SetPVarString(playerid, "FreezeName", xField);
  2441.  
  2442. DB::GetField(Result1, "Frozen", xField, 64);
  2443. P_DATA[playerid][Frozen] = strval(xField);
  2444.  
  2445. DB::Free(Result1);
  2446. }
  2447. else
  2448. {
  2449. DB::Free(Result1);
  2450. format(Query, 256, "SELECT `IP`, `Frozen`, `RealName` FROM `Frozen` WHERE `RealName` = '%s';", Name(playerid));
  2451. new DBResult:Result2 = DB::Query(_DB, Query);
  2452.  
  2453. if(Result2)
  2454. {
  2455. if(DB::Valid(Result2))
  2456. {
  2457. DB::GetField(Result2, "IP", Field, sizeof (Field));
  2458. SetPVarString(playerid, "FalseIP", Field);
  2459.  
  2460. if(strcmp(GetPlayerIPEx(playerid), Field))
  2461. {
  2462. DB::GetField(Result2, "Frozen", Field, sizeof (Field));
  2463. P_DATA[playerid][Frozen] = strval(Field);
  2464.  
  2465. DB::GetField(Result2, "RealName", Field, sizeof (Field));
  2466. SetPVarString(playerid, "FreezeName", Field);
  2467.  
  2468. DB::GetField(Result2, "IP", Field, sizeof (Field));
  2469. SetPVarString(playerid, "FalseIP", Field);
  2470. }
  2471. DB::Free(Result2);
  2472. }
  2473. else
  2474. {
  2475. DB::Free(Result2);
  2476. SetPVarString(playerid, "FreezeName", "5;6:2:6:*:$:^");
  2477. }
  2478. }
  2479. }
  2480.  
  2481. }
  2482.  
  2483. if(P_DATA[playerid][Frozen])
  2484. {
  2485. if(strcmp(GPVSEx(playerid, "FreezeName"), Name(playerid), false))
  2486. {
  2487. SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
  2488. 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"));
  2489. SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
  2490.  
  2491. P_DATA[playerid][Warns] += 2;
  2492.  
  2493. SetPlayerName(playerid, GPVSEx(playerid, "FreezeName"));
  2494. }
  2495. else if(strcmp(GPVSEx(playerid, "FalseIP"), GetPlayerIPEx(playerid)))
  2496. {
  2497. SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
  2498. 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"));
  2499. SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
  2500.  
  2501. P_DATA[playerid][Warns] += 2;
  2502.  
  2503. SetPlayerName(playerid, GPVSEx(playerid, "FreezeName"));
  2504. }
  2505.  
  2506. format(Query, 256, "UPDATE `Frozen` SET `IP` = '%s', `Frozen` = '1', `RealName` = '%s' WHERE `RealName` = '%s'", GetPlayerIPEx(playerid), Name(playerid), GPVSEx(playerid, "FreezeName"));
  2507. DB::Query(_DB, Query);
  2508.  
  2509. if(P_DATA[playerid][Warns] >= MAX_P_WARNS)
  2510. {
  2511. SendClientMessage(playerid, Color:GREY, "You have been kicked from the server for exceeding warnings!");
  2512. KickEx(playerid, "System", "Exceeding Warnings");
  2513. return 0;
  2514. }
  2515. }
  2516. #endif
  2517.  
  2518. #if SAVE_MUTE == true
  2519.  
  2520. new Query2[256],
  2521. DBResult:Result3;
  2522.  
  2523. format(Query2, sizeof (Query2), "SELECT `Muted`, `Time`, `RealName` FROM `Muted` WHERE `IP` = '%s';", GetPlayerIPEx(playerid));
  2524. Result3 = DB::Query(_DB, Query2);
  2525.  
  2526. if(Result3)
  2527. {
  2528. if(DB::Valid(Result3))
  2529. {
  2530. DB::GetField(Result3, "Muted", Field, sizeof (Field));
  2531. P_DATA[playerid][Muted] = strval(Field);
  2532.  
  2533. DB::GetField(Result3, "Time", Field, sizeof (Field));
  2534. P_DATA[playerid][MutedTime] = strval(Field);
  2535.  
  2536. DB::GetField(Result3, "RealName", Field, sizeof (Field));
  2537. SetPVarString(playerid, "MuteName", Field);
  2538.  
  2539. DB::Free(Result3);
  2540. GameTextForPlayer(playerid, "~r~You have been cought freeze evading the system!~n~You have been punished!", 7600, 3);
  2541. }
  2542. else
  2543. {
  2544. DB::Free(Result3);
  2545. format(Query2, sizeof(Query2), "SELECT `IP`, `Muted`, `RealName`, `Time` FROM `Muted` WHERE `RealName` = '%s';", Name(playerid));
  2546. new DBResult:Result4 = DB::Query(_DB, Query2);
  2547.  
  2548. if(Result4)
  2549. {
  2550. if(DB::Valid(Result4))
  2551. {
  2552. DB::GetField(Result4, "IP", Field, sizeof (Field));
  2553. if(strcmp(GetPlayerIPEx(playerid), Field))
  2554. {
  2555. DB::GetField(Result4, "Muted", Field, sizeof (Field));
  2556. P_DATA[playerid][Muted] = strval(Field);
  2557.  
  2558. DB::GetField(Result4, "Time", Field, sizeof (Field));
  2559. P_DATA[playerid][MutedTime] = strval(Field);
  2560.  
  2561. DB::GetField(Result4, "RealName", Field, sizeof (Field));
  2562. SetPVarString(playerid, "MuteName", Field);
  2563.  
  2564. DB::GetField(Result4, "IP", Field, sizeof (Field));
  2565. SetPVarString(playerid, "FalseIP", Field);
  2566.  
  2567. GameTextForPlayer(playerid, "~r~You have been cought mute evading the system!~n~You have been punished!", 7600, 3);
  2568. }
  2569. DB::Free(Result4);
  2570. }
  2571. else
  2572. {
  2573. DB::Free(Result4);
  2574. SetPVarString(playerid, "MuteName", "5;6:2:6:*:$:^");
  2575. SetPVarString(playerid, "FalseIP", "5;6:2:6:*:$:^");
  2576. }
  2577. }
  2578. }
  2579. }
  2580.  
  2581. if(P_DATA[playerid][MutedTime] > 0)
  2582. {
  2583. if(strcmp(GPVSEx(playerid, "MuteName"), Name(playerid), false))
  2584. {
  2585. SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
  2586. 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"));
  2587. SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
  2588.  
  2589. SetPlayerName(playerid, GPVSEx(playerid, "MuteName"));
  2590.  
  2591. P_DATA[playerid][MutedTime] += (EXTRA_MINUTES);
  2592. }
  2593. else if(strcmp(GPVSEx(playerid, "FalseIP"), GetPlayerIPEx(playerid)))
  2594. {
  2595. SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
  2596. 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"));
  2597. SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
  2598.  
  2599. SetPlayerName(playerid, GPVSEx(playerid, "MuteName"));
  2600.  
  2601. P_DATA[playerid][MutedTime] += (EXTRA_MINUTES);
  2602. }
  2603. P_DATA[playerid][Muted] = 1;
  2604.  
  2605. FormatMSG(playerid, Color:ORAN, "SERVER:"W" You are still muted! "ORAN"["GREY"Aprox. "W"%d minutes"ORAN"]", P_DATA[playerid][MutedTime]);
  2606. MuteTimer[playerid] = SetTimerEx("UnMutePlayer", 60_000, true, "i", playerid);
  2607.  
  2608. new pQ[129];
  2609. format(pQ, sizeof (pQ), "UPDATE `Muted` SET `IP` = '%s', `RealName` = '%s' WHERE `RealName` = '%s'", GetPlayerIPEx(playerid), Name(playerid), GPVSEx(playerid, "MuteName"));
  2610. DB::Query(_DB, pQ);
  2611.  
  2612. }
  2613. else if(P_DATA[playerid][Muted] && !P_DATA[playerid][MutedTime])
  2614. {
  2615. if(strcmp(GPVSEx(playerid, "MuteName"), Name(playerid), false))
  2616. {
  2617. SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
  2618. 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"));
  2619. SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
  2620.  
  2621. SetPlayerName(playerid, GPVSEx(playerid, "MuteName"));
  2622.  
  2623. P_DATA[playerid][Warns] += 2;
  2624.  
  2625. new pQ[129];
  2626. format(pQ, sizeof (pQ), "UPDATE `Muted` SET `IP` = '%s', `RealName` = '%s' WHERE `RealName` = '%s'", GetPlayerIPEx(playerid), Name(playerid), GPVSEx(playerid, "MuteName"));
  2627. DB::Query(_DB, pQ);
  2628. }
  2629. else if(strcmp(GPVSEx(playerid, "FalseIP"), GetPlayerIPEx(playerid)))
  2630. {
  2631. SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
  2632. 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"));
  2633. SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
  2634.  
  2635. SetPlayerName(playerid, GPVSEx(playerid, "MuteName"));
  2636.  
  2637. P_DATA[playerid][Warns] += 2;
  2638.  
  2639. format(Query2, sizeof (Query2), "UPDATE `Muted` SET `IP` = '%s', `RealName` = '%s' WHERE `RealName` = '%s'", GetPlayerIPEx(playerid), Name(playerid), GPVSEx(playerid, "MuteName"));
  2640. DB::Query(_DB, Query2);
  2641. }
  2642. SendClientMessage(playerid, Color:ORAN, "SERVER:"W" You are still muted! "ORAN"["GREY"Mute time: "W"Forever"ORAN"]");
  2643. }
  2644. if(P_DATA[playerid][Warns] == MAX_P_WARNS)
  2645. {
  2646. SendClientMessage(playerid, Color:GREY, "You have been kicked from the server for exceeding warnings!");
  2647. KickEx(playerid, "System", "Exceeding Warnings");
  2648. return 0;
  2649. }
  2650.  
  2651. #endif
  2652.  
  2653.  
  2654. new pQuery[512], DBResult:pResult;
  2655. format(pQuery, 512, "SELECT `Autologin` FROM `Accounts` WHERE `Name` = '%s';", Name(playerid));
  2656. pResult = DB::Query(_DB, pQuery);
  2657. new pField[60];
  2658.  
  2659. if(pResult)
  2660. {
  2661. if(DB::Valid(pResult))
  2662. {
  2663.  
  2664. DB::GetField(pResult, "Autologin", pField, sizeof(pField));
  2665. P_DATA[playerid][pAuto] = strval(pField);
  2666.  
  2667. DB::Free(pResult);
  2668. if(P_DATA[playerid][pAuto])
  2669. {
  2670. new DBResult:pResult2;
  2671. format(pQuery, 512, "SELECT `IP`, `RPassword` FROM `Accounts` WHERE `Name` = '%s';", Name(playerid));
  2672. pResult2 = DB::Query(_DB, pQuery);
  2673.  
  2674. if(pResult2)
  2675. {
  2676. if(DB::Valid(pResult2))
  2677. {
  2678. DB::GetField(pResult2, "IP", pField, sizeof(pField));
  2679. if(!strcmp(pField, GetPlayerIPEx(playerid), false))
  2680. {
  2681. DB::GetField(pResult2, "RPassword", pField, sizeof(pField));
  2682. LoginPlayer(playerid, pField, .pAutoLogin = true);
  2683. }
  2684. else SendLogin(playerid);
  2685. }
  2686. else SendLogin(playerid);
  2687. }
  2688. } else SendLogin(playerid);
  2689. }
  2690. else
  2691. {
  2692. new zStr[256];
  2693. 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());
  2694. ShowPlayerDialog(playerid, Dialog:Register, DIALOG_STYLE_INPUT, ""W"Register an account", zStr, "Register", "Kick");
  2695. }
  2696. }
  2697. return 1;
  2698. }
  2699. SendLogin(playerid)
  2700. {
  2701. new zStr[150];
  2702. format(zStr, sizeof (zStr), ""W"Welcome back "GREE"%s"W"\n\nPlease login into your account:", Name(playerid));
  2703.  
  2704. #if SECURITY_QUESTION == true
  2705.  
  2706. SPD(playerid, Dialog:Login2, INPUT, ""W"Welcome back", zStr, "Login", "Forg. Pass");
  2707.  
  2708. #else
  2709.  
  2710. SPD(playerid, Dialog:Login2, INPUT, ""W"Welcome back", zStr, "Login", "Kick");
  2711.  
  2712. #endif
  2713.  
  2714. }
  2715. public OnPlayerDisconnect(playerid, reason)
  2716. {
  2717. S_DATA[sPlayers] --;
  2718.  
  2719. DeletePlayer3DTextLabel(playerid, ZaAdminCar[playerid]);
  2720.  
  2721. if(P_DATA[playerid][tLevel])
  2722. {
  2723. P_DATA[playerid][Level] = 0;
  2724. }
  2725.  
  2726. DestroyVehicle(P_DATA[playerid][aCar]);
  2727.  
  2728. new zStr[256];
  2729. switch(reason)
  2730. {
  2731. case 0: format(zStr, sizeof (zStr), "%s["W"%i"ORAN"]"W" Has left the server! "ORAN"[CRASH]", Name(playerid), playerid);
  2732. case 1: format(zStr, sizeof (zStr), "%s["W"%i"ORAN"]"W" Has left the server! "ORAN"[LEAVING]", Name(playerid), playerid);
  2733. case 2: format(zStr, sizeof (zStr), "%s["W"%i"ORAN"]"W" Has left the server! "ORAN"[KICK"W"/"ORAN"BAN]", Name(playerid), playerid);
  2734.  
  2735. }
  2736. SendClientMessageToAll(Color:ORAN, zStr);
  2737.  
  2738. if(P_DATA[playerid][Logged]) { SavePlayerData(playerid); }
  2739.  
  2740. new Query[129];
  2741.  
  2742. #if !SAVE_JAIL && !SAVE_MUTE
  2743. #pragma unused Query
  2744. #endif
  2745.  
  2746. #if SAVE_JAIL == true
  2747.  
  2748. if(P_DATA[playerid][JailTime] > 0 )
  2749. {
  2750. 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]);
  2751. DB::Query(_DB, Query);
  2752. }
  2753. else if(!P_DATA[playerid][JailTime] && P_DATA[playerid][Jailed])
  2754. {
  2755. format(Query, 129, "SELECT `Key` FROM `Jailed` WHERE `IP` = '%s';", PlayerIP[playerid]);
  2756. new DBResult:Result = DB::Query(_DB, Query);
  2757.  
  2758. if(Result)
  2759. {
  2760. if(!DB::Valid(Result))
  2761. {
  2762. DB::Free(Result);
  2763. format(Query, 129, "DELETE FROM `Jailed` WHERE `IP` = '%s'", PlayerIP[playerid]);
  2764. DB::Query(_DB, Query);
  2765. }
  2766. }
  2767. }
  2768.  
  2769. #endif
  2770.  
  2771. #if SAVE_MUTE == true
  2772.  
  2773.  
  2774. if(P_DATA[playerid][MutedTime] > 0)
  2775. {
  2776. 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]);
  2777. DB::Query(_DB, Query);
  2778. }
  2779. else if(!P_DATA[playerid][MutedTime] && P_DATA[playerid][Muted])
  2780. {
  2781. format(Query, 129, "SELECT `Key` FROM `Muted` WHERE `IP` = '%s'", PlayerIP[playerid]);
  2782. new DBResult:Result = DB::Query(_DB, Query);
  2783.  
  2784. if(Result)
  2785. {
  2786. if(!DB::Valid(Result))
  2787. {
  2788. DB::Free(Result);
  2789. format(Query, 129, "DELETE FROM `Muted` WHERE `IP` = '%s'", PlayerIP[playerid]);
  2790. DB::Query(_DB, Query);
  2791. }
  2792. }
  2793. }
  2794.  
  2795. #endif
  2796. for(new i = 0; i < 5; i++)
  2797. {
  2798. if(IsPlayerAttachedObjectSlotUsed(playerid, i))
  2799. {
  2800. RemovePlayerAttachedObject(playerid, i);
  2801. }
  2802. }
  2803.  
  2804.  
  2805. KillTimer(MuteTimer[playerid] );
  2806. KillTimer(JailTimer[playerid] );
  2807. KillTimer(P_DATA[playerid][NosTimer] );
  2808. P_DATA[playerid][LogFail] = 0;
  2809. ClearVars(playerid);
  2810.  
  2811. return 1;
  2812. }
  2813.  
  2814. public OnPlayerCommandPerformed(playerid, cmdtext[], success)
  2815. {
  2816.  
  2817. if(success)
  2818. {
  2819. P_DATA[playerid][Cmds]++;
  2820. SetPVarInt(playerid, "0_Commands", P_DATA[playerid][Cmds]);
  2821.  
  2822. if(S_DATA[ReadCMD])
  2823. {
  2824. SendAdminCMD(playerid, ""GREY"[CMD] %s[%i] "W"used command{FF0000} %s", Name(playerid), playerid, cmdtext);
  2825. printf(#[%s] %s - %s, zDate(), Name(playerid), cmdtext);
  2826. }
  2827. }
  2828. else
  2829. {
  2830. P_DATA[playerid][fCmds]++;
  2831. SetPVarInt(playerid, "0_Fail_Commands", P_DATA[playerid][fCmds]) ;
  2832. return 0;
  2833. }
  2834. return 1;
  2835. }
  2836. public OnPlayerCommandReceived(playerid, cmdtext[])
  2837. {
  2838. P_DATA[playerid][cSpam]++;
  2839. if(S_DATA[AntiCSpam] && (!IsPlayerAdmin(playerid) || P_DATA[playerid][Level] != 5))
  2840. {
  2841. if(P_DATA[playerid][cSpam] > MAX_CMD_SPAM && !IsPlayerAdmin(playerid))
  2842. {
  2843. BanEx2(playerid, .zReason = "Extreme command spam");
  2844. return 0;
  2845. }
  2846. else if(P_DATA[playerid][cSpam] > MIN_CMD_SPAM)
  2847. {
  2848. KickEx(playerid, .zReason = "Command spam");
  2849. return 0;
  2850. }
  2851. }
  2852. if(P_DATA[playerid][Jailed] && !P_DATA[playerid][JailTime] && P_DATA[playerid][Level] != 5 && !IsPlayerAdmin(playerid))
  2853. {
  2854. SendClientMessage(playerid, Color:ORAN, "SERVER:"W" You are not allowed to use any commands while jailed! "GREY"[Jail Time: "ORAN"Forever"GREY"]");
  2855. return 0;
  2856. }
  2857. else if(P_DATA[playerid][Jailed] && P_DATA[playerid][JailTime] > 0 && P_DATA[playerid][Level] != 5 && !IsPlayerAdmin(playerid))
  2858. {
  2859. 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]);
  2860. return 0;
  2861. }
  2862. return 1;
  2863. }
  2864.  
  2865. public OnPlayerSpawn(playerid)
  2866. {
  2867. if(IsPlayerNPC(playerid)) return 1;
  2868. #if SAVE_JAIL == true
  2869.  
  2870. if(GetPVarType(playerid, "FirstConnection"))
  2871. {
  2872. if(P_DATA[playerid][Incred])
  2873. {
  2874. for(new i = 0; i < 5; i++)
  2875. if(IsPlayerAttachedObjectSlotUsed(playerid, i))
  2876. RemovePlayerAttachedObject(playerid, i);
  2877.  
  2878. SetPlayerAttachedObject(playerid, 0, 18693, 5, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
  2879. SetPlayerAttachedObject(playerid, 1, 18693, 6, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
  2880. SetPlayerAttachedObject(playerid, 2, 18703, 6, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
  2881. SetPlayerAttachedObject(playerid, 3, 18703, 5, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
  2882. SetPlayerAttachedObject(playerid, 4, 18965, 2, 0.111052, 0.021643, -0.000846, 92.280899, 92.752510, 358.071044, 1.200000, 1.283168, 1.200000 );
  2883. }
  2884. if(P_DATA[playerid][VIPTag])
  2885. {
  2886. if(P_DATA[playerid][Tag3D])
  2887. {
  2888. Attach3DTextLabelToPlayer(P_DATA[playerid][Tag3D], playerid, 0.0, 0.0, 1.2);
  2889. }
  2890. }
  2891. DeletePVar(playerid, "FirstConnection");
  2892. new Query[256],
  2893. DBResult:Result1;
  2894.  
  2895. format(Query, sizeof (Query), "SELECT `Key`, `Jailed`, `Time`, `RealName` FROM `Jailed` WHERE `IP` = '%s';", GetPlayerIPEx(playerid));
  2896. Result1 = DB::Query(_DB, Query);
  2897.  
  2898. if(Result1)
  2899. {
  2900. if(DB::Valid(Result1))
  2901. {
  2902. new Field[30];
  2903.  
  2904. DB::GetField(Result1, "Jailed", Field, sizeof (Field));
  2905. P_DATA[playerid][Jailed] = strval(Field);
  2906.  
  2907. DB::GetField(Result1, "Time", Field, sizeof (Field));
  2908. P_DATA[playerid][JailTime] = strval(Field);
  2909.  
  2910. DB::GetField(Result1, "RealName", Field, sizeof (Field));
  2911. SetPVarString(playerid, "JailName", Field);
  2912.  
  2913. DB::Free(Result1);
  2914. }
  2915. else
  2916. {
  2917. DB::Free(Result1);
  2918. format(Query, 256, "SELECT `IP` FROM `Jailed` WHERE `RealName` = '%s'", Name(playerid));
  2919. new DBResult:Result2 = DB::Query(_DB, Query);
  2920.  
  2921. if(Result2)
  2922. {
  2923. if(DB::Valid(Result2))
  2924. {
  2925. new Field[64];
  2926. DB::GetField(Result2, "IP", Field, sizeof (Field));
  2927. if(strcmp(GetPlayerIPEx(playerid), Field))
  2928. {
  2929. format(Query, sizeof (Query), "SELECT `Key`, `Jailed`, `Time`, `RealName`, `IP` FROM `Jailed` WHERE `RealName` = '%s';", Name(playerid));
  2930. Result1 = DB::Query(_DB, Query);
  2931.  
  2932. DB::GetField(Result2, "Jailed", Field, sizeof (Field));
  2933. P_DATA[playerid][Jailed] = strval(Field);
  2934.  
  2935. DB::GetField(Result2, "Time", Field, sizeof (Field));
  2936. P_DATA[playerid][JailTime] = strval(Field);
  2937.  
  2938. DB::GetField(Result2, "RealName", Field, sizeof (Field));
  2939. SetPVarString(playerid, "JailName", Field);
  2940.  
  2941. DB::GetField(Result2, "IP", Field, sizeof (Field));
  2942. SetPVarString(playerid, "JFalseIP", Field);
  2943.  
  2944. DB::Free(Result2);
  2945. }
  2946. }
  2947. else DB::Free(Result2);
  2948.  
  2949. }
  2950. }
  2951. }
  2952.  
  2953. if(P_DATA[playerid][JailTime] > 0)
  2954. {
  2955. if(strcmp(GPVSEx(playerid, "JailName"), Name(playerid), false))
  2956. {
  2957. SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
  2958. 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"));
  2959. SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
  2960.  
  2961. SetPlayerName(playerid, GPVSEx(playerid, "JailName"));
  2962. P_DATA[playerid][JailTime] += (EXTRA_MINUTES);
  2963. }
  2964. else if(strcmp(GPVSEx(playerid, "JFalseIP"), GetPlayerIPEx(playerid), false))
  2965. {
  2966. SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
  2967. 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"));
  2968. SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
  2969.  
  2970. SetPlayerName(playerid, GPVSEx(playerid, "JailName"));
  2971. P_DATA[playerid][JailTime] += (EXTRA_MINUTES);
  2972. }
  2973. P_DATA[playerid][Jailed] = 1;
  2974.  
  2975. FormatMSG(playerid, Color:ORAN, "SERVER:"W" You are still jailed! "ORAN"["GREY"Jail time: "W"%d minutes"ORAN"]", P_DATA[playerid][JailTime]);
  2976.  
  2977. SetTimerEx("JailPlayer", 1500, false, "i", playerid);
  2978.  
  2979. new pQ[129];
  2980. format(pQ, sizeof (pQ), "UPDATE `Jailed` SET `IP` = '%s', `RealName` = '%s' WHERE `RealName` = '%s'", GetPlayerIPEx(playerid), Name(playerid), GPVSEx(playerid, "JailName"));
  2981. DB::Query(_DB, pQ);
  2982.  
  2983. }
  2984. else if(P_DATA[playerid][Jailed] && P_DATA[playerid][JailTime] == 0)
  2985. {
  2986. if(strcmp(GPVSEx(playerid, "JailName"), Name(playerid), false))
  2987. {
  2988. SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
  2989. 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"));
  2990. SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
  2991.  
  2992. SetPlayerName(playerid, GPVSEx(playerid, "JailName"));
  2993. P_DATA[playerid][Warns] += 2;
  2994. }
  2995. else if(strcmp(GPVSEx(playerid, "JFalseIP"), GetPlayerIPEx(playerid), false))
  2996. {
  2997. SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
  2998. 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"));
  2999. SendClientMessage(playerid, Color:ORAN, "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -");
  3000.  
  3001. SetPlayerName(playerid, GPVSEx(playerid, "JailName"));
  3002. P_DATA[playerid][Warns] += 2;
  3003. }
  3004. SendClientMessage(playerid, Color:ORAN, "SERVER:"W" You are still jailed! "ORAN"["GREY"Jail time: "W"Forever"ORAN"]");
  3005.  
  3006. SetTimerEx("JailPlayer", 1500, false, "i", playerid);
  3007.  
  3008. new pQ[129];
  3009. format(pQ, sizeof (pQ), "UPDATE `Jailed` SET `IP` = '%s', `RealName` = '%s' WHERE `RealName` = '%s'", GetPlayerIPEx(playerid), Name(playerid), GPVSEx(playerid, "JailName"));
  3010. DB::Query(_DB, pQ);
  3011.  
  3012. if(P_DATA[playerid][Warns] == MAX_P_WARNS)
  3013. {
  3014. SendClientMessage(playerid, Color:GREY, "You have been kicked from the server for exceeding warnings!");
  3015. KickEx(playerid, "System", "Exceeding Warnings");
  3016. return 0;
  3017. }
  3018.  
  3019. }
  3020. }
  3021. #endif
  3022. if(P_DATA[playerid][Frozen])
  3023. {
  3024. Freeze(playerid);
  3025. 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!)");
  3026. }
  3027. return 1;
  3028. }
  3029. public OnRconLoginAttempt(ip[], password[], success)
  3030. {
  3031. if(! success)
  3032. {
  3033. new zStr[180];
  3034. if(S_DATA[RCONProt])
  3035. {
  3036. S_DATA[RconFails] += 1;
  3037. if(S_DATA[RconFails] >= MAX_RCON_ATTEMPTS)
  3038. {
  3039. BadRcon(ip, password);
  3040. S_DATA[RconFails] = 0;
  3041. }
  3042. else
  3043. {
  3044. format(zStr, sizeof (zStr), "*** RCON: "W"RCON Protection turned off, someone tried to break the RCON. (IP: %s| RCON: %s)", ip, password);
  3045. SendMessageToAdmins(Color:GREY, zStr, 4);
  3046. SendMessageToAdmins(Color:GREY, "Enable "ORAN"Rcon Protection"GREY" from the Admin Control Panel!", 4);
  3047. }
  3048. }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;
  3049. }
  3050. else
  3051. {
  3052. foreach(Player, i)
  3053. {
  3054. new zIP[16];
  3055. GetPlayerIp(i, zIP, 16);
  3056. if(!strcmp (zIP, ip, true))
  3057. {
  3058. SendClientMessage(i, -1, ""BLUE"RCON:"W" Welcome, RCON Admin.");
  3059. }
  3060. }
  3061. }
  3062. return 1;
  3063. }
  3064.  
  3065. ShowTopStats(playerid, stats[], what[], limit = MAX_TOP_LIMIT)
  3066. {
  3067. new Speed = GetTickCount(),
  3068. DialString[3_0_0_0],
  3069. String[2][128],
  3070. Query[2][256],
  3071. DBResult:Result1;
  3072.  
  3073. format(Query[0], 256, "SELECT `Name` FROM `Top` ORDER BY (`%s` * 1) DESC limit %d", stats, limit);
  3074.  
  3075. Result1 = DB::Query(_DB, Query[0]);
  3076.  
  3077. new cColor[12];
  3078. if(!strcmp(stats, "Negative", false)) cColor = "{FF0000}";
  3079. else if(!strcmp(stats, "Positive", false)) cColor = ""GREE"";
  3080. else cColor = "{FFFFFF}";
  3081.  
  3082. format(DialString, sizeof (DialString), "{FFFFFF}Server top "ORAN"%s\n\n\n"W"Pos. Player = %s", what, stats);
  3083. for (new Qr; Qr < DB::Valid(Result1); Qr++)
  3084. {
  3085. db_get_field(Result1, 0, String[0], 128);
  3086.  
  3087. format(Query[1], 256, "SELECT `%s` FROM `Top` WHERE `Name` = '%s'", stats, String[0]);
  3088.  
  3089. new DBResult:Result2 = DB::Query(_DB, Query[1]);
  3090. db_get_field(Result2, 0, String[1], 128);
  3091.  
  3092. 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])));
  3093. else format(DialString, sizeof (DialString), "%s\n"BLUE"%d."GREY" %s "W": %s%s", DialString, Qr + 1, String[0], cColor, FormatNumber(strval(String[1])));
  3094.  
  3095.  
  3096. db_next_row(Result1);
  3097. DB::Free(Result2);
  3098. }
  3099. DB::Free(Result1);
  3100.  
  3101. format(DialString, sizeof (DialString), "%s\n\n"W"Top list generated in "ORAN"%d "W"ms.", DialString, GetTickCount() - Speed);
  3102. SPD(playerid, Dialog:TOP, BOX, ""W"TOP PLAYERS", DialString, "Close", "");
  3103. }
  3104. CMD:top(playerid,params[])
  3105. {
  3106. LoginCheck(playerid);
  3107.  
  3108. SPD(playerid, Dialog:TOP_SELECT, LIST, ""W"TOP PLAYERS", ""W"Top Killers\n\
  3109. "W"Top Deaths\n\
  3110. "W"Top Ranked\n\
  3111. "W"Top Respected\n\
  3112. "W"Top Online\n\
  3113. "W"Kills/Deaths ratio", "Select", "Close");
  3114.  
  3115.  
  3116. return 1;
  3117. }
  3118. CMD:stats(PARAMS)
  3119. {
  3120. LoginCheck(playerid);
  3121.  
  3122. new Player;
  3123. if(sscanf(params, "u", Player))
  3124. {
  3125. WhosStats = "your current stats";
  3126. FormatStats(playerid);
  3127. SendError(playerid, "You can also use "ORAN"/stats "W"<id>"GREY" to see someone else's stats!");
  3128. }
  3129. else
  3130. { if(Player == playerid)
  3131. {
  3132. WhosStats = "your current stats";
  3133. FormatStats(playerid);
  3134. SendError(playerid, "You can also use "ORAN"/stats "W"<id>"GREY" to see someone else's stats!");
  3135. }
  3136. else
  3137. {
  3138. if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
  3139.  
  3140. format(WhosStats, sizeof (WhosStats), ""ORAN"%s{FFFFFF}'s stats", Name(Player));
  3141. FormatStats(Player);
  3142.  
  3143. FormatMSG(Player, Color:GREY, "Player "ORAN"%s[%i]"GREY" is watching your stats!", Name(playerid), playerid);
  3144. }
  3145. }
  3146. SPD(playerid, Dialog:Stats, BOX, ""W"Statistics:", StatsString, "Close", "");
  3147. return 1;
  3148. }
  3149. CMD:specoff(PARAMS)
  3150. {
  3151. LoginCheck(playerid);
  3152. LevelCheck(playerid, 2);
  3153.  
  3154. if(P_DATA[playerid][Spec_Type] == ADMIN_SPEC_TYPE_NONE)
  3155. return SendError(playerid, "You are not spectating!");
  3156.  
  3157. TogglePlayerSpectating(playerid, 0);
  3158. P_DATA[playerid][Spec_ID] = 0xFFFF;
  3159. P_DATA[playerid][Spec_Type] = ADMIN_SPEC_TYPE_NONE;
  3160.  
  3161. foreach(Player, x)
  3162. {
  3163. if(P_DATA[x][Level] > 2)
  3164. {
  3165. FormatMSG(x, Color:GREY, "Admin "ORAN"%s[%i]"GREY" stopped spectating", Name(playerid), playerid);
  3166. }
  3167. }
  3168. SendClientMessage(playerid, Color:GREY, "You stopped spectating");
  3169. return 1;
  3170. }
  3171. CMD:specv(PARAMS)
  3172. {
  3173. LoginCheck(playerid);
  3174. LevelCheck(playerid, 2);
  3175.  
  3176. new VehicleID;
  3177. if(sscanf(params, "u", VehicleID)) return SendUsage(playerid, "/specv "GREY"<vehicleid>", "Will spectatea certain vehicle!");
  3178. else
  3179. {
  3180. if(VehicleID == (0xFFFF)) return SendError(playerid, "Invalid vehicle id");
  3181.  
  3182. if(VehicleID < MAX_VEHICLES)
  3183. {
  3184. TogglePlayerSpectating(playerid, 1);
  3185. PlayerSpectateVehicle(playerid, VehicleID);
  3186. P_DATA[playerid][Spec_ID] = VehicleID;
  3187. P_DATA[playerid][Spec_Type] = ADMIN_SPEC_TYPE_VEHICLE;
  3188. }
  3189. FormatMSG(playerid, Color:GREY, "You are now spectating vehicle id "ORAN"%i"GREY". Use "ORAN"/specoff"GREY" to stop spectating.", VehicleID);
  3190.  
  3191. foreach(Player, x)
  3192. {
  3193. if(P_DATA[x][Level] > 2)
  3194. {
  3195. FormatMSG(x, Color:GREY, "Admin "ORAN"%s[%i]"GREY" is spectating vehicle id "ORAN"%i"GREY".", Name(playerid), playerid, VehicleID);
  3196. }
  3197. }
  3198. }
  3199. return 1;
  3200. }
  3201. CMD:spec(PARAMS)
  3202. {
  3203. LoginCheck(playerid);
  3204. LevelCheck(playerid, 2);
  3205.  
  3206. new Player;
  3207. if(sscanf(params, "u", Player)) return SendUsage(playerid, "/spec "GREY"<id>", "Will spectate a certain player!");
  3208. else
  3209. {
  3210. if(Player == 0xFFFF )
  3211. return SendError(playerid, "Player not connected!");
  3212.  
  3213. if(Player == playerid)
  3214. return SendError(playerid, "You cannot spectate yourself!");
  3215.  
  3216. if(P_DATA[playerid][Level] < P_DATA[Player][Level])
  3217. return SendError(playerid, "You are not allowed to spectate this admin!");
  3218.  
  3219. TogglePlayerSpectating(playerid, 1);
  3220. PlayerSpectatePlayer(playerid, Player);
  3221. SetPlayerInterior(playerid, GetPlayerInterior(Player));
  3222.  
  3223. P_DATA[playerid][Spec_ID] = Player;
  3224. P_DATA[playerid][Spec_Type] = ADMIN_SPEC_TYPE_PLAYER;
  3225.  
  3226. FormatMSG(playerid, Color:GREY, "You are now spectating player "ORAN"%s[%i]"GREY". Use "ORAN"/specoff"GREY" to stop spectating.", Name(Player), Player);
  3227. foreach(Player, x)
  3228. {
  3229. if(P_DATA[x][Level] > 2)
  3230. {
  3231. FormatMSG(x, Color:GREY, "Admin "ORAN"%s[%i]"GREY" is spectating "ORAN"%s[%i]"GREY".", Name(playerid), playerid, Name(Player), Player);
  3232. }
  3233. }
  3234. }
  3235. return 1;
  3236. }
  3237. CMD:2012all(PARAMS)
  3238. {
  3239. LoginCheck(playerid);
  3240. LevelCheck(playerid, 4);
  3241.  
  3242.  
  3243. foreach(Player, Player)
  3244. {
  3245. if(P_DATA[Player][Level] < 1)
  3246. {
  3247. for (new w = 0; w < 11; w++)
  3248. {SetPlayerSkillLevel(Player, w, 0);}
  3249.  
  3250. SetPlayerHealth(Player, 0.1); SetPlayerArmour(Player, 0.0 ); SetPlayerTime(Player, 0, 0);
  3251. SetPlayerWeather(Player, -66); SetPlayerWantedLevel(Player, 6 ); SetPlayerSkin(Player, 159);
  3252. ResetPlayerWeapons(Player ); GivePlayerWeapon(Player, 10, 1); ResetPlayerMoney(Player );
  3253. SetPlayerScore(Player, 0 ); SetPlayerDrunkLevel(Player, 99999);
  3254.  
  3255. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" fucked up your and everyone's game!", Name(playerid), playerid);
  3256. }
  3257. }
  3258. SendClientMessage(playerid, Color:GREY, "You fucked up everyone's game! (Admins are an exception!)");
  3259. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" fucked up everyone's game!", Name(playerid), playerid);
  3260. return 1;
  3261. }
  3262. CMD:2012(PARAMS)
  3263. {
  3264. LoginCheck(playerid);
  3265. LevelCheck(playerid, 4);
  3266.  
  3267. new Player;
  3268. 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");
  3269. else
  3270. {
  3271. if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
  3272. if(Player == playerid) return SendError(playerid, "Player entered is you!");
  3273.  
  3274. for (new w = 0; w < 11; w++)
  3275. {SetPlayerSkillLevel(Player, w, 0);}
  3276.  
  3277. SetPlayerHealth(Player, 0.1); SetPlayerArmour(Player, 0.0 ); SetPlayerTime(Player, 0, 0);
  3278. SetPlayerWeather(Player, -66); SetPlayerWantedLevel(Player, 6 ); SetPlayerSkin(Player, 159);
  3279. ResetPlayerWeapons(Player ); GivePlayerWeapon(Player, 10, 1); ResetPlayerMoney(Player );
  3280. SetPlayerScore(Player, 0 ); SetPlayerDrunkLevel(Player, 99999);
  3281.  
  3282. new String[MAX_PLAYER_NAME];
  3283.  
  3284. format(String, MAX_PLAYER_NAME, "[NUB]%s", Name(Player));
  3285. if(strfind(Name(Player), "[NUB]", false, 0)) SetPlayerName(Player, String);
  3286.  
  3287. FormatMSG(playerid, Color:GREY, "You fucked up "ORAN"%s[%i]"GREY"'s game!", Name(Player), Player);
  3288. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" fucked up your game!", Name(playerid), playerid);
  3289. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" fucked up "ORAN"%s[%i]"GREY"'s game!", Name(playerid), playerid ,Name(Player), Player);
  3290. }
  3291. return 1;
  3292. }
  3293. CMD:eject(PARAMS)
  3294. {
  3295. LoginCheck(playerid);
  3296. LevelCheck(playerid, 2);
  3297.  
  3298. new Player;
  3299. if(sscanf(params, "u", Player)) return SendUsage(playerid, "/eject "GREY"<id>", "Will eject player from vehicle");
  3300. else
  3301. {
  3302. if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
  3303. if(Player == playerid) return SendError(playerid, "Player entered is you!");
  3304. if(!IsPlayerInAnyVehicle(Player)) return SendError(playerid, "Player is not in a vehicle!");
  3305.  
  3306. RemovePlayerFromVehicle(Player);
  3307.  
  3308. FormatMSG(playerid, Color:GREY, "You ejected "ORAN"%s[%i]"GREY" from vehicle!", Name(Player), Player);
  3309. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" ejected you from vehicle!", Name(playerid), playerid);
  3310. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" ejected "ORAN"%s[%i]"GREY" from vehicle!", Name(playerid), playerid ,Name(Player), Player);
  3311. }
  3312. return 1;
  3313. }
  3314. CMD:setonline(PARAMS)
  3315. {
  3316. LoginCheck(playerid);
  3317. LevelCheck(playerid, 5);
  3318.  
  3319. new Player, Time[3];
  3320. 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");
  3321. else
  3322. {
  3323. if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
  3324. if(Time[1] > 60 || Time[1] < 0) return SendError(playerid, "Invalid minutes inserted!");
  3325. if(Time[2] > 60 || Time[2] < 0) return SendError(playerid, "Invalid seconds inserted!");
  3326.  
  3327. P_DATA[Player][Hours] = Time[0]; P_DATA[Player][Minutes] = Time[1]; P_DATA[Player][Seconds] = Time[2];
  3328. if(Player == playerid)
  3329. {
  3330. 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]);
  3331. 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]);
  3332. }
  3333. else
  3334. {
  3335. 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]);
  3336. 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]);
  3337. 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]);
  3338. }
  3339.  
  3340. P_DATA[Player][ConnTime] = gettime();
  3341. }
  3342. return 1;
  3343. }
  3344. CMD:warn(PARAMS)
  3345. {
  3346. LoginCheck(playerid);
  3347. LevelCheck(playerid, 3);
  3348.  
  3349. new Player, Reason[80];
  3350. 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!");
  3351. else
  3352. {
  3353. if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
  3354. if(Player == playerid) return SendError(playerid, "Player entered is you!");
  3355.  
  3356. CheckImune(playerid, Player);
  3357.  
  3358. P_DATA[Player][Warns] += 1;
  3359.  
  3360. if(P_DATA[Player][Warns] != MAX_P_WARNS)
  3361. {
  3362. #if SAVE_IN_LOGS == true
  3363. 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 ());
  3364. #endif
  3365. 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]);
  3366. 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]);
  3367. GameTextForPlayer(Player, "~r~WARNED!", 3000, 3);
  3368. }
  3369. else if(P_DATA[Player][Warns] >= MAX_P_WARNS)
  3370. {
  3371. #if SAVE_IN_LOGS == true
  3372. 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 ());
  3373. #endif
  3374. P_DATA[Player][Warns] = 0;
  3375. FormatMSG(Player, Color:GREY, "You have been warned by admin "ORAN"%s[%i]"GREY" for "ORAN" %s", Name(playerid), playerid, Reason);
  3376. SendError(Player, "You have reached the maximum warns per player! "ORAN""#MAX_P_WARNS""W"/"#MAX_P_WARNS"");
  3377. SendError(Player, "Kicked from the server!");
  3378. KickEx(Player, Name(playerid), "Exceeding Warnings!", true);
  3379. }
  3380.  
  3381. }
  3382. return 1;
  3383. }
  3384. CMD:show(PARAMS)
  3385. {
  3386. LoginCheck(playerid);
  3387. LevelCheck(playerid, 2);
  3388.  
  3389. new Player, Show[129];
  3390. 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!");
  3391. else
  3392. {
  3393. if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
  3394. if(Player == playerid) return SendError(playerid, "Player entered is you!");
  3395. CheckImune(playerid, Player);
  3396.  
  3397. GameTextForPlayer(Player, Show, 6000, 3);
  3398.  
  3399. FormatMSG(playerid, Color:GREY, "Screen text sent to "ORAN"%s[%i]", Name(Player), Player);
  3400. }
  3401. return 1;
  3402. }
  3403. CMD:cookies(PARAMS)
  3404. {
  3405. LoginCheck(playerid);
  3406.  
  3407. if(!P_DATA[playerid][Cookies] )
  3408. SendClientMessage(playerid, Color:GREY, "You currently have no cookies! Buy some with "ORAN"/buycookies");
  3409. else if(P_DATA[playerid][Cookies] > 1)
  3410. FormatMSG(playerid, Color:GREY, "You have "ORAN"%d"GREY" cookies! Eat them or gift them to somebody!", P_DATA[playerid][Cookies]);
  3411. else if(P_DATA[playerid][Cookies] == 1)
  3412. SendClientMessage(playerid, Color:GREY, "You have "ORAN"1"GREY" cookie! Eat it or gift it to somebody!");
  3413. return 1;
  3414. }
  3415.  
  3416. CMD:cookieshelp(PARAMS)
  3417. {
  3418. LoginCheck(playerid);
  3419.  
  3420. new bStr[512];
  3421. format(bStr, sizeof(bStr), "%s%s",\
  3422. ""ORAN"Cookies Center!\n\n\
  3423. "GREY"Use "ORAN"/cookies"GREY" to check how many cookies you have!\n\
  3424. "GREY"Use "ORAN"/buycookies"GREY" to buy cookies.\n\
  3425. "GREY"Use "ORAN"/buycookiesjar"GREY" to buy a jar of "ORAN"600"GREY" cookies!\n",
  3426. ""GREY"Use "ORAN"/eatcookie"GREY" you will eat one cookie and gain 25 health!\n\
  3427. "GREY"Use "ORAN"/giftcookies"GREY" you will gift cookies to your friends.\n\n\
  3428. {FFFFFF}--------------------\nBe the cookie monster!");
  3429.  
  3430. SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Cookies!", bStr, "Close", "");
  3431. return 1;
  3432. }
  3433. CMD:setcookies(PARAMS)
  3434. {
  3435. LoginCheck(playerid);
  3436. LevelCheck(playerid, 3);
  3437.  
  3438. new Player, Cookiz;
  3439. if(sscanf(params, "ud", Player, Cookiz)) return SendUsage(playerid, "/setcookies <id> <cookies>", "Will set player's cookies!!");
  3440. else
  3441. {
  3442. if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
  3443.  
  3444. P_DATA[Player][Cookies] = Cookiz;
  3445.  
  3446. if(playerid != Player)
  3447. {
  3448. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY" cookies to "ORAN"%d",Name(Player), Player, Cookiz);
  3449. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"%s[%i]"GREY"'s cookies to "ORAN"%d", Name(playerid), playerid, Name(Player), Player, Cookiz);
  3450. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your cookies to "ORAN"%d"GREY"!", Name(playerid), playerid, Cookiz);
  3451. }
  3452. else
  3453. {
  3454. FormatMSG(playerid, Color:GREY, "You set your cookies to "ORAN"%d" ,Cookiz);
  3455. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his cookies to "ORAN"%d", Name(playerid), playerid, Cookiz);
  3456. }
  3457. }
  3458. return 1;
  3459. }
  3460. CMD:giftcookies(PARAMS)
  3461. {
  3462. LoginCheck(playerid);
  3463.  
  3464. new Player, Cookiz;
  3465. if(sscanf(params, "ud", Player, Cookiz)) return SendUsage(playerid, "/giftcookies <id> <cookies>", "Will gift cookies to specified player!");
  3466. else
  3467. {
  3468. if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
  3469. if(Player == playerid) return SendError(playerid, "Player entered is you!");
  3470. if(P_DATA[playerid][Cookies] < Cookiz) return SendError(playerid, "You don't have enough cookies to gift!");
  3471.  
  3472. P_DATA[playerid][Cookies] -= Cookiz;
  3473. P_DATA[Player][Cookies] += Cookiz;
  3474.  
  3475. FormatMSG(playerid, Color:GREY, "You gifted "ORAN"%d"GREY" cookies to "ORAN"%s[%i]"GREY"",Cookiz, Name(Player), Player);
  3476. FormatMSG(Player, Color:GREY, "Player "ORAN"%s[%i]"GREY" gifted you "ORAN"%d"GREY" cookies!", Name(playerid), playerid, Cookiz);
  3477.  
  3478. new Str[60];
  3479. format(Str, sizeof (Str), "~w~Cookies left:~n~~w~%d", P_DATA[playerid][Cookies]);
  3480. GameTextForPlayer(playerid, Str, 4000, 1);
  3481. format(Str, sizeof (Str), "~w~Cookies:~n~~w~%d", P_DATA[Player][Cookies]);
  3482. GameTextForPlayer(Player, Str, 4000, 1);
  3483. }
  3484. return 1;
  3485. }
  3486.  
  3487. CMD:eatcookie(PARAMS)
  3488. {
  3489. LoginCheck(playerid);
  3490.  
  3491. if(!P_DATA[playerid][Cookies])
  3492. return SendClientMessage(playerid, Color:GREY, "You don't have any cookies! Buy some with "ORAN"/buycookies");
  3493.  
  3494. P_DATA[playerid][Cookies]-= 1;
  3495. GameTextForPlayer(playerid, "~r~+~w~25~r~ Health", 5000, 1);
  3496.  
  3497. new Float:Health;
  3498. GetPlayerHealth(playerid, Health );
  3499. SetPlayerHealth(playerid,(Health + 25));
  3500. FormatMSG(playerid, Color:GREY, "Cookies left: "ORAN"%d", P_DATA[playerid][Cookies]);
  3501. return 1;
  3502. }
  3503.  
  3504. CMD:buycookiesjar(PARAMS)
  3505. {
  3506. LoginCheck(playerid);
  3507.  
  3508. new Yes[4];
  3509. 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")");
  3510. else
  3511. {
  3512. if(!strcmp(Yes, "yes"))
  3513. {
  3514. if(GetPlayerMoney(playerid) <= 600 * MAX_COOKIE_COST)
  3515. {
  3516. FormatMSG(playerid, Color:GREY, "Insufficient moneys! ("ORAN" 600 Cookies * "#MAX_COOKIE_COST" = "GREE"$%s"GREY")", FormatNumber(600 * MAX_COOKIE_COST));
  3517. return 0;
  3518. }
  3519. else
  3520. {
  3521. GivePlayerMoney(playerid, - (600 * MAX_COOKIE_COST));
  3522. P_DATA[playerid][Cookies] += 600;
  3523. FormatMSG(playerid, Color:GREY, "You bought a jar of "ORAN"600"GREY" cookies and costed you "GREE"$%s", FormatNumber(600 * MAX_COOKIE_COST));
  3524. }
  3525. }else return SendUsage(playerid, "/buycookiesjar <yes>", "Will buy a jar of 600 cookies. "ORAN"("GREY"600 * "GREE"$"#MAX_COOKIE_COST""ORAN")");
  3526. }
  3527. return 1;
  3528. }
  3529.  
  3530. CMD:buycookies(PARAMS)
  3531. {
  3532. LoginCheck(playerid);
  3533.  
  3534. new Cookiz;
  3535. if(sscanf(params, "i", Cookiz)) return SendUsage(playerid, "/buycookies <cookies>", "Will buy specified amount of cookies. One cookie = "GREE"$"#MAX_COOKIE_COST"");
  3536. else
  3537. {
  3538. if(Cookiz < 1 ) return SendUsage(playerid, "/buycookies <cookies>");
  3539. if(Cookiz > 600) return SendError(playerid, "You can't buy more than "ORAN"600"GREY" cookies at once! YOU COOKIE MONSTER!!!!");
  3540. if(GetPlayerMoney(playerid) <= Cookiz * MAX_COOKIE_COST)
  3541. {
  3542. FormatMSG(playerid, Color:GREY, "Insufficient moneys! ("ORAN" %d Cookies * "#MAX_COOKIE_COST" = "GREE"$%s"GREY")", Cookiz, FormatNumber(Cookiz * MAX_COOKIE_COST));
  3543. return 0;
  3544. }
  3545. else
  3546. {
  3547. GivePlayerMoney(playerid, - (Cookiz * MAX_COOKIE_COST));
  3548. P_DATA[playerid][Cookies] += Cookiz;
  3549. FormatMSG(playerid, Color:GREY, "You bought "ORAN"%d"GREY" cookies and costed you "GREE"$%s", Cookiz, FormatNumber(Cookiz * MAX_COOKIE_COST));
  3550. }
  3551. }
  3552. return 1;
  3553. }
  3554. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  3555. {
  3556. new _X = 0;
  3557. while (_X != MAX_PLAYERS)
  3558. {
  3559. if(IsPlayerConnected(_X) &&
  3560. GetPlayerState(_X) == PLAYER_STATE_SPECTATING &&
  3561. P_DATA[_X][Spec_ID] == playerid &&
  3562. P_DATA[_X][Spec_Type] == ADMIN_SPEC_TYPE_PLAYER)
  3563. {
  3564. SetPlayerInterior(_X, newinteriorid);
  3565. }
  3566. _X++;
  3567. }
  3568. }
  3569. public OnPlayerStateChange(playerid, newstate, oldstate)
  3570. {
  3571.  
  3572. return 1;
  3573. }
  3574. public OnPlayerEnterVehicle(playerid, vehicleid)
  3575. {
  3576. if(vehicleid == P_DATA[playerid][aCar])
  3577. return SendClientMessage(playerid, Color:GREY, " "GREY"Welcome back to your "ORAN"Admin Vehicle"GREY"!");
  3578.  
  3579. return 1;
  3580. }
  3581.  
  3582. CreateVehicleEx(playerid, model, Float:x, Float:z, Float:y, Float:rot, color1, color2, respawn_time, inveh = true)
  3583. {
  3584. DestroyVehicle(P_DATA[playerid][GiveCar]);
  3585. P_DATA[playerid][GiveCar] = CreateVehicle(model, Float:x, Float:z, Float:y, Float:rot, color1, color2, respawn_time);
  3586. if(inveh)PutPlayerInVehicle(playerid, P_DATA[playerid][GiveCar], 0);
  3587. }
  3588.  
  3589. CMD:accp(PARAMS)
  3590. {
  3591. LoginCheck(playerid);
  3592. LevelCheck(playerid, 1);
  3593.  
  3594. if(P_DATA[playerid][aCar] == -1)
  3595. return SendError(playerid, "You didn't spawn any admin vehicle! Spawn it with "ORAN"/acar");
  3596.  
  3597. if(!IsPlayerInVehicle(playerid, P_DATA[playerid][aCar]))
  3598. return SendError(playerid, "You must be in your "ORAN"Admin Vehicle"GREY" to use this command!");
  3599.  
  3600. SPD(playerid, Dialog:ACCP, LIST, ""W"Tune: "ORAN"Admin Car", ""GREY"Add nos\n\
  3601. "GREY"Change colors\n\
  3602. "GREY"Components\n\
  3603. "BLUE"Save Changes\n\
  3604. "GREE"Load Changes\n\
  3605. "ORAN"Discard Changes", "Select", "Close");
  3606. return 1;
  3607. }
  3608. CMD:acar(PARAMS)
  3609. {
  3610. LoginCheck(playerid);
  3611. LevelCheck(playerid, 1);
  3612.  
  3613. new Float:Pos[4];
  3614. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  3615.  
  3616. if(IsPlayerInAnyVehicle(playerid))
  3617. {
  3618. GetVehicleZAngle(GetPlayerVehicleID(playerid), Pos[3]);
  3619. GetPlayerFacingAngle(playerid, Pos[3]);
  3620. SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]+2);
  3621. }else GetPlayerFacingAngle(playerid, Pos[3]);
  3622.  
  3623. if(P_DATA[playerid][aCar] == -1)
  3624. {
  3625. DestroyVehicle(P_DATA[playerid][aCar]);
  3626. P_DATA[playerid][aCar] = CreateVehicle(415, Pos[0], Pos[1], Pos[2], Pos [3], 0, 0, 90000);
  3627. PutPlayerInVehicle(playerid, P_DATA[playerid][aCar], 0);
  3628. SetVehicleHealth(P_DATA[playerid][aCar], 99999.0);
  3629.  
  3630. GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~~h~Admin car created!", 3000, 3);
  3631. ZaAdminCar[playerid] = CreatePlayer3DTextLabel(playerid, "Your Admin Car", Color:ORAN, 0.0, 0.0, 0.0, 120.0, (0xFFFF), P_DATA[playerid][aCar], 1);
  3632. }
  3633. else
  3634. {
  3635. GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~~h~Admin car called!", 3000, 3);
  3636.  
  3637. SetVehiclePos(P_DATA[playerid][aCar], Pos[0], Pos[1], Pos[2]);
  3638. SetVehicleZAngle(P_DATA[playerid][aCar], Pos[3]);
  3639. PutPlayerInVehicle(playerid, P_DATA[playerid][aCar], 0);
  3640. }
  3641. SendClientMessage(playerid, Color:GREY, "Use "ORAN"/accp"GREY" to tune your admin vehicle!!");
  3642.  
  3643. return 1;
  3644. }
  3645. CMD:vips(PARAMS)
  3646. {
  3647. LoginCheck(playerid);
  3648.  
  3649. new C, S[1024], cString[150];
  3650.  
  3651. foreach(Player, i){
  3652. if(P_DATA[i][Vip] > 0){
  3653. C++;
  3654. }
  3655. }
  3656.  
  3657. format(cString, sizeof (cString), "%s", (C) ? (OnlineCheck("Vips", C)) : ("{FF0000}No VIP members online!")) ;
  3658.  
  3659. if(C == 1){
  3660. foreach(Player, i){
  3661. if(P_DATA[i][Vip] > 0){
  3662. format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"L:%d|ID:%d"W"]",cString, Name(i), P_DATA[i][Vip],i);
  3663. }
  3664. }
  3665. }
  3666.  
  3667. if(C > 1){
  3668. foreach(Player, i){
  3669. if(P_DATA[i][Vip] > 0){
  3670. format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"L:%d|ID:%d"W"], ",S, Name(i), P_DATA[i][Vip],i);
  3671.  
  3672. if(!(i % MAX_SHOW_PER_ROW)){
  3673. if(i != 0){
  3674. strdel(S, strlen(S) - 2, strlen(S));
  3675. strins(S, "\n", strlen(S));
  3676. //S[0] = EOS;
  3677. }
  3678. }
  3679. }
  3680. }
  3681. }
  3682. if(!C) memcpy(S, cString, 0, 1024 );
  3683. if(strlen(S) < 1024) SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Online VIP members!", S, "Close", "");
  3684. 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", "");
  3685. return 1;
  3686. }
  3687. CMD:muted(PARAMS)
  3688. {
  3689. LoginCheck(playerid);
  3690.  
  3691. new C, S[1024], cString[150];
  3692.  
  3693. foreach(Player, i){
  3694. if(P_DATA[i][Muted] > 0){
  3695. C++;
  3696. }
  3697. }
  3698.  
  3699. format(cString, sizeof (cString), "%s", (C) ? (OnlineCheck("Muted", C)) : (""W"--------------\n{FF0000}No Muted players online!\n"W"--------------\n")) ;
  3700.  
  3701. if(C == 1){
  3702. foreach(Player, i){
  3703. if(P_DATA[i][Muted] > 0){
  3704. if(!P_DATA[i][MutedTime]){
  3705. format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"TIME:Forever|ID:%d"W"]",cString, Name(i), i);
  3706. }else{
  3707. format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"TIME:%d|ID:%d"W"]",cString, Name(i), P_DATA[i][MutedTime],i);}
  3708. }
  3709. }
  3710. }
  3711.  
  3712. if(C > 1){
  3713. foreach(Player, i){
  3714. if(P_DATA[i][Muted] > 0){
  3715. if(!P_DATA[i][MutedTime]){
  3716. format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"TIME:Forever|ID:%d"W"]",cString, Name(i), i);
  3717. }else{
  3718. 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);}
  3719. if(!(i % MAX_SHOW_PER_ROW)){
  3720. if(i != 0){
  3721. strdel(S, strlen(S) - 2, strlen(S));
  3722. strins(S, "\n", strlen(S));
  3723. }
  3724. }
  3725. }
  3726. }
  3727. }
  3728. if(!C) format(S, sizeof (S), "%s", cString);
  3729. if(strlen(S) < 1024) SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Muted players!", S, "Close", "");
  3730. 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", "");
  3731. return 1;
  3732. }
  3733. CMD:jailed(PARAMS)
  3734. {
  3735. LoginCheck(playerid);
  3736.  
  3737. new C, S[1024], cString[150];
  3738.  
  3739. foreach(Player, i){
  3740. if(P_DATA[i][Jailed] > 0){
  3741. C++;
  3742. }
  3743. }
  3744.  
  3745. format(cString, sizeof (cString), "%s", (C) ? (OnlineCheck("Jailed", C)) : (""W"--------------\n{FF0000}No Jailed players online!\n"W"--------------\n")) ;
  3746.  
  3747. if(C == 1){
  3748. foreach(Player, i){
  3749. if(P_DATA[i][Jailed] > 0){
  3750. if(!P_DATA[i][JailTime]){
  3751. format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"TIME:Forever|ID:%d"W"]",cString, Name(i), i);
  3752. }else{
  3753. format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"TIME:%d|ID:%d"W"]",cString, Name(i), P_DATA[i][JailTime],i);}
  3754. }
  3755. }
  3756. }
  3757.  
  3758. if(C > 1){
  3759. foreach(Player, i){
  3760. if(P_DATA[i][Jailed] > 0){
  3761. if(!P_DATA[i][JailTime]){
  3762. format(S, sizeof (S), "%s"BLUE"%s"W"["BLUE"TIME:Forever|ID:%d"W"]",cString, Name(i), i);
  3763. }else{
  3764. 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);}
  3765. if(!(i % MAX_SHOW_PER_ROW)){
  3766. if(i != 0){
  3767. strdel(S, strlen(S) - 2, strlen(S));
  3768. strins(S, "\n", strlen(S));
  3769. }
  3770. }
  3771. }
  3772. }
  3773. }
  3774. if(!C) format(S, sizeof (S), "%s", cString);
  3775. if(strlen(S) < 1024) SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Jailed players!", S, "Close", "");
  3776. 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", "");
  3777. return 1;
  3778. }
  3779. CMD:frozen(PARAMS)
  3780. {
  3781. LoginCheck(playerid);
  3782. LevelCheck(playerid, 1);
  3783.  
  3784. new C, S[1024], cString[150];
  3785.  
  3786. foreach(Player, i){
  3787. if(P_DATA[i][Vip] > 0){
  3788. C++;
  3789. }
  3790. }
  3791.  
  3792. format(cString, sizeof (cString), "%s", (C) ? (OnlineCheck("Frozen", C)) : ("{FF0000}No VIP members online!")) ;
  3793.  
  3794. if(C == 1){
  3795. foreach(Player, i){
  3796. if(P_DATA[i][Vip] > 0){
  3797. format(S, sizeof (S), "%s"BLUE"%s",cString, Name(i));
  3798. }
  3799. }
  3800. }
  3801.  
  3802. if(C > 1){
  3803. foreach(Player, i){
  3804. if(P_DATA[i][Vip] > 0){
  3805. format(S, sizeof (S), "%s"BLUE"%s, ",S, Name(i));
  3806.  
  3807. if(!(i % MAX_SHOW_PER_ROW)){
  3808. if(i != 0){
  3809. strdel(S, strlen(S) - 2, strlen(S));
  3810. strins(S, "\n", strlen(S));
  3811. //S[0] = EOS;
  3812. }
  3813. }
  3814. }
  3815. }
  3816. }
  3817. if(!C) format(S, sizeof (S), "%s", cString);
  3818. if(strlen(S) < 1024) SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Frozen Players!", S, "Close", "");
  3819. 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", "");
  3820. return 1;
  3821. }
  3822. CMD:admins(PARAMS)
  3823. {
  3824. LoginCheck(playerid);
  3825.  
  3826. new C, S[1024], cString[150];
  3827.  
  3828. foreach(Player, i){
  3829. if(P_DATA[i][Level] > 0){
  3830. C++;
  3831. }
  3832. }
  3833.  
  3834. format(cString, sizeof (cString), "%s", (C) ? (OnlineCheck("Admins", C)) : ("{FF0000}No VIP members online!")) ;
  3835.  
  3836. if(C == 1){
  3837. foreach(Player, i){
  3838. if(P_DATA[i][Level] > 0){
  3839. format(S, sizeof (S), "%s"GREE"%s"W"["GREE"L:%d|ID:%d"W"]",cString, Name(i), P_DATA[i][Level],i);
  3840. }
  3841. }
  3842. }
  3843.  
  3844. if(C > 1){
  3845. foreach(Player, i){
  3846. if(P_DATA[i][Level] > 0){
  3847. format(S, sizeof (S), "%s"GREE"%s"W"["GREE"L:%d|ID:%d"W"], ",S, Name(i), P_DATA[i][Level],i);
  3848.  
  3849. if(!(i % MAX_SHOW_PER_ROW)){
  3850. if(i != 0){
  3851. strdel(S, strlen(S) - 2, strlen(S));
  3852. strins(S, "\n", strlen(S));
  3853. //S[0] = EOS;
  3854. }
  3855. }
  3856. }
  3857. }
  3858. }
  3859. if(!C) format(S, sizeof (S), "%s", cString);
  3860. if(strlen(S) < 1024) SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Online Administrators!", S, "Close", "");
  3861. 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", "");
  3862. return 1;
  3863. }
  3864.  
  3865. CMD:wcheck(PARAMS)
  3866. {
  3867. LoginCheck(playerid);
  3868. LevelCheck(playerid, 4);
  3869.  
  3870. new Player;
  3871. if(sscanf(params, "u", Player)) return SendUsage(playerid, "/wcheck <id>", "Will check player's weapon and ammo");
  3872. else
  3873. {
  3874. if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
  3875.  
  3876. new Weapon, Ammo, WeaponName[20], String[715];
  3877.  
  3878. if(Player != playerid) format(String, sizeof String, ""ORAN"%s"GREY"'s weapons:\n\n", Name(Player));
  3879. else String = "{FFFFFF}Checking your weapons\n";
  3880.  
  3881. for (new w = 0; w < 9; w++)
  3882. {
  3883. GetPlayerWeaponData(Player, w, Weapon, Ammo);
  3884.  
  3885. if(Ammo < 0) Ammo = 9999;
  3886. if(Weapon != 0)
  3887. {
  3888. GetWeaponName(Weapon, WeaponName[w], 20);
  3889. format(String, sizeof String, "%s"GREY"Weapon: "ORAN"%s"GREY" Ammo: "ORAN"%d\n", String, WeaponName[w], Ammo);
  3890. }
  3891. }
  3892. SPD(playerid, Dialog:Empty, BOX, ""GREY"Checking Weapons!", String, "Close", "");
  3893. }
  3894. return 1;
  3895. }
  3896. CMD:fake(PARAMS)
  3897. {
  3898. LoginCheck(playerid);
  3899. LevelCheck(playerid, 5);
  3900.  
  3901. SendClientMessage(playerid, Color:GREY, "/fakechat /fakecmd /fakedeath /fakecon /fakedisc");
  3902. return 1;
  3903. }
  3904. CMD:fakedisc(PARAMS)
  3905. {
  3906. LoginCheck(playerid);
  3907. LevelCheck(playerid, 5);
  3908.  
  3909. new Player, Reason;
  3910. 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")");
  3911. else
  3912. {
  3913. if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
  3914. if(Reason > 3 || Reason < 0) return SendError(playerid, "Invalid reason! ("ORAN" 0 - Crash | 1 - Leaving | 2 - Kick/Ban "GREY")");
  3915. SendClientMessage(playerid, Color:GREY, "Fake command sent!");
  3916.  
  3917. new zStr[129];
  3918. switch(Reason)
  3919. {
  3920. case 0: format(zStr, sizeof (zStr), "%s["W"%i"ORAN"]"W" Has left the server! "ORAN"[CRASH]", Name(playerid), playerid);
  3921. case 1: format(zStr, sizeof (zStr), "%s["W"%i"ORAN"]"W" Has left the server! "ORAN"[LEAVING]", Name(playerid), playerid);
  3922. case 2: format(zStr, sizeof (zStr), "%s["W"%i"ORAN"]"W" Has left the server! "ORAN"[KICK"W"/"ORAN"BAN]", Name(playerid), playerid);
  3923. }
  3924.  
  3925. SendClientMessageToAll(Color:ORAN, zStr);
  3926. }
  3927. return 1;
  3928. }
  3929. CMD:fakecon(PARAMS)
  3930. {
  3931. LoginCheck(playerid);
  3932. LevelCheck(playerid, 5);
  3933.  
  3934. new Player;
  3935. if(sscanf(params, "u",Player)) return SendUsage(playerid, "/fakecon "GREY"<id>", "Will send a fake connection of the player!");
  3936. else
  3937. {
  3938. if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
  3939.  
  3940. SendClientMessage(playerid, Color:GREY, "Fake command sent!");
  3941.  
  3942. new String[256];
  3943. format(String, sizeof (String), "%s["W"%i"ORAN"]"W" Has joined the server!", Name(Player), Player);
  3944. SendClientMessageToAll(Color:ORAN, String);
  3945. }
  3946. return 1;
  3947. }
  3948. CMD:fakecmd(PARAMS)
  3949. {
  3950. LoginCheck(playerid);
  3951. LevelCheck(playerid, 5);
  3952.  
  3953. new Player, Command[129];
  3954. if(sscanf(params, "us[129]",Player, Command)) return SendUsage(playerid, "/fakecmd "GREY"<id> <command>", "Will send a fake command! The command must include the /.");
  3955. else
  3956. {
  3957. if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
  3958.  
  3959. SendClientMessage(playerid, Color:GREY, "Fake command sent!");
  3960.  
  3961. CallRemoteFunction("OnPlayerCommandText", "is", Player, Command);
  3962. }
  3963. return 1;
  3964. }
  3965. CMD:fakemsg(PARAMS)
  3966. {
  3967. LoginCheck(playerid);
  3968. LevelCheck(playerid, 5);
  3969.  
  3970. new Player, xChat[129];
  3971. if(sscanf(params, "us[129]",Player, xChat)) return SendUsage(playerid, "/fakemsg "GREY"<id> [message]", "Will send a fake message of the specified player!");
  3972. else
  3973. {
  3974. if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
  3975.  
  3976. SendClientMessage(playerid, Color:GREY, "Fake chat sent!");
  3977.  
  3978. SendPlayerMessageToAll(Player, xChat);
  3979. }
  3980. return 1;
  3981. }
  3982. CMD:fakechat(PARAMS)
  3983. {
  3984. LoginCheck(playerid);
  3985. LevelCheck(playerid, 5);
  3986.  
  3987. new Player, xChat[129];
  3988. if(sscanf(params, "us[129]",Player, xChat)) return SendUsage(playerid, "/fakechat "GREY"<id> [message]", "Will send a fake message of the specified player!");
  3989. else
  3990. {
  3991. if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
  3992.  
  3993. SendClientMessage(playerid, Color:GREY, "Fake chat sent!");
  3994.  
  3995. SendPlayerMessageToAll(Player, xChat);
  3996. }
  3997. return 1;
  3998. }
  3999. CMD:fakedeath(PARAMS)
  4000. {
  4001. LoginCheck(playerid);
  4002. LevelCheck(playerid, 5);
  4003.  
  4004. #define Killer 0
  4005. #define Killed 1
  4006.  
  4007. new Fake[2], Weapon;
  4008. if(sscanf(params, "uuD(-1)", Fake[Killer], Fake[Killed], Weapon))
  4009. 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!)");
  4010. else
  4011. {
  4012. if(Fake[Killer] == 0xFFFF) return SendError(playerid, "Killer is not connected!");
  4013. if(Fake[Killed] == 0xFFFF) return SendError(playerid, "Killed is not connected!");
  4014. if(Fake[Killer] == 0xFFFF && Fake[Killed] == 0xFFFF) return SendError(playerid, "Killer and Killed are both offline!");
  4015.  
  4016. if(Weapon == -1)
  4017. {
  4018. new rWeapon;
  4019. switch (random(2))
  4020. {
  4021. case 0: rWeapon = random(19);
  4022. case 1: rWeapon = 21 + random(26);
  4023. default: rWeapon = 0;
  4024. }
  4025. Weapon = rWeapon;
  4026. return SendDeathMessage(Fake[Killer], Fake[Killed], Weapon),
  4027. SendClientMessage(playerid, Color:GREY, "Fake death sent!");
  4028. }
  4029.  
  4030. if(!IsValidWeapon(Weapon))
  4031. return SendError(playerid, "Invalid Weapon ID!");
  4032.  
  4033. SendDeathMessage(Fake[Killer], Fake[Killed], Weapon);
  4034.  
  4035. SendClientMessage(playerid, Color:GREY, "Fake death sent!");
  4036. }
  4037. return 1;
  4038. }
  4039. CMD:removeacc(PARAMS)
  4040. {
  4041. LoginCheck(playerid);
  4042. LevelCheck(playerid, 5);
  4043.  
  4044. new Account[MAX_PLAYER_NAME], Reason[100];
  4045. 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");
  4046. else
  4047. {
  4048. if(AccountExist(Account))
  4049. {
  4050. if(!strcmp(Name(playerid), Account, false))
  4051. return SendError(playerid, "You cannot delete your own account!");
  4052.  
  4053. new Query[100];
  4054. format(Query, 200, "DELETE FROM `Accounts` WHERE `Name` = '%s'", Account);
  4055. DB::Query(_DB, Query);
  4056.  
  4057. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" has deleted account: "ORAN"%s"GREY"["ORAN"Reason: %s"GREY"]", Name(playerid), playerid, Account, Reason);
  4058. FormatMSG(playerid, Color:GREY, "Account "ORAN"%s"GREY" has been deleted!", Account);
  4059. FormatMSG(playerid, Color:ORAN, "Reason: "GREY"%s", Reason);
  4060. }
  4061. else
  4062. {
  4063. SendError(playerid, "Account does not exist in the database!");
  4064. return 1;
  4065. }
  4066. }
  4067. return 1;
  4068. }
  4069. CMD:aweapons(PARAMS)
  4070. {
  4071. LoginCheck(playerid);
  4072. LevelCheck(playerid, 2);
  4073.  
  4074. GivePlayerWeapon(playerid, 24, 99999);
  4075. GivePlayerWeapon(playerid, 26, 99999);
  4076. GivePlayerWeapon(playerid, 29, 99999);
  4077. GivePlayerWeapon(playerid, 31, 99999);
  4078. GivePlayerWeapon(playerid, 33, 99999);
  4079. GivePlayerWeapon(playerid, 38, 99999);
  4080. GivePlayerWeapon(playerid, 9, 1);
  4081. SendClientMessage(playerid, Color:GREY, ""ORAN"*"GREY" Admin weapons received!");
  4082. return 1;
  4083. }
  4084. CMD:car(PARAMS)
  4085. {
  4086. LoginCheck(playerid);
  4087. LevelCheck(playerid, 1);
  4088.  
  4089. new Car[30], Color[2];
  4090. 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)");
  4091. else
  4092. {
  4093. if(IsPlayerInAnyVehicle(playerid)) return SendError(playerid, "You are already in a vehicle!");
  4094.  
  4095. new CarModel;
  4096. if(IsNumeric(Car)) CarModel = strval(Car);
  4097. else CarModel = GetVModelFromName(Car);
  4098.  
  4099. if(CarModel < 400 || CarModel > 611) return SendError(playerid, "Invalid vehicle model/name!");
  4100.  
  4101. if(Color[0] == -1) Color[0] = random(250);
  4102. if(Color[1] == -1) Color[1] = random(250);
  4103.  
  4104. new Float: Pos[4];
  4105. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  4106. GetPlayerFacingAngle(playerid, Pos[3]);
  4107. CreateVehicleEx(playerid, CarModel, Pos[0], Pos[1], Pos[2], Pos[3], Color[0], Color[1], 900000);
  4108.  
  4109. FormatMSG(playerid, Color:GREY, "You spawned "ORAN"%s"GREY" ("ORAN"Model: %d"GREY").", GetVehicleName(CarModel), CarModel);
  4110. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" spawned a "ORAN"%s"GREY" ("ORAN"Model: %d"GREY").", Name(playerid), playerid, GetVehicleName(CarModel), CarModel);
  4111. }
  4112. return 1;
  4113. }
  4114. CMD:givecar(PARAMS)
  4115. {
  4116. LoginCheck(playerid);
  4117. LevelCheck(playerid, 3);
  4118.  
  4119. new Player, Car[30];
  4120. 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!");
  4121. else
  4122. {
  4123. if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
  4124. if(Player == playerid) return SendError(playerid, "Player entered is you! You can use "ORAN"/car"GREY" instead!");
  4125. if(IsPlayerInAnyVehicle(Player)) return SendError(playerid, "Player is already driving a vehicle!");
  4126.  
  4127. CheckImune(playerid, Player);
  4128.  
  4129. new CarModel;
  4130. if(IsNumeric(Car)) CarModel = strval(Car);
  4131. else CarModel = GetVModelFromName(Car);
  4132.  
  4133. if(CarModel < 400 || CarModel > 611) return SendError(playerid, "Invalid vehicle model/name!");
  4134. new Float: Pos[4];
  4135.  
  4136. GetPlayerPos(Player, Pos[0], Pos[1], Pos[2]);
  4137. GetPlayerFacingAngle(Player, Pos[3]);
  4138. CreateVehicleEx(Player, CarModel, Pos[0], Pos[1], Pos[2], Pos[3], random(250), random(250), 900000);
  4139.  
  4140. FormatMSG(playerid, Color:GREY, "You gave "ORAN"%s[%i] "GREY"an"ORAN" %s"GREY" ("ORAN"Model: %d"GREY").", Name(Player), Player, GetVehicleName(CarModel), CarModel);
  4141. 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);
  4142. }
  4143. return 1;
  4144. }
  4145. CMD:giveallweapon(PARAMS)
  4146. {
  4147. LoginCheck(playerid);
  4148. LevelCheck(playerid, 4);
  4149.  
  4150. new Weapon[10], Ammo;
  4151. 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!");
  4152. else
  4153. {
  4154. if(Ammo <= 0) return SendError(playerid, "Invalid ammo entered!");
  4155.  
  4156.  
  4157. new WeaponID;
  4158. if(IsNumeric(Weapon)) WeaponID = strval(Weapon);
  4159. else WeaponID = GetWeaponIDFromName(Weapon);
  4160.  
  4161. if(!IsValidWeapon(WeaponID))
  4162. return SendError(playerid, "Invalid weapon id/name inserted!");
  4163.  
  4164. new WeaponName[30];
  4165.  
  4166.  
  4167. GetWeaponName(WeaponID, WeaponName, 30);
  4168. foreach(Player, i)
  4169. {
  4170. if(P_DATA[i][Level] != 5)GivePlayerWeapon(i, WeaponID, Ammo);GameTextForPlayer(i, "~w~Weapon received!",3000,1);
  4171. 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);
  4172. }
  4173. FormatMSG(playerid, Color:GREY, "You gave everyone a "ORAN"%s(WID:%d)"GREY" with "ORAN"%d"GREY" ammo", WeaponName, WeaponID, Ammo);
  4174. }
  4175. return 1;
  4176. }
  4177. CMD:giveweapon(PARAMS)
  4178. {
  4179. LoginCheck(playerid);
  4180. LevelCheck(playerid, 3);
  4181.  
  4182. new Player, Weapon[10], Ammo;
  4183. 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!");
  4184. else
  4185. {
  4186. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  4187. if(Ammo <= 0) return SendError(playerid, "Invalid ammo entered!");
  4188. CheckImune(playerid, Player);
  4189.  
  4190. new WeaponID;
  4191. if(IsNumeric(Weapon)) WeaponID = strval(Weapon);
  4192. else WeaponID = GetWeaponIDFromName(Weapon);
  4193.  
  4194. if(!IsValidWeapon(WeaponID))
  4195. return SendError(playerid, "Invalid weapon id/name inserted!");
  4196.  
  4197. new WeaponName[30];
  4198. GetWeaponName(WeaponID, WeaponName, 30);
  4199. GivePlayerWeapon(Player, WeaponID, Ammo);
  4200.  
  4201. if(Player == playerid)
  4202. {
  4203. 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);
  4204. FormatMSG(playerid, Color:GREY, "You gave yourself a "ORAN"%s(WID:%d)"GREY" with "ORAN"%d"GREY" ammo", WeaponName, WeaponID, Ammo);
  4205. }
  4206. else
  4207. {
  4208. 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);
  4209. 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);
  4210. 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);
  4211. }
  4212. GameTextForPlayer(Player, "~w~Weapon received!",3000,1);
  4213. }
  4214. return 1;
  4215. }
  4216.  
  4217. CMD:gotopos(PARAMS)
  4218. {
  4219. LoginCheck(playerid);
  4220. LevelCheck(playerid, 1);
  4221.  
  4222. new Float: Pos[3];
  4223. 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!");
  4224. else
  4225. {
  4226. if(IsPlayerInAnyVehicle(playerid))SetVehiclePos(GetPlayerVehicleID(playerid), Pos[0], Pos[1], Pos[2]);
  4227. else SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  4228.  
  4229. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" teleported to coords: "ORAN"%.1f %.1f %.1f", Name(playerid), playerid, Pos[0], Pos[1], Pos[2]);
  4230. FormatMSG(playerid, Color:GREY, "You teleported to coords: "ORAN"%.1f %.1f %.1f", Pos[0], Pos[1], Pos[2]);
  4231. }
  4232. return 1;
  4233. }
  4234.  
  4235. CMD:akill(PARAMS)
  4236. {
  4237. LoginCheck(playerid);
  4238. LevelCheck(playerid, 3);
  4239.  
  4240. new Player;
  4241. if(sscanf(params, "u", Player)) return SendUsage(playerid, "/akill "GREY"<id>", "Will kill the specified player");
  4242. else
  4243. {
  4244. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  4245. if(Player == playerid ) return SendError(playerid, "Player entered is you!");
  4246. CheckImune(playerid, Player);
  4247.  
  4248. SetPlayerHealth(Player, 0.0);
  4249.  
  4250. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" killed "ORAN"%s[%i]", Name(playerid), playerid, Name(Player), Player);
  4251. FormatMSG(playerid, Color:GREY, "You killed "ORAN"%s[%i]", Name(Player), Player);
  4252. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" killed you!", Name(playerid), playerid);
  4253. }
  4254. return 1;
  4255. }
  4256.  
  4257. CMD:spawn(PARAMS)
  4258. {
  4259. LoginCheck(playerid);
  4260. LevelCheck(playerid, 1);
  4261.  
  4262. new Player;
  4263. if(sscanf(params, "u", Player)) return SendUsage(playerid, "/spawn "GREY"<id>", "It will spawn the player on the server's spawn points!");
  4264. else
  4265. {
  4266. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  4267. if(Player == playerid ) return SendError(playerid, "Player entered is you!");
  4268. CheckImune(playerid, Player);
  4269.  
  4270. SpawnPlayer(Player);
  4271.  
  4272. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" spawned "ORAN"%s[%i]", Name(playerid), playerid, Name(Player), Player);
  4273. FormatMSG(playerid, Color:GREY, "You spawned "ORAN"%s[%i]", Name(Player), Player);
  4274. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" spawned you!", Name(playerid), playerid);
  4275. }
  4276. return 1;
  4277. }
  4278. CMD:explodeall(PARAMS)
  4279. {
  4280. LoginCheck(playerid);
  4281. LevelCheck(playerid, 4);
  4282.  
  4283. new
  4284. Float:_P[3];
  4285. foreach(Player, i)
  4286. {
  4287. if(P_DATA[i][Level] != 5)
  4288. {
  4289. if(i != playerid)
  4290. {
  4291. GetPlayerPos(i,_P[0], _P[1], _P[2]);CreateExplosion(_P[0], _P[1], _P[2], 7, 10.0);
  4292. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" exploded you and everyone else!", Name(playerid), playerid);
  4293. }
  4294. }
  4295. }
  4296. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" exploded everyone!", Name(playerid), playerid);
  4297. FormatMSG(playerid, Color:GREY, "You exploded everyone!",0);
  4298.  
  4299. return 1;
  4300. }
  4301.  
  4302. CMD:disarmall(PARAMS)
  4303. {
  4304. LoginCheck(playerid);
  4305. LevelCheck(playerid, 4);
  4306.  
  4307. foreach(Player, i)
  4308. {
  4309. if(P_DATA[i][Level] != 5)
  4310. {
  4311. if(i != playerid)
  4312. {
  4313. ResetPlayerWeapons(i);
  4314. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" disarmed you and everyone else!", Name(playerid), playerid);
  4315. }
  4316. }
  4317. }
  4318. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" disarmed everyone!", Name(playerid), playerid);
  4319. FormatMSG(playerid, Color:GREY, "You disarmed everyone!",0);
  4320.  
  4321. return 1;
  4322. }
  4323. CMD:disarm(PARAMS)
  4324. {
  4325. LoginCheck(playerid);
  4326. LevelCheck(playerid, 2);
  4327.  
  4328. new Player;
  4329. if(sscanf(params, "u", Player)) return SendUsage(playerid, "/disarm "GREY"<id>", "Will remove all player's weapons.");
  4330. else
  4331. {
  4332. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  4333. if(Player == playerid ) return SendError(playerid, "Player entered is you!");
  4334. CheckImune(playerid, Player);
  4335. ResetPlayerWeapons(Player);
  4336.  
  4337. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" removed "ORAN"%s[%i]"GREY"'s weapons!", Name(playerid), playerid, Name(Player), Player);
  4338. FormatMSG(playerid, Color:GREY, "You disarmed "ORAN"%s[%i]", Name(Player), Player);
  4339. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" disarmed you!", Name(playerid), playerid);
  4340. }
  4341. return 1;
  4342. }
  4343. CMD:setstats(PARAMS)
  4344. {
  4345. LoginCheck(playerid);
  4346. LevelCheck(playerid, 5);
  4347.  
  4348. new Player;
  4349. if(sscanf(params, "u", Player))
  4350. {
  4351. SetPVarInt(playerid, "StatsOf", playerid);
  4352. ShowPlayerDialog(playerid, Dialog:SetStatsSure, BOX, "{FFFFFF}Information:", ""GREY"You are on your way to edit your stats!\n"W"Proceed?", "Yes", "Exit");
  4353. return SendUsage(playerid, "/setstats "GREY"<id>", "Will open a dialog where you can set player's stats to the desired ones!");
  4354. }
  4355. else
  4356. {
  4357. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  4358. if(Player == playerid ) SetPVarInt(playerid, "StatsOf", playerid),
  4359. ShowPlayerDialog(playerid, Dialog:SetStatsSure, BOX, "{FFFFFF}Information:", ""GREY"You are on your way to edit your stats!\n"W"Proceed?", "Yes", "Exit");
  4360. else
  4361. {
  4362. new zStr[160];
  4363. format(zStr, 160, ""GREY"You are on your way to edit "ORAN"%s"GREY"'s stats!\n"W"Proceed?", Name(Player));
  4364. ShowPlayerDialog(playerid, Dialog:SetStatsSure, BOX, "{FFFFFF}Information:", zStr, "Yes", "Exit");
  4365. SetPVarInt(playerid, "StatsOf", Player);
  4366. }
  4367. }
  4368. return 1;
  4369. }
  4370. CMD:getip(PARAMS)
  4371. {
  4372. LoginCheck(playerid);
  4373. LevelCheck(playerid, 1);
  4374.  
  4375. new Player;
  4376. if(sscanf(params, "u", Player)) return SendUsage(playerid, "/getip "GREY"<id>", "Will get the IP of the specified player!");
  4377. else
  4378. {
  4379. CheckImune(playerid, Player);
  4380. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  4381. if(Player == playerid )
  4382. {
  4383. FormatMSG(playerid, Color:GREY, "Your IP is: "ORAN"%s"GREY" !", GetPlayerIPEx(playerid));
  4384. return 1;
  4385. }
  4386. else
  4387. {
  4388. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" used command "ORAN"\"/getip\""GREY" on "ORAN"%s[%i]"GREY"", Name(playerid), playerid, Name(Player), Player);
  4389. FormatMSG(playerid, Color:GREY, "Player: "ORAN"%s[%i]"GREY" IP: "ORAN"\"%s\"", Name(Player), Player, GetPlayerIPEx(Player));
  4390. }
  4391. }
  4392. return 1;
  4393. }
  4394.  
  4395. CMD:bankrupt(PARAMS)
  4396. {
  4397. LoginCheck(playerid);
  4398. LevelCheck(playerid, 2);
  4399.  
  4400. new Player;
  4401. if(sscanf(params, "u", Player)) return SendUsage(playerid, "/bankrupt "GREY"<id>", "Will remove player's cash!");
  4402. else
  4403. {
  4404. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  4405. if(Player == playerid ) return SendError(playerid, "Player entered is you!");
  4406. CheckImune(playerid, Player);
  4407.  
  4408. ResetPlayerMoney(Player);
  4409.  
  4410. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" removed "ORAN"%s[%i]"GREY"'s cash!", Name(playerid), playerid, Name(Player), Player);
  4411. FormatMSG(playerid, Color:GREY, "You removed"ORAN"%s[%i]"GREY"'s cash!", Name(Player), Player);
  4412. }
  4413. return 1;
  4414. }
  4415.  
  4416. CMD:get(PARAMS)
  4417. {
  4418. LoginCheck(playerid);
  4419. LevelCheck(playerid, 3);
  4420.  
  4421. new Player;
  4422. if(sscanf(params, "u", Player)) return SendUsage(playerid, "/get "GREY"<id>", "Will teleport the specified player to your position");
  4423. else
  4424. {
  4425. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  4426. if(Player == playerid ) return SendError(playerid, "Player entered is you!");
  4427. CheckImune(playerid, Player);{}
  4428.  
  4429. new Float: Pos[4];
  4430.  
  4431. if(IsPlayerInAnyVehicle(Player))
  4432. {
  4433. LinkVehicleToInterior(GetPlayerVehicleID(Player), GetPlayerInterior(playerid));
  4434. SetVehicleVirtualWorld(GetPlayerVehicleID(Player), GetPlayerVirtualWorld(playerid));
  4435.  
  4436. SetVehiclePos(GetPlayerVehicleID(Player), Pos[0] + 2, Pos[1] + 2, Pos[2] + 1);
  4437. SetVehicleZAngle(GetPlayerVehicleID(Player), Pos[3]);
  4438. }
  4439. else
  4440. {
  4441. GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  4442. GetPlayerFacingAngle(playerid, Pos[3]);
  4443.  
  4444. SetPlayerPos(Player, Pos[0], Pos[1] + 2, Pos[2] + 0.5);
  4445. SetPlayerFacingAngle(Player, Pos[3]);
  4446. }
  4447. SetPlayerVirtualWorld(Player, GetPlayerVirtualWorld(playerid));
  4448. SetPlayerInterior(Player, GetPlayerInterior(playerid));
  4449. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" teleported "ORAN"%s[%i]"GREY" to his location!", Name(playerid), playerid, Name(Player), Player);
  4450. FormatMSG(playerid, Color:GREY, "You teleported to "ORAN"%s[%i]"GREY" to your location!", Name(Player), Player);
  4451. }
  4452. return 1;
  4453. }
  4454.  
  4455. CMD:tplayer(PARAMS)
  4456. {
  4457. LoginCheck(playerid);
  4458. LevelCheck(playerid, 2);
  4459.  
  4460. new Player, Player2;
  4461. if(sscanf(params, "uu", Player)) return SendUsage(playerid, "/tplayer "GREY"<id1> <id2>", "Will teleport a player to another player");
  4462. else
  4463. {
  4464. if(Player == (0xFFFF)) return SendError(playerid, "Player1 not connected!");
  4465. if(Player2 == (0xFFFF)) return SendError(playerid, "Player2 not connected!");
  4466. if(Player == playerid ) return SendError(playerid, "Player1 entered is you!");
  4467. if(Player2 == playerid ) return SendError(playerid, "Player2 entered is you!");
  4468.  
  4469. if(P_DATA[playerid][Level] < P_DATA[Player][Level])
  4470. return SendError(playerid, "You are not allowed to use this command on this admin!");
  4471.  
  4472. if(P_DATA[playerid][Level] < P_DATA[Player2][Level])
  4473. return SendError(playerid, "You are not allowed to use this command on this admin!");
  4474.  
  4475. new Float: Pos[4];
  4476.  
  4477. GetPlayerPos(Player2, Pos[0], Pos[1], Pos[2]);
  4478. GetPlayerFacingAngle(Player2, Pos[3]);
  4479. if(IsPlayerInAnyVehicle(Player))
  4480. {
  4481. LinkVehicleToInterior(GetPlayerVehicleID(Player), GetPlayerInterior(Player2));
  4482. SetVehicleVirtualWorld(GetPlayerVehicleID(Player), GetPlayerVirtualWorld(Player2));
  4483.  
  4484. SetVehiclePos(GetPlayerVehicleID(Player), Pos[0] + 2, Pos[1] + 2, Pos[2] + 1);
  4485. SetVehicleZAngle(GetPlayerVehicleID(Player), Pos[3]);
  4486. }
  4487. else
  4488. {
  4489. SetPlayerPos(Player, Pos[0], Pos[1] + 2, Pos[2] + 0.5);
  4490. SetPlayerFacingAngle(Player, Pos[3]);
  4491. }
  4492.  
  4493. SetPlayerVirtualWorld(Player, GetPlayerVirtualWorld(Player2));
  4494. SetPlayerInterior(Player, GetPlayerInterior(Player2));
  4495.  
  4496. 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);
  4497. FormatMSG(playerid, Color:GREY, "You teleported "ORAN"%s[%i]"GREY" to "ORAN"%s[%i]", Name(Player), Player ,Name(Player2), Player2);
  4498.  
  4499. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" teleported you to "ORAN"%s[%i]"GREY"", Name(playerid), playerid ,Name(Player2), Player2);
  4500. FormatMSG(Player2, Color:GREY, "Admin "ORAN"%s[%i]"GREY" teleported "ORAN"%s[%i]"GREY" to your position", Name(playerid), playerid ,Name(Player), Player);
  4501. }
  4502. return 1;
  4503. }
  4504.  
  4505. CMD:goto(PARAMS)
  4506. {
  4507. LoginCheck(playerid);
  4508. LevelCheck(playerid, 1);
  4509.  
  4510. new Player;
  4511. if(sscanf(params, "u", Player)) return SendUsage(playerid, "/goto "GREY"<id>", "Will teleport you to the specified player");
  4512. else
  4513. {
  4514. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  4515. if(Player == playerid ) return SendError(playerid, "Player entered is you!");
  4516. CheckImune(playerid, Player);
  4517.  
  4518. new Float: Pos[4];
  4519.  
  4520. GetPlayerPos(Player, Pos[0], Pos[1], Pos[2]);
  4521. GetPlayerFacingAngle(Player, Pos[3]);
  4522.  
  4523. if(IsPlayerInAnyVehicle(playerid))
  4524. {
  4525. LinkVehicleToInterior(GetPlayerVehicleID(playerid), GetPlayerInterior(Player));
  4526. SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), GetPlayerVirtualWorld(Player));
  4527.  
  4528. SetVehiclePos(GetPlayerVehicleID(playerid), Pos[0] + 2, Pos[1] + 2, Pos[2] + 1);
  4529. SetVehicleZAngle(GetPlayerVehicleID(playerid), Pos[3]);
  4530. }
  4531. else
  4532. {
  4533. SetPlayerPos(playerid, Pos[0], Pos[1] + 2, Pos[2] + 0.5);
  4534. SetPlayerFacingAngle(playerid, Pos[3]);
  4535. }
  4536. SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(Player));
  4537. SetPlayerInterior(playerid, GetPlayerInterior(Player));
  4538. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" teleported to "ORAN"%s[%i]", Name(playerid), playerid, Name(Player), Player);
  4539. FormatMSG(playerid, Color:GREY, "You teleported to "ORAN"%s[%i]", Name(Player), Player);
  4540. }
  4541. return 1;
  4542. }
  4543.  
  4544.  
  4545. CMD:write(PARAMS)
  4546. {
  4547. LoginCheck(playerid);
  4548. LevelCheck(playerid, 3);
  4549.  
  4550. new Message[129];
  4551. if(sscanf(params, "s[129]", Message)) return SendUsage(playerid, "/write "GREY"[message]", "Will send a message in the chat with grey color");
  4552. else
  4553. {
  4554. SendClientMessageToAll(Color:GREY, Message);
  4555. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" sent a message to the server.", Name(playerid), playerid);
  4556. GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~g~~h~Message sent!", 3000, 3);
  4557. }
  4558. return 1;
  4559. }
  4560. CMD:giveallcash(PARAMS)
  4561. {
  4562. LoginCheck(playerid);
  4563. LevelCheck(playerid, 4);
  4564.  
  4565. new Cash;
  4566. 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")");
  4567. else
  4568. {
  4569. foreach(Player, i)
  4570. {
  4571. if(P_DATA[i][Level] != 5)GivePlayerMoney(i, Cash);
  4572. if(Cash > 0)
  4573. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave everyone "ORAN"$%d"GREY" cash!", Name(playerid), playerid, Cash);
  4574. else FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" removed "ORAN"$%d"GREY" cash from everyone!", Name(playerid), playerid, Cash);
  4575. }
  4576. }
  4577. return 1;
  4578. }
  4579. CMD:setallcash(PARAMS)
  4580. {
  4581. LoginCheck(playerid);
  4582. LevelCheck(playerid, 4);
  4583.  
  4584. new Cash;
  4585. if(sscanf(params, "i", Cash)) return SendUsage(playerid, "/setallcash "GREY"<cash>", "Will set everyone's cash to the amount set");
  4586. else
  4587. {
  4588. foreach(Player, i)
  4589. {
  4590. if(P_DATA[i][Level] != 5)
  4591. {
  4592. ResetPlayerMoney(i);
  4593. GivePlayerMoney(i, Cash);
  4594. }
  4595. if(Cash > 0)
  4596. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's cash to "ORAN"%d", Name(playerid), playerid, Cash);
  4597. else FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" removed everyone's cash!", Name(playerid), playerid);
  4598. }
  4599. }
  4600. return 1;
  4601. }
  4602. CMD:giveallarmour(PARAMS)
  4603. {
  4604. LoginCheck(playerid);
  4605. LevelCheck(playerid, 4);
  4606.  
  4607. new Armour;
  4608. if(sscanf(params, "i", Armour)) return SendUsage(playerid, "/giveallarmour "GREY"<armour>", "Will give everyone armour("GREY"Negative numbers are not allowed! "W")");
  4609. else
  4610. {
  4611. if(Armour < 1) return SendUsage(playerid, "/giveallarmour "GREY"<armour>", "Will give everyone armour("GREY"Negative numbers are not allowed! "W")");
  4612. foreach(Player, i)
  4613. {
  4614. if(P_DATA[i][Level] != 5)
  4615. {
  4616. new Float:a;
  4617. GetPlayerArmour(i, a);
  4618. SetPlayerArmour(i, a + Armour);
  4619. }
  4620. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave everyone "ORAN"%d"GREY" armour!", Name(playerid), playerid, Armour);
  4621. }
  4622. }
  4623. return 1;
  4624. }
  4625. CMD:setallarmour(PARAMS)
  4626. {
  4627. LoginCheck(playerid);
  4628. LevelCheck(playerid, 4);
  4629.  
  4630. new Armour;
  4631. if(sscanf(params, "i", Armour)) return SendUsage(playerid, "/setallarmour "GREY"<armour>", "Will set everyone's armour");
  4632. else
  4633. {
  4634. foreach(Player, i)
  4635. {
  4636. if(P_DATA[i][Level] != 5)
  4637. {
  4638. SetPlayerArmour(i, Armour);
  4639. }
  4640. if(Armour > 0)
  4641. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's Armour to "ORAN"%d", Name(playerid), playerid, Armour);
  4642. else FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" removed everyone's armour!", Name(playerid), playerid);
  4643. }
  4644. }
  4645. return 1;
  4646. }
  4647. CMD:giveallh(PARAMS)
  4648. {
  4649. LoginCheck(playerid);
  4650. LevelCheck(playerid, 4);
  4651.  
  4652. new Health;
  4653. if(sscanf(params, "i", Health)) return SendUsage(playerid, "/giveallh "GREY"<health>", "Will give everyone health("GREY"Negative numbers are not allowed! "W")");
  4654. else
  4655. {
  4656. if(Health < 1) return SendUsage(playerid, "/ah "GREY"<health>", "Will give everyone health("GREY"Negative numbers are not allowed! "W")");
  4657. foreach(Player, i)
  4658. {
  4659. if(P_DATA[i][Level] != 5)
  4660. {
  4661. new Float:he;
  4662. GetPlayerHealth(i, he),
  4663. SetPlayerHealth(i, he + Health);
  4664. }
  4665. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave everyone "ORAN"%d"GREY" health!", Name(playerid), playerid, Health);
  4666. }
  4667. }
  4668. return 1;
  4669. }
  4670. CMD:setallhealth(PARAMS)
  4671. {
  4672. LoginCheck(playerid);
  4673. LevelCheck(playerid, 4);
  4674.  
  4675. new Health;
  4676. if(sscanf(params, "i", Health)) return SendUsage(playerid, "/setallhealth "GREY"<health>", "Will set everyone's health");
  4677. else
  4678. {
  4679. foreach(Player, i)
  4680. {
  4681. if(P_DATA[i][Level] != 5)
  4682. {
  4683. SetPlayerHealth(i, Health);
  4684. }
  4685. if(Health > 0)
  4686. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's health to "ORAN"%d", Name(playerid), playerid, Health);
  4687. else FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" killed everyone!", Name(playerid), playerid);
  4688. }
  4689. }
  4690. return 1;
  4691. }
  4692.  
  4693. CMD:setalldrunk(PARAMS)
  4694. {
  4695. LoginCheck(playerid);
  4696. LevelCheck(playerid, 4);
  4697.  
  4698. new Drunk;
  4699. if(sscanf(params, "i", Drunk)) return SendUsage(playerid, "/setalldrunk "GREY"<level>", "Will make players get drunk! Use "ORAN"0"W" to remove drunkenness");
  4700. else
  4701. {
  4702. foreach(Player, i)
  4703. {
  4704. if(P_DATA[i][Level] != 5)
  4705. {
  4706. if(Drunk != 0) SetPlayerDrunkLevel(i, 9999 + Drunk);
  4707. else SetPlayerDrunkLevel(i, 0);
  4708. }
  4709. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's drunk level to "ORAN"%d", Name(playerid), playerid, Drunk);
  4710. }
  4711. }
  4712. return 1;
  4713. }
  4714.  
  4715. CMD:setallint(PARAMS)
  4716. {
  4717. LoginCheck(playerid);
  4718. LevelCheck(playerid, 4);
  4719.  
  4720. new Interior;
  4721. if(sscanf(params, "i", Interior)) return SendUsage(playerid, "/setallint "GREY"<interior>", "Will set everyone's interior id to the sapecified interior");
  4722. else
  4723. {
  4724. foreach(Player, i)
  4725. {
  4726. if(P_DATA[i][Level] != 5)
  4727. {
  4728. SetPlayerInterior(i, Interior);
  4729. }
  4730. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's interior to "ORAN"%d", Name(playerid), playerid, Interior);
  4731. }
  4732. }
  4733. return 1;
  4734. }
  4735.  
  4736. CMD:setallworld(PARAMS)
  4737. {
  4738. LoginCheck(playerid);
  4739. LevelCheck(playerid, 4);
  4740.  
  4741. new World;
  4742. if(sscanf(params, "i", World)) return SendUsage(playerid, "/setallworld "GREY"<world>", "Will set everyone's Virtual World to the specified world");
  4743. else
  4744. {
  4745. foreach(Player, i)
  4746. {
  4747. if(P_DATA[i][Level] != 5)
  4748. {
  4749. SetPlayerVirtualWorld(i, World);
  4750. }
  4751. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's virtual world to "ORAN"%d", Name(playerid), playerid, World);
  4752. }
  4753. }
  4754. return 1;
  4755. }
  4756. CMD:giveallscore(PARAMS)
  4757. {
  4758. LoginCheck(playerid);
  4759. LevelCheck(playerid, 4);
  4760.  
  4761. new zScore;
  4762. 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")");
  4763. else
  4764. {
  4765. foreach(Player, i)
  4766. {
  4767. if(P_DATA[i][Level] != 5)SetPlayerScore(i, (zScore) ? (GetPlayerScore(i) + zScore) : (GetPlayerScore(i) - zScore));
  4768. if(zScore > 0)
  4769. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave everyone "ORAN"%d"GREY" score!", Name(playerid), playerid, zScore);
  4770. else FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" removed "ORAN"%d"GREY" score from everyone!", Name(playerid), playerid, zScore);
  4771. }
  4772. }
  4773. return 1;
  4774. }
  4775. CMD:setallscore(PARAMS)
  4776. {
  4777. LoginCheck(playerid);
  4778. LevelCheck(playerid, 4);
  4779.  
  4780. new aScore;
  4781. if(sscanf(params, "i", aScore)) return SendUsage(playerid, "/setallscore "GREY"<score>", "Will set everyone's score to the specified score");
  4782. else
  4783. {
  4784. foreach(Player, i)
  4785. {
  4786. if(P_DATA[i][Level] != 5)
  4787. {
  4788. SetPlayerScore(i, aScore);
  4789. }
  4790. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's score to "ORAN"%d", Name(playerid), playerid, aScore);
  4791. }
  4792. }
  4793. return 1;
  4794. }
  4795. CMD:giveallwanted(PARAMS)
  4796. {
  4797. LoginCheck(playerid);
  4798. LevelCheck(playerid, 4);
  4799.  
  4800. new Wanted;
  4801. 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")");
  4802. else
  4803. {
  4804. foreach(Player, i)
  4805. {
  4806. if(P_DATA[i][Level] != 5)
  4807. {
  4808. if(GetPlayerWantedLevel(i) >= 0)
  4809. {
  4810. SetPlayerWantedLevel(i, (Wanted) ? (GetPlayerWantedLevel(i) + Wanted) : (GetPlayerWantedLevel(i) - Wanted));
  4811. if(GetPlayerWantedLevel(i) < 0) SetPlayerWantedLevel(i, 0);
  4812. }
  4813. }
  4814. if(Wanted > 0) FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave everyone "ORAN"%d"GREY" wanted stars!", Name(playerid), playerid, Wanted);
  4815. else FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" removed "ORAN"%d"GREY" wanted stars from everyone!", Name(playerid), playerid, Wanted);
  4816. }
  4817. }
  4818. return 1;
  4819. }
  4820. CMD:giveallcookies(PARAMS)
  4821. {
  4822. LoginCheck(playerid);
  4823. LevelCheck(playerid, 4);
  4824.  
  4825. new Cookiz;
  4826. 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")");
  4827. else
  4828. {
  4829. new String[10];
  4830. if(Cookiz < 0)
  4831. {
  4832. format(String, sizeof String, "%d", Cookiz);
  4833. strdel(String, 0, 1);
  4834. }
  4835. foreach(Player, i)
  4836. {
  4837. if(P_DATA[i][Level] != 5)
  4838. {
  4839. if(Cookiz < 0)P_DATA[i][Cookies] -= strval(String);
  4840. else P_DATA[i][Cookies] += Cookiz;
  4841.  
  4842.  
  4843. if(P_DATA[i][Cookies] < 0) P_DATA[i][Cookies] = 0;
  4844. }
  4845. if(Cookiz > 0) FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave everyone "ORAN"%d"GREY" cookies!", Name(playerid), playerid, Cookiz);
  4846. else FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" removed "ORAN"%d"GREY" cookies from everyone!", Name(playerid), playerid, Cookiz);
  4847. }
  4848. }
  4849. return 1;
  4850. }
  4851.  
  4852. CMD:setrespect(PARAMS)
  4853. {
  4854. LoginCheck(playerid);
  4855. LevelCheck(playerid, 3);
  4856.  
  4857. new Player, rType[2],Respect;
  4858. if(sscanf(params, "us[2]i", Player, rType, Respect)) return SendUsage(playerid, "/setrespect "GREY"<id> <-/+> <respect>", "Will change player's negative/positive respect!");
  4859. else
  4860. {
  4861. if(Respect < 0) return SendUsage(playerid, "/setrespect "GREY"<id> <-/+> <respect>", "Will change player's negative/positive respect!");
  4862. if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
  4863. CheckImune(playerid, Player);
  4864.  
  4865. if(!strcmp(rType, "+", false)) SetPVarInt(Player, "0_Positive", Respect);
  4866. else if(!strcmp(rType, "-", false))SetPVarInt(Player, "0_Negative", Respect);
  4867. else return SendError(playerid, "The first parameter must contain either '+' or '-' without '. (+ Positive respect | - Negative respect)");
  4868.  
  4869. if(playerid != Player)
  4870. {
  4871. 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);
  4872. 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);
  4873. 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);
  4874. }
  4875. else
  4876. {
  4877. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed his %s respect to "ORAN"%d!", Name(playerid), playerid, (strcmp(rType, "+", false)) ? ("Positive") : ("Negative"), Respect);
  4878. FormatMSG(playerid, Color:GREY,"You set your %s respect to "ORAN"%d", (strcmp(rType, "+", false)) ? ("Positive") : ("Negative"), Respect);
  4879. }
  4880. #if UPDATE_TOP_ALWAYS == true
  4881. new
  4882. Query[256],
  4883. DBResult: R1;
  4884.  
  4885. format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(Player));
  4886. R1 = DB::Query(_DB, Query);
  4887.  
  4888. if(R1)
  4889. {
  4890. if(DB::Valid(R1))
  4891. {
  4892. DB::Free(R1);
  4893. format(Query, sizeof(Query), "UPDATE `Top` SET `%s` = '%d' WHERE `Name` = '%s'", (!strcmp(rType, "+", false)) ? ("Positive") : ("Negative"), Respect, Name(Player));
  4894. DB::Query(_DB, Query);
  4895. }
  4896. else
  4897. {
  4898. DB::Free(R1);
  4899. format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`, `%s`) VALUES('%s','%d')", (!strcmp(rType, "+", false)) ? ("Positive") : ("Negative"), Name(Player), Respect);
  4900. DB::Query(_DB, Query);
  4901. }
  4902. }
  4903. #endif
  4904. }
  4905. return 1;
  4906. }
  4907. CMD:giveallrespect(PARAMS)
  4908. {
  4909. LoginCheck(playerid);
  4910. LevelCheck(playerid, 4);
  4911.  
  4912. new rType[2],Respect;
  4913. 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)");
  4914. else
  4915. {
  4916. if(Respect < 0) return SendUsage(playerid, "/giveallrespect "GREY"<-/+> <respect>", "Will give everyone respect(Either negative respect that even positive respect)");
  4917. if(!strcmp(rType, "+", false))
  4918. {
  4919. foreach(Player, i)
  4920. {
  4921. if(P_DATA[i][Level] != 5)
  4922. {
  4923. SetPVarInt(i, "0_Positive", GetPVarInt(i, "0_Positive") + Respect);
  4924. #if UPDATE_TOP_ALWAYS == true
  4925. new
  4926. Query[256],
  4927. DBResult: R1;
  4928.  
  4929. format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(i));
  4930. R1 = DB::Query(_DB, Query);
  4931.  
  4932. if(R1)
  4933. {
  4934. if(DB::Valid(R1))
  4935. {
  4936. DB::Free(R1);
  4937. format(Query, sizeof(Query), "UPDATE `Top` SET `Positive` = '%d' WHERE `Name` = '%s'", GetPVarInt(i, "0_Positive"), Name(i));
  4938. DB::Query(_DB, Query);
  4939. }
  4940. }
  4941. #endif
  4942. }
  4943. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave everyone "ORAN"%d"GREY" positive respect!", Name(playerid), playerid, Respect);
  4944. }
  4945. }
  4946. else if(!strcmp(rType, "-", false))
  4947. {
  4948. foreach(Player, i)
  4949. {
  4950. if(P_DATA[i][Level] != 5)
  4951. {
  4952. SetPVarInt(i, "0_Negative", GetPVarInt(i, "0_Negative") + Respect);
  4953. #if UPDATE_TOP_ALWAYS == true
  4954. new
  4955. Query[256],
  4956. DBResult: R1;
  4957.  
  4958. format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(i));
  4959. R1 = DB::Query(_DB, Query);
  4960.  
  4961. if(R1)
  4962. {
  4963. if(DB::Valid(R1))
  4964. {
  4965. DB::Free(R1);
  4966. format(Query, sizeof(Query), "UPDATE `Top` SET `Negative` = '%d' WHERE `Name` = '%s'", GetPVarInt(i, "0_Negative"), Name(i));
  4967. DB::Query(_DB, Query);
  4968. }else DB::Free(R1);
  4969. }
  4970. #endif
  4971. }
  4972. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" gave everyone "ORAN"%d"GREY" negative respect!", Name(playerid), playerid, Respect);
  4973. }
  4974. }
  4975. else return SendError(playerid, "The first parameter must contain either '+' or '-' without '. (+ Positive respect | - Negative respect)");
  4976. }
  4977. return 1;
  4978. }
  4979. CMD:resetallrespect(PARAMS)
  4980. {
  4981. LoginCheck(playerid);
  4982. LevelCheck(playerid, 4);
  4983.  
  4984. new rType[2];
  4985. if(sscanf(params, "s[2]", rType)) return SendUsage(playerid, "/resetallrespect "GREY" <-/+>", "Will reset everyone's positive/negative respect!");
  4986. else
  4987. {
  4988. if(!strcmp(rType, "+", false))
  4989. {
  4990. foreach(Player, i)
  4991. {
  4992. if(P_DATA[i][Level] != 5)
  4993. {
  4994. #if UPDATE_TOP_ALWAYS == true
  4995. new
  4996. Query[256],
  4997. DBResult: R1;
  4998.  
  4999. format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(i));
  5000. R1 = DB::Query(_DB, Query);
  5001.  
  5002. if(R1)
  5003. {
  5004. if(DB::Valid(R1))
  5005. {
  5006. DB::Free(R1);
  5007. format(Query, sizeof(Query), "UPDATE `Top` SET `Positive` = '0' WHERE `Name` = '%s'", Name(i));
  5008. DB::Query(_DB, Query);
  5009. }
  5010. }
  5011. #endif
  5012. SetPVarInt(i, "0_Positive", 0);
  5013. }
  5014. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" reseted everyone's positive respect!", Name(playerid), playerid);
  5015. }
  5016. }
  5017. else if(!strcmp(rType, "-", false))
  5018. {
  5019. foreach(Player, i)
  5020. {
  5021. if(P_DATA[i][Level] != 5)
  5022. {
  5023. #if UPDATE_TOP_ALWAYS == true
  5024. new
  5025. Query[256],
  5026. DBResult: R1;
  5027.  
  5028. format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(i));
  5029. R1 = DB::Query(_DB, Query);
  5030.  
  5031. if(R1)
  5032. {
  5033. if(DB::Valid(R1))
  5034. {
  5035. DB::Free(R1);
  5036. format(Query, sizeof(Query), "UPDATE `Top` SET `Negative` = '0' WHERE `Name` = '%s'", Name(i));
  5037. DB::Query(_DB, Query);
  5038. }
  5039. }
  5040. #endif
  5041. SetPVarInt(i, "0_Negative", 0);
  5042. }
  5043. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" reseted everyone's negative respect!", Name(playerid), playerid);
  5044. }
  5045. }
  5046. }
  5047. return 1;
  5048. }
  5049. CMD:setallrespect(PARAMS)
  5050. {
  5051. LoginCheck(playerid);
  5052. LevelCheck(playerid, 4);
  5053.  
  5054. new rType[2],Respect;
  5055. 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)");
  5056. else
  5057. {
  5058. if(Respect < 0) return SendUsage(playerid, "/setallrespect "GREY"<-/+> <respect>", "Will set everyone's respect(Either negative respect that even positive respect)");
  5059. if(!strcmp(rType, "+", false))
  5060. {
  5061. foreach(Player, i)
  5062. {
  5063. if(P_DATA[i][Level] != 5)
  5064. {
  5065. #if UPDATE_TOP_ALWAYS == true
  5066. new
  5067. Query[256],
  5068. DBResult: R1;
  5069.  
  5070. format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(i));
  5071. R1 = DB::Query(_DB, Query);
  5072.  
  5073. if(R1)
  5074. {
  5075. if(DB::Valid(R1))
  5076. {
  5077. DB::Free(R1);
  5078. format(Query, sizeof(Query), "UPDATE `Top` SET `Positive` = '%d' WHERE `Name` = '%s'", Respect, Name(i));
  5079. DB::Query(_DB, Query);
  5080. }else DB::Free(R1);
  5081. }
  5082. #endif
  5083. SetPVarInt(i, "0_Positive", Respect);
  5084. }
  5085. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's positive respect to "ORAN"%d", Name(playerid), playerid, Respect);
  5086. }
  5087. }
  5088. else if(!strcmp(rType, "-", false))
  5089. {
  5090. foreach(Player, i)
  5091. {
  5092. if(P_DATA[i][Level] != 5)
  5093. {
  5094. #if UPDATE_TOP_ALWAYS == true
  5095. new
  5096. Query[256],
  5097. DBResult: R1;
  5098.  
  5099. format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(i));
  5100. R1 = DB::Query(_DB, Query);
  5101.  
  5102. if(R1)
  5103. {
  5104. if(DB::Valid(R1))
  5105. {
  5106. DB::Free(R1);
  5107. format(Query, sizeof(Query), "UPDATE `Top` SET `Negative` = '%d' WHERE `Name` = '%s'", Respect, Name(i));
  5108. DB::Query(_DB, Query);
  5109. }else DB::Free(R1);
  5110. }
  5111.  
  5112. #endif
  5113. SetPVarInt(i, "0_Negative", Respect);
  5114. }
  5115. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's negative respect to "ORAN"%d", Name(playerid), playerid, Respect);
  5116. }
  5117. }
  5118. else return SendError(playerid, "The first parameter must contain either '+' or '-' without '. (+ Positive respect | - Negative respect)");
  5119. }
  5120. return 1;
  5121. }
  5122. CMD:setallwanted(PARAMS)
  5123. {
  5124. LoginCheck(playerid);
  5125. LevelCheck(playerid, 4);
  5126.  
  5127. new Wanted;
  5128. if(sscanf(params, "i", Wanted)) return SendUsage(playerid, "/setallwanted "GREY"<level>", "Will make a player wanted of the specified level");
  5129. else
  5130. {
  5131. foreach(Player, i)
  5132. {
  5133. if(P_DATA[i][Level] != 5)
  5134. {
  5135. SetPlayerWantedLevel(i, Wanted);
  5136. }
  5137. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's wanted level to "ORAN"%d", Name(playerid), playerid, Wanted);
  5138. }
  5139. }
  5140. return 1;
  5141. }
  5142. CMD:healcar(PARAMS)
  5143. {
  5144. LoginCheck(playerid);
  5145. LevelCheck(playerid, 2);
  5146.  
  5147. new Player;
  5148. if(sscanf(params, "u", Player)) return SendUsage(playerid, "/healcar "GREY"<id>", "Will heal a player's car!");
  5149. else
  5150. {
  5151. if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
  5152. if(Player == playerid) return SendError(playerid, "You can use "ORAN"/cargod"W" if you want!");
  5153. if(!IsPlayerInAnyVehicle(Player)) return SendError(playerid, "Player is not in a vehicle!");
  5154.  
  5155. SetVehicleHealth(GetPlayerVehicleID(Player), 1200);
  5156.  
  5157. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" healed "ORAN"%s[%i]'s"GREY" vehicle!", Name(playerid), playerid, Name(Player), Player);
  5158. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" healed your vehicle!", Name(playerid), playerid);
  5159. FormatMSG(Player, Color:GREY, "You healed "ORAN"%s[%i]"GREY"'s vehicle!", Name(Player), Player);
  5160. }
  5161. return 1;
  5162. }
  5163. CMD:destroyv(PARAMS)
  5164. {
  5165. LevelCheck(playerid, 3);
  5166.  
  5167. new Player;
  5168.  
  5169. if(sscanf(params, "u", Player)) return SendUsage(playerid, "/destroyv "GREY"<id>", "Will destroy player's vehicle!");
  5170. else
  5171. {
  5172. if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
  5173. if(Player == playerid) return SendError(playerid, "Player entered is you!");
  5174. if(!IsPlayerInAnyVehicle(Player)) return SendError(playerid, "Player is not in a vehicle!");
  5175.  
  5176. P_DATA[Player][CarGod] = 0;
  5177. SetVehicleHealth(GetPlayerVehicleID(Player), 0);
  5178.  
  5179. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" destroyed "ORAN"%s[%i]'s"GREY" vehicle!", Name(playerid), playerid, Name(Player), Player);
  5180. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" destroyed your vehicle!", Name(playerid), playerid);
  5181. FormatMSG(Player, Color:GREY, "You destroyed "ORAN"%s[%i]"GREY"'s vehicle!", Name(Player), Player);
  5182. }
  5183. return 1;
  5184. }
  5185.  
  5186. CMD:setvhealth(PARAMS)
  5187. {
  5188. LoginCheck(playerid);
  5189. LevelCheck(playerid, 2);
  5190.  
  5191. new Player, vHealth;
  5192. if(sscanf(params, "ui", Player, vHealth)) return SendUsage(playerid, "/setvh "GREY"<id> <health>", "Will set player's vehicle health!");
  5193. else
  5194. {
  5195. if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
  5196. if(Player == playerid) return SendError(playerid, "Player entered is you!");
  5197. if(!IsPlayerInAnyVehicle(Player)) return SendError(playerid, "Player is not in a vehicle!");
  5198.  
  5199. SetVehicleHealth(GetPlayerVehicleID(Player), vHealth);
  5200.  
  5201. 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);
  5202. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your vehicle's health to"ORAN"%d!", Name(playerid), playerid, vHealth);
  5203. FormatMSG(Player, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s vehicle health to"ORAN"%d!", Name(Player), Player, vHealth);
  5204. }
  5205. return 1;
  5206. }
  5207. CMD:carcolor(PARAMS)
  5208. {
  5209. LoginCheck(playerid);
  5210. LevelCheck(playerid, 2);
  5211.  
  5212. new Player, vColor[2];
  5213. 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)");
  5214. {
  5215. if(Player == 0xFFFF ) return SendError(playerid, "Player not connected!");
  5216. if(Player == playerid) return SendError(playerid, "Player entered is you!");
  5217. if(!IsPlayerInAnyVehicle(Player)) return SendError(playerid, "Player is not in a vehicle!");
  5218.  
  5219. if(!vColor[0]) vColor[0] = random(255);
  5220. if(!vColor[1]) vColor[1] = random(255);
  5221.  
  5222. ChangeVehicleColor(GetPlayerVehicleID(Player), vColor[0], vColor[1]);
  5223.  
  5224. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed "ORAN"%s[%i]'s"GREY" vehicle colors", Name(playerid), playerid, Name(Player), Player);
  5225. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" changed your vehicle's colors", Name(playerid), playerid);
  5226. FormatMSG(Player, Color:GREY, "You changed "ORAN"%s[%i]"GREY"'s vehicle colors", Name(Player), Player);
  5227. }
  5228. return 1;
  5229. }
  5230.  
  5231. CMD:heal(PARAMS)
  5232. {
  5233. LoginCheck(playerid);
  5234.  
  5235. new Player;
  5236. if(sscanf(params, "u", Player))
  5237. {
  5238. if(P_DATA[playerid][Level] == 2)
  5239. {
  5240. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" healed himself!", Name(playerid), playerid);
  5241. SendClientMessage(playerid, Color:GREY, "You healed yourself!");
  5242. }
  5243. else if(P_DATA[playerid][Level] > 2)
  5244. {
  5245. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" healed himself!", Name(playerid), playerid);
  5246. SendClientMessage(playerid, Color:GREY, "You healed yourself!");
  5247. return SendUsage(playerid, "/heal"GREY" <id>", "Will heal a specified player!");
  5248. }
  5249. }
  5250. else
  5251. {
  5252. if(Player == 0xFFFF) return SendError(playerid, "Player not connected!");
  5253. SetPlayerHealth(Player, 100.0);
  5254.  
  5255. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" healed "ORAN"%s[%i]", Name(playerid), playerid, Name(Player), Player);
  5256. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" healed you!", Name(playerid), playerid);
  5257. FormatMSG(playerid, Color:GREY, "You healed player "ORAN"%s[%i]", Name(Player), Player);
  5258. }
  5259. return 1;
  5260. }
  5261.  
  5262. CMD:healall(PARAMS)
  5263. {
  5264. LoginCheck(playerid);
  5265. LevelCheck(playerid, 3);
  5266.  
  5267. foreach(Player, i)
  5268. {
  5269. if(P_DATA[i][Level] != 5)
  5270. {
  5271. SetPlayerHealth(i, 100.0);
  5272. }
  5273. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" healed everyone", Name(playerid), playerid);
  5274. }
  5275. return 1;
  5276. }
  5277. CMD:setallskin(PARAMS)
  5278. {
  5279. LoginCheck(playerid);
  5280. LevelCheck(playerid, 4);
  5281.  
  5282. new Skin;
  5283. if(sscanf(params, "i", Skin)) return SendUsage(playerid, "/setallskin "GREY"<skin>", "Will set everyone's skin to the specified ID");
  5284. else
  5285. {
  5286. if(!IsValidSkin(Skin)) return SendError(playerid, "Invalid skin ID!");
  5287.  
  5288. foreach(Player, i)
  5289. {
  5290. if(P_DATA[i][Level] != 5)
  5291. {
  5292. SetPlayerSkin(i, Skin);
  5293. }
  5294. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's skin to "ORAN"%d", Name(playerid), playerid, Skin);
  5295. }
  5296. }
  5297. return 1;
  5298. }
  5299.  
  5300. CMD:setalltime(PARAMS)
  5301. {
  5302. LoginCheck(playerid);
  5303. LevelCheck(playerid, 3);
  5304.  
  5305. new Time;
  5306. if(sscanf(params, "i", Time)) return SendUsage(playerid, "/setalltime "GREY"<hour>", "Will change everyone's in-game time");
  5307. else
  5308. {
  5309. foreach(Player, i)
  5310. {
  5311. if(P_DATA[i][Level] != 5)
  5312. {
  5313. SetPlayerTime(i, Time, 0);
  5314. }
  5315. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's time to "ORAN"%d:00", Name(playerid), playerid, Time);
  5316. }
  5317. }
  5318. return 1;
  5319. }
  5320. CMD:setallweather(PARAMS)
  5321. {
  5322. LoginCheck(playerid);
  5323. LevelCheck(playerid, 3);
  5324.  
  5325. new Weather;
  5326. if(sscanf(params, "i", Weather)) return SendUsage(playerid, "/setallweather "GREY"<weather id>", "Will change everyone's weather");
  5327. else
  5328. {
  5329. foreach(Player, i)
  5330. {
  5331. if(P_DATA[i][Level] != 5)
  5332. {
  5333. SetPlayerWeather(i, Weather);
  5334. }
  5335. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set everyone's weather to "ORAN"%d", Name(playerid), playerid, Weather);
  5336. }
  5337. }
  5338. return 1;
  5339. }
  5340.  
  5341. CMD:setdrunk(PARAMS)
  5342. {
  5343. LoginCheck(playerid);
  5344. LevelCheck(playerid, 3);
  5345.  
  5346. new Player, Drunk;
  5347. if(sscanf(params, "ui", Player, Drunk)) return SendUsage(playerid, "/setdrunk "GREY"<id> <level>", "Will set a player drunk of the specified level");
  5348. else
  5349. {
  5350. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  5351. CheckImune(playerid, Player);
  5352.  
  5353. SetPlayerDrunkLevel(Player, Drunk);
  5354.  
  5355. if(Player != playerid)
  5356. {
  5357. 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);
  5358. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s drunk level to "ORAN"%d", Name(Player), Player, Drunk);
  5359. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your drunk level to "ORAN"%d", Name(playerid), playerid, Drunk);
  5360. }
  5361. else
  5362. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set drunk level to "ORAN"%d", Name(playerid), playerid, Drunk);
  5363. }
  5364. return 1;
  5365. }
  5366. CMD:setwanted(PARAMS)
  5367. {
  5368. LoginCheck(playerid);
  5369. LevelCheck(playerid, 3);
  5370.  
  5371. new Player, Wanted;
  5372. if(sscanf(params, "ui", Player, Wanted)) return SendUsage(playerid, "/setwanted "GREY"<id> <level>", "Will set the specified player wanted of the specified level");
  5373. else
  5374. {
  5375. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  5376. CheckImune(playerid, Player);
  5377.  
  5378. SetPlayerWantedLevel(Player, Wanted);
  5379.  
  5380. if(Player != playerid)
  5381. {
  5382. 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);
  5383. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s wanted level to "ORAN"%d", Name(Player), Player, Wanted);
  5384. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your wanted level to "ORAN"%d", Name(playerid), playerid, Wanted);
  5385. }
  5386. else
  5387. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his wanted level to "ORAN"%d", Name(playerid), playerid, Wanted);
  5388. }
  5389. return 1;
  5390. }
  5391. CMD:setinterior(PARAMS)
  5392. {
  5393. LoginCheck(playerid);
  5394. LevelCheck(playerid, 3);
  5395.  
  5396. new Player, Interior;
  5397. if(sscanf(params, "ui", Player, Interior)) return SendUsage(playerid, "/setinterior "GREY"<id> <interior>", "Will set player's interior");
  5398. else
  5399. {
  5400. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  5401. CheckImune(playerid, Player);
  5402.  
  5403. SetPlayerInterior(Player, Interior);
  5404.  
  5405. if(Player != playerid)
  5406. {
  5407. 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);
  5408. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s interior to "ORAN"%d", Name(Player), Player, Interior);
  5409. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your interior to "ORAN"%d", Name(playerid), playerid, Interior);
  5410. }
  5411. else
  5412. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his interior to "ORAN"%d", Name(playerid), playerid, Interior);
  5413. }
  5414. return 1;
  5415. }
  5416. CMD:setworld(PARAMS)
  5417. {
  5418. LoginCheck(playerid);
  5419. LevelCheck(playerid, 3);
  5420.  
  5421. new Player, World;
  5422. if(sscanf(params, "ui", Player, World)) return SendUsage(playerid, "/setworld "GREY"<id> <world>", "Will change player's virtual world");
  5423. else
  5424. {
  5425. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  5426. CheckImune(playerid, Player);
  5427.  
  5428. SetPlayerVirtualWorld(Player, World);
  5429.  
  5430. if(Player != playerid)
  5431. {
  5432. 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);
  5433. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s virtual world to "ORAN"%d", Name(Player), Player, World);
  5434. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your virtual world to "ORAN"%d", Name(playerid), playerid, World);
  5435. }
  5436. else
  5437. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his virtual world to "ORAN"%d", Name(playerid), playerid, World);
  5438. }
  5439. return 1;
  5440. }
  5441. CMD:setcash(PARAMS)
  5442. {
  5443. LoginCheck(playerid);
  5444. LevelCheck(playerid, 3);
  5445.  
  5446. new Player, Cash;
  5447. if(sscanf(params, "ui", Player, Cash)) return SendUsage(playerid, "/setcash "GREY"<id> <cash>", "Will set player's cash to the amount inserted");
  5448. else
  5449. {
  5450. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  5451. CheckImune(playerid, Player);
  5452.  
  5453. ResetPlayerMoney(Player);
  5454. GivePlayerMoney(Player, Cash);
  5455.  
  5456. if(Player != playerid)
  5457. {
  5458. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"\"%s[%i]"GREY"'s cash to "GREE"$%d", Name(playerid), playerid, Name(Player), Player, Cash);
  5459. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s cash to "GREE"$%d", Name(Player), Player, Cash);
  5460. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your cash to "GREE"$%d", Name(playerid), playerid, Cash);
  5461. }
  5462. else
  5463. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his cash to "GREE"$%d", Name(playerid), playerid, Cash);
  5464. }
  5465. return 1;
  5466. }
  5467. CMD:setscore(PARAMS)
  5468. {
  5469. LoginCheck(playerid);
  5470. LevelCheck(playerid, 3);
  5471.  
  5472. new Player, aScore;
  5473. if(sscanf(params, "ui", Player, aScore)) return SendUsage(playerid, "/setscore "GREY"<id> <score>", "Will set player's score to the specified score");
  5474. else
  5475. {
  5476. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  5477. CheckImune(playerid, Player);
  5478.  
  5479. SetPlayerScore(Player, aScore);
  5480.  
  5481. if(Player != playerid)
  5482. {
  5483. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"\"%s[%i]"GREY"'s score to "ORAN"%d", Name(playerid), playerid, Name(Player), Player, aScore);
  5484. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s score to "ORAN"%d", Name(Player), Player, aScore);
  5485. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your score to "ORAN"%d", Name(playerid), playerid, aScore);
  5486. }
  5487. else
  5488. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his score to "ORAN"%d", Name(playerid), playerid, aScore);
  5489. }
  5490. return 1;
  5491. }
  5492. CMD:setdeaths(PARAMS)
  5493. {
  5494. LoginCheck(playerid);
  5495. LevelCheck(playerid, 4);
  5496.  
  5497. new Player, zDeaths;
  5498. if(sscanf(params, "ui", Player, zDeaths) || zDeaths < 0) return SendUsage(playerid, "/setdeaths "GREY"<id> <deaths>", "Will change player's deaths");
  5499. else
  5500. {
  5501. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  5502. CheckImune(playerid, Player);
  5503.  
  5504. SetPVarInt(Player, "0_Deaths", zDeaths);
  5505. P_DATA[Player][Deaths] = zDeaths;
  5506. if(Player != playerid)
  5507. {
  5508. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"\"%s[%i]"GREY"'s deaths to "ORAN"%d", Name(playerid), playerid, Name(Player), Player, zDeaths);
  5509. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s deaths to "ORAN"%d", Name(Player), Player, zDeaths);
  5510. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your deaths to "ORAN"%d", Name(playerid), playerid, zDeaths);
  5511. }
  5512. else
  5513. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed his deaths to "ORAN"%d", Name(playerid), playerid, zDeaths);
  5514.  
  5515. #if UPDATE_TOP_ALWAYS
  5516.  
  5517. new
  5518. Query[256],
  5519. DBResult: R1;
  5520.  
  5521. format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(Player));
  5522. R1 = DB::Query(_DB, Query);
  5523.  
  5524. if(R1)
  5525. {
  5526. if(DB::Valid(R1))
  5527. {
  5528. DB::Free(R1);
  5529. format(Query, sizeof(Query), "UPDATE `Top` SET `Deaths` = '%d' WHERE `Name` = '%s'", zDeaths, Name(Player));
  5530. DB::Query(_DB, Query);
  5531. }
  5532. else
  5533. {
  5534. DB::Free(R1);
  5535. format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`,`Deaths`) VALUES('%s','%d')", Name(Player), zDeaths);
  5536. DB::Query(_DB, Query);
  5537. }
  5538. }
  5539. #endif
  5540. }
  5541. return 1;
  5542. }
  5543. CMD:setkills(PARAMS)
  5544. {
  5545. LoginCheck(playerid);
  5546. LevelCheck(playerid, 4);
  5547.  
  5548. new Player, zKills;
  5549. if(sscanf(params, "ui", Player, zKills) || zKills < 0) return SendUsage(playerid, "/setkills "GREY"<id> <kills>", "Will change player's kills");
  5550. else
  5551. {
  5552. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  5553. CheckImune(playerid, Player);
  5554.  
  5555. SetPVarInt(Player, "0_Kills", zKills);
  5556. P_DATA[Player][Kills] = zKills;
  5557.  
  5558. if(Player != playerid)
  5559. {
  5560. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"\"%s[%i]"GREY"'s kills to "ORAN"%d", Name(playerid), playerid, Name(Player), Player, zKills);
  5561. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s kills to "ORAN"%d", Name(Player), Player, zKills);
  5562. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your kills to "ORAN"%d", Name(playerid), playerid, zKills);
  5563. }
  5564. else
  5565. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed his kills to "ORAN"%d", Name(playerid), playerid, zKills);
  5566.  
  5567. #if UPDATE_TOP_ALWAYS == true
  5568.  
  5569. new
  5570. Query[256],
  5571. DBResult: R1;
  5572.  
  5573. format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(Player));
  5574. R1 = DB::Query(_DB, Query);
  5575.  
  5576. if(R1)
  5577. {
  5578. if(DB::Valid(R1))
  5579. {
  5580. DB::Free(R1);
  5581. format(Query, sizeof(Query), "UPDATE `Top` SET `Kills` = '%d' WHERE `Name` = '%s'", zKills, Name(Player));
  5582. DB::Query(_DB, Query);
  5583. }
  5584. else
  5585. {
  5586. DB::Free(R1);
  5587. format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`,`Kills`) VALUES('%s','%d')", Name(Player), zKills);
  5588. DB::Query(_DB, Query);
  5589. }
  5590. }
  5591.  
  5592. #endif
  5593. }
  5594. return 1;
  5595. }
  5596. CMD:setweather(PARAMS)
  5597. {
  5598. LoginCheck(playerid);
  5599. LevelCheck(playerid, 3);
  5600.  
  5601. new Player, Weather;
  5602. if(sscanf(params, "ui", Player, Weather)) return SendUsage(playerid, "/setweather "GREY"<id> <weather id>", "Will change player's weather to the specified weather ID");
  5603. else
  5604. {
  5605. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  5606. CheckImune(playerid, Player);
  5607.  
  5608. SetPlayerWeather(Player, Weather);
  5609.  
  5610. if(Player != playerid)
  5611. {
  5612. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed "ORAN"\"%s[%i]"GREY"'s weather to "ORAN"%d", Name(playerid), playerid, Name(Player), Player, Weather);
  5613. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s weather to "ORAN"%d", Name(Player), Player, Weather);
  5614. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your weather to "ORAN"%d", Name(playerid), playerid, Weather);
  5615. }
  5616. else
  5617. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed his weather to "ORAN"%d", Name(playerid), playerid, Weather);
  5618. }
  5619. return 1;
  5620. }
  5621. CMD:settime(PARAMS)
  5622. {
  5623. LoginCheck(playerid);
  5624. LevelCheck(playerid, 1);
  5625.  
  5626. new Player, Time;
  5627. if(sscanf(params, "ui", Player, Time)) return SendUsage(playerid, "/settime "GREY"<id> <hour>", "Will change player's time");
  5628. else
  5629. {
  5630. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  5631. CheckImune(playerid, Player);
  5632. if(Time < 0 || Time > 24) return SendError(playerid, "Invalid hour! (0 - 24)");
  5633. SetPlayerTime(Player, Time, 0);
  5634.  
  5635. if(Player != playerid)
  5636. {
  5637. 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);
  5638. FormatMSG(Player, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s time to "ORAN"%d:00", Name(Player), Player, Time);
  5639. }
  5640. else
  5641. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed his time to "ORAN"%d:00", Name(playerid), playerid, Time);
  5642. }
  5643. return 1;
  5644. }
  5645. CMD:setskin(PARAMS)
  5646. {
  5647. LoginCheck(playerid);
  5648. LevelCheck(playerid, 2);
  5649.  
  5650. new Player, Skin;
  5651. if(sscanf(params, "ui", Player, Skin)) return SendUsage(playerid, "/setskin "GREY"<id> <skin>", "Will change player's skin to the specified skin ID");
  5652. else
  5653. {
  5654. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  5655. CheckImune(playerid, Player);
  5656. if(!IsValidSkin(Skin)) return SendError(playerid, "Invalid skin!");
  5657. SetPlayerSkin(Player, Skin);
  5658.  
  5659. if(Player != playerid)
  5660. {
  5661. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed "ORAN"\"%s[%i]"GREY"'s skin to "ORAN"%d", Name(playerid), playerid, Name(Player), Player, Skin);
  5662. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s skin to "ORAN"%d", Name(Player), Player, Skin);
  5663. }
  5664. else
  5665. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" changed his skin to "ORAN"%d", Name(playerid), playerid, Skin);
  5666. }
  5667. return 1;
  5668. }
  5669. CMD:setarmour(PARAMS)
  5670. {
  5671. LoginCheck(playerid);
  5672. LevelCheck(playerid, 3);
  5673.  
  5674. new Player, Float: Armour;
  5675. if(sscanf(params, "uf", Player, Armour)) return SendUsage(playerid, "/setarmour "GREY"<id> <armour>", "Will set player's armour to the specified armour");
  5676. else
  5677. {
  5678. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  5679. CheckImune(playerid, Player);
  5680.  
  5681. SetPlayerArmour(Player, Float: Armour);
  5682.  
  5683. if(Player != playerid)
  5684. {
  5685. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"\"%s[%i]"GREY"'s armour to "ORAN"%.1f", Name(playerid), playerid, Name(Player), Player, Armour);
  5686. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s armour to "ORAN"%.1f", Name(Player), Player, Armour);
  5687. }
  5688. else
  5689. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his armour to "ORAN"%.1f", Name(playerid), playerid, Armour);
  5690. }
  5691. return 1;
  5692. }
  5693. CMD:sethealth(PARAMS)
  5694. {
  5695. LoginCheck(playerid);
  5696. LevelCheck(playerid, 3);
  5697.  
  5698. new Player, Float: Health;
  5699. if(sscanf(params, "uf", Player, Health)) return SendUsage(playerid, "/sethealth "GREY"<id> <health>", "Will set player's health to the specified health");
  5700. else
  5701. {
  5702. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  5703. CheckImune(playerid, Player);
  5704.  
  5705. SetPlayerHealth(Player, Float: Health);
  5706.  
  5707. if(Player != playerid)
  5708. {
  5709. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set "ORAN"\"%s[%i]"GREY"'s health to "ORAN"%.1f", Name(playerid), playerid, Name(Player), Player, Health);
  5710. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s health to "ORAN"%.1f", Name(Player), Player, Health);
  5711. }
  5712. else
  5713. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his health to "ORAN"%.1f", Name(playerid), playerid, Health);
  5714. }
  5715. return 1;
  5716. }
  5717. CMD:pm(PARAMS)
  5718. {
  5719. LoginCheck(playerid);
  5720.  
  5721. if((P_DATA[playerid][Muted] || P_DATA[playerid][Muted]) && P_DATA[playerid][Level] != 5 && !IsPlayerAdmin(playerid))
  5722. return SendError(playerid, "You are not allowed to send personal message while muted!");
  5723.  
  5724. new Player, Message[129];
  5725. if(sscanf(params, "us[129]", Player, Message)) return SendUsage(playerid, "/pm "GREY"<id> [message]", "Sends a personal message to the specified id");
  5726. else
  5727. {
  5728. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  5729. if(Player == playerid ) return SendError(playerid, "You cannot PM yourself!");
  5730.  
  5731. FormatMSG(Player, Color:ORAN, "PM Received: {FFD48A}%s[%i] says: "W"%s", Name(playerid), playerid, Message);
  5732. FormatMSG(playerid, Color:ORAN, "PM Sent: {FFD48A}to %s[%i]: %s", Name(Player), Player, Message);
  5733.  
  5734. if(S_DATA[ReadPM])
  5735. {
  5736. SendAdminCMD(playerid, "PM Detected: {FFD48A}%s[%i] "GREY"to %s[%i]", Name(playerid), playerid, Name(Player), Player);
  5737. SendAdminCMD(playerid, "Message: {FFD48A}%s", Message);
  5738. }
  5739. #if SAVE_IN_LOGS == true
  5740. SaveInLog(PMS_LOG, "---------------------------\r\n\
  5741. Sender %s\r\n\
  5742. Receiver %s\r\n\
  5743. Message: %s\r\n\
  5744. Date: %s\r\n\
  5745. ---------------------------\r\n\\r\n", Name(playerid), Name(Player), Message, zDate());
  5746. #endif
  5747. }
  5748. return 1;
  5749. }
  5750. CMD:register(PARAMS)
  5751. {
  5752. if(P_DATA[playerid][Logged])
  5753. return SendClientMessage(playerid, -1, ""ORAN"ACCOUNT: "W"You are already registered and logged in! ");
  5754.  
  5755. new zStr[100];
  5756. if(AccountExist(Name(playerid)))
  5757. {
  5758. format(zStr, sizeof (zStr), ""GREY"Hello "GREE"%s"GREY", you already have an account!\n\nPlease login into your account:", Name(playerid));
  5759. SPD(playerid, Dialog:Login3, INPUT, ""W"Welcome back", zStr, "Login", "Exit");
  5760. }
  5761. else
  5762. {
  5763. format(zStr, sizeof (zStr), ""GREY"Hello "ORAN"%s"GREY"\n\nPlease write your desired password:", Name(playerid));
  5764. ShowPlayerDialog(playerid, Dialog:Register1, DIALOG_STYLE_INPUT, ""W"Register an account", zStr, "Register", "Exit");
  5765.  
  5766. }
  5767. return 1;
  5768. }
  5769. CMD:login(PARAMS)
  5770. {
  5771. if(P_DATA[playerid][Logged])
  5772. return SendClientMessage(playerid, -1, ""ORAN"ACCOUNT: "W"You are already registered and logged in! ");
  5773.  
  5774. new zStr[100];
  5775. if(AccountExist(Name(playerid)))
  5776. {
  5777. format(zStr, sizeof (zStr), ""GREY"Hello "GREE"%s"GREY"!\n\nPlease login into your account:", Name(playerid));
  5778. SPD(playerid, Dialog:Login3, INPUT, ""W"Welcome back", zStr, "Login", "Exit");
  5779. }
  5780. else
  5781. {
  5782. format(zStr, sizeof (zStr), ""GREY"Hello "ORAN"%s"GREY", you don't have an account!\n\nPlease write your desired password:", Name(playerid));
  5783. ShowPlayerDialog(playerid, Dialog:Register1, DIALOG_STYLE_INPUT, ""W"Register an account", zStr, "Register", "Exit");
  5784. }
  5785. return 1;
  5786. }
  5787. CMD:t(p){FormatMSG(p, -1, "%d", P_DATA[p][Logged]);return 1;}
  5788. CMD:acp(PARAMS)
  5789. {
  5790. LoginCheck(playerid);
  5791. LevelCheck(playerid, 5);
  5792.  
  5793. SPD(playerid, Dialog:cPanel, LIST, ""ORAN"Server Control Panel", cPanel(), "Enable", "Disable");
  5794. return 1;
  5795. }
  5796. CMD:clearchat(PARAMS)
  5797. {
  5798. LoginCheck(playerid);
  5799. LevelCheck(playerid, 3);
  5800.  
  5801. new Yes[3];
  5802. if(sscanf(params, "s[3]", Yes)) return SendUsage(playerid, "/clearchat "GREY"[yes]", "Will clear the chat");
  5803. else
  5804. {
  5805. if(!strcmp(Yes, "yes"))
  5806. {
  5807. for(new m = 0; m < 10; m ++) { SendClientMessage(m, -1, " "); }
  5808. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" cleared the chat", Name(playerid), playerid);
  5809. SendClientMessage(playerid, Color:GREY, "You cleared the chat.");
  5810. }
  5811. else SendUsage(playerid, "/clearchat "GREY"[yes]", "Will clear the chat");
  5812. }
  5813. return 1;
  5814. }
  5815. CMD:chat(PARAMS)
  5816. {
  5817. LoginCheck(playerid);
  5818. LevelCheck(playerid, 4);
  5819.  
  5820. if(!strlen(params))
  5821. return SendUsage(playerid, "/chat "GREY"[block/unblock/spam/clear]");
  5822.  
  5823. if(!strcmp(params, "unblock"))
  5824. {
  5825. if(!S_DATA[Chat]) return SendError(playerid, "Chat already unblocked!");
  5826.  
  5827. S_DATA[Chat] = 0;
  5828. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" unblocked the chat", Name(playerid), playerid);
  5829. SendClientMessage(playerid, Color:GREY, "You unblocked the chat.");
  5830. }
  5831. else if(!strcmp(params, "block"))
  5832. {
  5833. BlockChat(playerid);
  5834. }
  5835. else if(!strcmp(params, "clear"))
  5836. {
  5837. for(new m = 0; m < 20; m ++) { SendClientMessageToAll(-1, "-"); }
  5838. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" cleared the chat", Name(playerid), playerid);
  5839. SendClientMessage(playerid, Color:GREY, "You cleared the chat.");
  5840. }
  5841. else if(!strcmp(params, "spam"))
  5842. {
  5843. new Str[65],
  5844. Preload[65] = "zxcvbnmlkjhgfdsaqwertyuioplmkjnhbgfvcdfrtghyasetgrhnhgrftghnhjki";
  5845.  
  5846.  
  5847. for(new x = 0; x < 45; x++)
  5848. {
  5849. new rCo = random(sizeof(SpamColors)),
  5850. rMe = random(65);
  5851.  
  5852. format(Str, sizeof (Str), "%s%s", Str[rMe], Preload[rMe]);
  5853. foreach(Player, i)
  5854. {
  5855.  
  5856. SendClientMessage(i, SpamColors[rCo], Str[x]);
  5857. }
  5858. }
  5859.  
  5860. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" spammed the chat", Name(playerid), playerid);
  5861. SendClientMessage(playerid, Color:GREY, "You spammed the chat.");
  5862. }
  5863. else return SendUsage(playerid, "/chat "GREY"[block/unblock/spam/clear]");
  5864.  
  5865. return 1;
  5866. }
  5867.  
  5868. CMD:respawncars(PARAMS)
  5869. {
  5870. LoginCheck(playerid);
  5871. LevelCheck(playerid, 5);
  5872.  
  5873. new Yes[3];
  5874. if(sscanf(params, "s[3]", Yes)) return SendUsage(playerid, "/respawncars "GREY"[yes]", "Will respawn all server's unoccupied vehicles");
  5875. else
  5876. {
  5877. if(!strcmp(Yes, "yes"))
  5878. {
  5879. for (new v = 0; v < MAX_VEHICLES; v++)
  5880. {
  5881. if(!VehicleOccupied(v))
  5882. {
  5883. SetVehicleToRespawn(v);
  5884. }
  5885. }
  5886. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" respawned all server unoccupied vehicles!", Name(playerid), playerid);
  5887. SendClientMessage(playerid, Color:GREY, "You respawned all server unoccupied vehicles!");
  5888. }else SendUsage(playerid, "/respawncars "GREY"[yes]", "Will rspawn all server's unoccupied vehicles");
  5889. }
  5890.  
  5891. return 1;
  5892. }
  5893. CMD:explode(PARAMS)
  5894. {
  5895. LoginCheck(playerid);
  5896. LevelCheck(playerid, 3);
  5897.  
  5898. if(sscanf(params, "u", params[0])) return SendUsage(playerid, "/explode "GREY"<id>", "Will create an explosion near specified player's location");
  5899. else
  5900. {
  5901. CheckImune(playerid, params[0]);
  5902. if(params[0] == (0xFFFF)) return SendClientMessage(playerid, -1, ""GREY"Player not connected!");
  5903. if(params[0] == playerid) return SendClientMessage(playerid, -1, ""GREY"You cannot unfreeze yourself!");
  5904.  
  5905. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" exploded player "ORAN"%s[%i]", Name(playerid), playerid, Name(params[0]), params[0]);
  5906. FormatMSG(playerid, Color:GREY, "You exploded "ORAN"%s[%i]", Name(params[0]), params[0]);
  5907. SendClientMessage(params[0], Color:GREY, "You have been exploded!");
  5908.  
  5909. new Float: _P[3];
  5910. GetPlayerPos(params[0],_P[0], _P[1], _P[2]);CreateExplosion(_P[0], _P[1], _P[2], 7, 10.0);
  5911. }
  5912. return 1;
  5913. }
  5914.  
  5915. CMD:slap(PARAMS)
  5916. {
  5917. LoginCheck(playerid);
  5918. LevelCheck(playerid, 3);
  5919.  
  5920. 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");
  5921. else
  5922. {
  5923. CheckImune(playerid, params[0]);
  5924. if(params[0] == (0xFFFF)) return SendClientMessage(playerid, -1, ""GREY"Player not connected!");
  5925. if(params[0] == playerid) return SendClientMessage(playerid, -1, ""GREY"You cannot slap yourself!");
  5926.  
  5927. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" slapped player "ORAN"%s[%i]", Name(playerid), playerid, Name(params[0]), params[0]);
  5928. FormatMSG(playerid, Color:GREY, "You slapped "ORAN"%s[%i]", Name(params[0]), params[0]);
  5929. SendClientMessage(params[0], Color:GREY, "You have been slapped!");
  5930.  
  5931. new Float:Pos[3], Float: Health;
  5932. GetPlayerPos(params[0], Pos[0], Pos[1], Pos[2]);
  5933. SetPlayerPos(params[0], Pos[0], Pos[1], Pos[2] + 3.5);
  5934. GetPlayerHealth(params[0], Health);
  5935. SetPlayerHealth(params[0], Health - 30);
  5936. }
  5937. return 1;
  5938. }
  5939. CMD:unfreeze(PARAMS)
  5940. {
  5941. LoginCheck(playerid);
  5942. LevelCheck(playerid, 2);
  5943.  
  5944. if(sscanf(params, "u", params[0], params[1])) return SendUsage(playerid, "/unfreeze "GREY"<id>", "Will un-freeze the player that has been frozen");
  5945. else
  5946. {
  5947. CheckImune(playerid, params[0]);
  5948. if(params[0] == (0xFFFF)) return SendClientMessage(playerid, -1, ""GREY"Player not connected!");
  5949. if(params[0] == playerid) return SendClientMessage(playerid, -1, ""GREY"You cannot unfreeze yourself!");
  5950. if(!P_DATA[params[0]][Frozen]) return SendClientMessage(playerid, -1, ""GREY"Player is not frozen!");
  5951.  
  5952. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" unfreezed player "ORAN"%s[%i]", Name(playerid), playerid, Name(params[0]), params[0]);
  5953. FormatMSG(playerid, Color:GREY, "You unfreezed "ORAN"%s[%i]", Name(params[0]), params[0]);
  5954. SendClientMessage(params[0], Color:GREY, "You have been unfreezed!");
  5955.  
  5956. P_DATA[params[0]][Frozen] = 0;
  5957. UnFreeze(params[0]);
  5958.  
  5959. #if SAVE_FREEZE == true
  5960.  
  5961. new
  5962. Query[256];
  5963. format(Query, 256, "DELETE FROM `Frozen` WHERE `IP` = '%s'", GetPlayerIPEx(params[0]));
  5964. DB::Query(_DB, Query);
  5965.  
  5966. #endif
  5967. }
  5968. return 1;
  5969. }
  5970. CMD:freeze(PARAMS)
  5971. {
  5972. LoginCheck(playerid);
  5973. LevelCheck(playerid, 2);
  5974.  
  5975. if(sscanf(params, "u", params[0])) return SendUsage(playerid, "/freeze "GREY"<id>", "Will freeze a specified player, he will cannot freeze-evade!");
  5976. else
  5977. {
  5978. CheckImune(playerid, params[0]);
  5979. if(params[0] == (0xFFFF)) return SendClientMessage(playerid, -1, ""GREY"Player not connected!");
  5980. if(params[0] == playerid) return SendClientMessage(playerid, -1, ""GREY"You cannot freeze yourself!");
  5981. if(P_DATA[params[0]][Frozen]) return SendClientMessage(playerid, -1, ""GREY"Player is already frozen!");
  5982.  
  5983. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" freezed player "ORAN"%s[%i]", Name(playerid), playerid, Name(params[0]), params[0]);
  5984. FormatMSG(playerid, Color:GREY, "You freezed "ORAN"%s[%i]", Name(params[0]), params[0]);
  5985. SendClientMessage(params[0], Color:GREY, "You have been freezed!");
  5986.  
  5987. P_DATA[params[0]][Frozen] = 1;
  5988. Freeze(params[0]);
  5989.  
  5990. #if SAVE_FREEZE == true
  5991.  
  5992. new
  5993. Query[256],
  5994. DBResult:R1;
  5995. format(Query, sizeof(Query), "SELECT `Key` FROM `Frozen` WHERE `IP` = '%s'", GetPlayerIPEx(params [0]));
  5996. R1 = DB::Query(_DB, Query);
  5997.  
  5998. if(R1)
  5999. {
  6000. if(DB::Valid(R1))
  6001. {
  6002. DB::Free(R1);
  6003. format(Query, sizeof(Query), "INSERT INTO `Frozen` VALUES(NULL, '%s',1, '%s')",Name(params [0]), GetPlayerIPEx(params [0]));
  6004. DB::Query(_DB, Query);
  6005. }
  6006. else
  6007. {
  6008. DB::Free(R1);
  6009. format(Query, sizeof(Query), "UPDATE `Frozen` SET `Frozen` = '1', `RealName` = '%s' WHERE `IP` = '%s'", Name(params [0]), GetPlayerIPEx(params [0]));
  6010. DB::Query(_DB, Query);
  6011. }
  6012. }
  6013.  
  6014. #endif
  6015. }
  6016. return 1;
  6017. }
  6018. CMD:unjail(PARAMS)
  6019. {
  6020. LoginCheck(playerid);
  6021. LevelCheck(playerid, 3);
  6022.  
  6023. new Player;
  6024. if(sscanf(params, "u", Player)) return SendUsage(playerid, "/unjail "GREY"<id>", "Will unjail the specified player");
  6025. else
  6026. {
  6027. CheckImune(playerid, Player);
  6028. if(Player == (0xFFFF)) return SendClientMessage(playerid, -1, ""GREY"Player not connected!");
  6029. if(Player == playerid && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, ""GREY"You cannot unjail yourself!");
  6030. if(!P_DATA[Player][Jailed]) return SendClientMessage(playerid, -1, ""GREY"Player is not jailed!");
  6031.  
  6032. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" unjailed player "ORAN"%s[%i]", Name(playerid), playerid, Name(Player), Player);
  6033. FormatMSG(playerid, Color:GREY, "You unjailed "ORAN"%s[%i]", Name(Player), Player);
  6034. SendClientMessage(Player, Color:GREY, "You have been unjailed!");
  6035.  
  6036. P_DATA[Player][Jailed] = 0;
  6037. P_DATA[Player][JailTime] = 0;
  6038.  
  6039. SetPlayerInterior(playerid, 0);
  6040. SetPlayerPos(playerid, 0.0, 0.0, 0.0);
  6041. SpawnPlayer(playerid);
  6042. PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
  6043.  
  6044. #if SAVE_JAIL == true
  6045.  
  6046. new Query[256], DBResult:Result;
  6047. format(Query, 256, "SELECT `Key` FROM `Jailed` WHERE `IP` = '%s'", GetPlayerIPEx(params[0]));
  6048. Result = DB::Query(_DB, Query);
  6049.  
  6050. if(Result)
  6051. {
  6052. if(DB::Valid(Result))
  6053. {
  6054. DB::Free(Result);
  6055. format(Query, 256, "DELETE FROM `Jailed` WHERE `IP` = '%s'", GetPlayerIPEx(params[0]));
  6056. DB::Query(_DB, Query);
  6057. }
  6058. else
  6059. {
  6060. DB::Free(Result);
  6061. }
  6062. }
  6063.  
  6064. #endif
  6065. }
  6066. return 1;
  6067. }
  6068. CMD:jail(PARAMS)
  6069. {
  6070. LoginCheck(playerid);
  6071. LevelCheck(playerid, 3);
  6072.  
  6073. new Player, Time, Reason[40];
  6074. 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");
  6075. else
  6076. {
  6077. CheckImune(playerid, Player);
  6078. if(Player == (0xFFFF)) return SendClientMessage(playerid, -1, ""GREY"Player not connected!");
  6079. if(Player == playerid) return SendClientMessage(playerid, -1, ""GREY"You cannot jail yourself!");
  6080. if(P_DATA[Player][Jailed]) return SendClientMessage(playerid, -1, ""GREY"Player is already jailed!");
  6081.  
  6082. if(Time == 0)
  6083. {
  6084. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" jailed player "ORAN"%s[%i] "GREY"[Reason: "W"%s"GREY"]", Name(playerid), playerid, Name(Player), Player, Reason);
  6085. FormatMSG(playerid, Color:GREY, "You jailed "ORAN"%s[%i] "GREY"[Reason: "W"%s"GREY"][Time: "W"Forever]", Name(Player), Player, Reason, Time);
  6086. SendClientMessage(Player, Color:GREY, "You have been jailed "W"["GREY"Time:"W" Forever[");
  6087. }
  6088. if(Time > 0)
  6089. {
  6090. 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);
  6091. FormatMSG(playerid, Color:GREY, "You jailed "ORAN"%s[%i] "GREY"[Reason: "W"%s"GREY"][Time: "W"%d"GREY" Minutes]", Name(Player), Player, Reason, Time);
  6092. FormatMSG(Player, Color:GREY, "You have been jailed "W"["GREY"Time:"W" %d "GREY"Minutes "W"]", Time);
  6093. }
  6094. P_DATA[Player][Jailed] = 1;
  6095. P_DATA[Player][JailTime] = Time;
  6096.  
  6097. SetTimerEx("JailPlayer", 1500, false, "i", Player);
  6098.  
  6099. #if SAVE_JAIL == true
  6100.  
  6101. new Query[256],DBResult:R1;
  6102. format(Query, sizeof(Query), "SELECT `Key` FROM `Jailed` WHERE `IP` = '%s'", GetPlayerIPEx(Player));
  6103. R1 = DB::Query(_DB, Query);
  6104.  
  6105. if(R1)
  6106. {
  6107. if(DB::Valid(R1))
  6108. {
  6109. DB::Free(R1);
  6110. format(Query, sizeof(Query), "INSERT INTO `Jailed` (`IP`,`Jailed`,`Time`,`RealName`) VALUES('%s','1','%d','%s')",Name(Player), Time, GetPlayerIPEx(Player));
  6111. DB::Query(_DB, Query);
  6112. }
  6113. else
  6114. {
  6115. DB::Free(R1);
  6116. format(Query, sizeof(Query), "UPDATE `Jailed` SET `Jailed` = '1', `Time` = '%d', `RealName` = '%s' WHERE `IP` = '%s'", Time, GetPlayerIPEx(Player), Name(Player));
  6117. DB::Query(_DB, Query);
  6118. }
  6119. }
  6120.  
  6121. #endif
  6122. }
  6123. return 1;
  6124. }
  6125. CMD:settemplevel(PARAMS)
  6126. {
  6127. LoginCheck(playerid);
  6128. LevelCheck(playerid, 5);
  6129.  
  6130. new Player, TempLevel;
  6131. 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");
  6132. else
  6133. {
  6134. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  6135. if(Player == playerid ) return SendError(playerid, "Player entered is you!");
  6136. if(Player < 0 || TempLevel > 5) return SendError(playerid, "Invalid level! Maximum level is "ORAN"5");
  6137.  
  6138. P_DATA[Player][tLevel] = 1;
  6139. P_DATA[Player][Level] = TempLevel;
  6140.  
  6141. 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);
  6142. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s temporary level to "ORAN"%d", Name(Player), Player, TempLevel);
  6143. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your temporary level to "ORAN"%d", Name(playerid), playerid, TempLevel);
  6144. SendClientMessage(playerid, Color:ORAN, "Level will expire on exit!");
  6145. }
  6146. return 1;
  6147. }
  6148. CMD:setvip(PARAMS)
  6149. {
  6150. LoginCheck(playerid);
  6151. LevelCheck(playerid, 5);
  6152.  
  6153. if(sscanf(params, "ui", params[0], params[1])) return SendUsage(playerid, "/setvip "GREY"<id> <level>", "Will set a player to the specified VIP level");
  6154. else
  6155. {
  6156. if(params[0] == (0xFFFF)) return SendError(playerid, "Player not connected!");
  6157. if(!P_DATA[params[0]][Logged]) return SendError(playerid, "Player must be logged in to change his level!");
  6158. if(P_DATA[params[0]][Vip] == params[1]) return SendError(playerid, "Player is already that level!");
  6159. if(params[1] < 0 || params[1] > 3) return SendError(playerid, "Invalid level! Maximum VIP level is "ORAN"3");
  6160.  
  6161. if(params[0] == playerid)
  6162. {
  6163. #if SAVE_IN_LOGS == true
  6164. SaveInLog(SETVIP_LOG, "Admin %s set his VIP level %d on %s", Name(playerid), params[1], zDate());
  6165. #endif
  6166. SendAdminCMD(-1, "Admin "ORAN"%s[%i]"GREY" set himself a VIP member level "ORAN"%d", Name(playerid), playerid, params[1]);
  6167. FormatMSG(playerid, Color:GREY, "You set yourself a VIP member level "ORAN"%d", params[1]);
  6168. }
  6169. else
  6170. {
  6171. #if SAVE_IN_LOGS == true
  6172. 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());
  6173. #endif
  6174. 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]);
  6175. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s[%i]"GREY"'s VIP level to "ORAN"%d", Name(params[0]), params[0], params[1]);
  6176. FormatMSG(params[0], Color:GREY,"Admin "ORAN"%s[%i]"GREY" set your VIP level to "ORAN"%d", Name(playerid), playerid, params[1]);
  6177. }
  6178. SetPVarInt(params[0], "0_Vip", params[1]);
  6179. P_DATA[params[0]][Vip] = params[1];
  6180.  
  6181. if(AccountExist(Name(params[0])))
  6182. {
  6183. new Query[100];
  6184. format(Query, 120, "UPDATE `Accounts` SET `VIP` = '%d' WHERE `Name` = '%s'", params[1], Name(params[0]));
  6185. DB::Query(_DB, Query);
  6186. }
  6187. }
  6188. return 1;
  6189. }
  6190. CMD:ranks(PARAMS)
  6191. {
  6192. #if USE_RANKS == false
  6193.  
  6194. return SendError(playerid, "Using ranks is disabled from script!");
  6195.  
  6196. #else
  6197.  
  6198. LoginCheck(playerid);
  6199.  
  6200. new
  6201. RankString[2_0_0_0];
  6202. RankString = ""BLUE"# "GREY"The current server ranks:\n\n";
  6203. for (new r = 0; r < sizeof(_Ranks); r++)
  6204. {
  6205. 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]);
  6206. }
  6207. ShowPlayerDialog(playerid, Dialog:Empty, BOX, ""BLUE"Server Ranks", RankString, "Close", "");
  6208. return 1;
  6209.  
  6210. #endif
  6211. }
  6212. CMD:setrank(PARAMS)
  6213. {
  6214. #if USE_RANKS == false
  6215.  
  6216. return SendError(playerid, "Using ranks is disabled from script!");
  6217.  
  6218. #else
  6219.  
  6220. LoginCheck(playerid);
  6221. LevelCheck(playerid, 4);
  6222.  
  6223. 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")");
  6224. else
  6225. {
  6226. if(params[0] == (0xFFFF)) return SendError(playerid, "Player not connected!");
  6227. if(!P_DATA[params[0]][Logged]) return SendError(playerid, "Player must be logged in to change his rank!");
  6228. if(P_DATA[params[0]][Rank] == params[1]) return SendError(playerid, "Player is already that rank!");
  6229. if(params[1] < 0 || params[1] > sizeof(_Ranks) - 1)
  6230. {
  6231. FormatMSG(playerid, Color:ORAN, "* "GREY"Invalid level! Maximum rank is "ORAN"%d "W"-"ORAN"%s", sizeof(_Ranks) - 1, _Ranks[sizeof(_Ranks) - 1][irName]);
  6232. return 1;
  6233. }
  6234. if(params[0] == playerid)
  6235. {
  6236. #if SAVE_IN_LOGS == true
  6237. SaveInLog(SETRANK_LOG, "Admin %s promoved set his rank to %d on %s", Name(playerid), params[1], zDate());
  6238. #endif
  6239. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set his rank to "ORAN"%d "GREY"|"ORAN" %s", Name(playerid), playerid, params[1], RankName(params[1]));
  6240. FormatMSG(playerid, Color:GREY, "You set your rank to "ORAN"%d "GREY"|"ORAN" %s", params[1], RankName(params[1]));
  6241.  
  6242. SetPVarInt(playerid, "0_Rank", params[1]) ;
  6243. P_DATA[playerid][Rank] = params[1];
  6244. }
  6245. else
  6246. {
  6247. if(P_DATA[params[0]][Rank] < params[1])
  6248. {
  6249. #if SAVE_IN_LOGS == true
  6250. 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());
  6251. #endif
  6252. 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]));
  6253. GameTextForPlayer(params[0], "~n~~n~~n~~n~~n~~n~~n~~g~Ranked up!!", 6000, 1);
  6254. 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]));
  6255. 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]));
  6256. }
  6257. else
  6258. {
  6259. #if SAVE_IN_LOGS == true
  6260. 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());
  6261. #endif
  6262. 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]));
  6263. GameTextForPlayer(params[0], "~n~~n~~n~~n~~n~~n~~n~~r~Ranked down!!", 6000, 1);
  6264. 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]));
  6265. 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]));
  6266. }
  6267. P_DATA[params[0]][Rank] = params[1];
  6268. SetPVarInt(params[0], "0_Rank", params[1]);
  6269. }
  6270. new Query[120];
  6271. if(AccountExist(Name(params[0])))
  6272. {
  6273. format(Query, 120, "UPDATE `Accounts` SET `Rank` = '%d' WHERE `Name` = '%s'", params[1], Name(params[0]));
  6274. DB::Query(_DB, Query);
  6275. }
  6276.  
  6277. #if UPDATE_TOP_ALWAYS == true
  6278. new
  6279. DBResult: R1;
  6280.  
  6281. format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(params[0]));
  6282. R1 = DB::Query(_DB, Query);
  6283.  
  6284. if(R1)
  6285. {
  6286. if(DB::Valid(R1))
  6287. {
  6288. DB::Free(R1);
  6289. format(Query, sizeof(Query), "UPDATE `Top` SET `Rank` = '%d' WHERE `Name` = '%s'", params[1], Name(params[0]));
  6290. DB::Query(_DB, Query);
  6291. }
  6292. else
  6293. {
  6294. DB::Free(R1);
  6295. format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`,`Rank`) VALUES('%s','%d')",Name(params[0]), params[1]);
  6296. DB::Query(_DB, Query);
  6297. }
  6298. }
  6299. #endif
  6300. }
  6301. return 1;
  6302.  
  6303. #endif
  6304. }
  6305. CMD:setlevel(PARAMS)
  6306. {
  6307. LoginCheck(playerid);
  6308. LevelCheck(playerid, 5);
  6309.  
  6310. if(sscanf(params, "ud", params[0], params[1])) return SendUsage(playerid, "/setlevel "GREY"<id> <level>", "Will change a player's level position!");
  6311. else
  6312. {
  6313. if(params[0] == (0xFFFF)) return SendError(playerid, "Player not connected!");
  6314. if(!P_DATA[params[0]][Logged]) return SendError(playerid, "Player must be logged in to change his level!");
  6315. if(P_DATA[params[0]][Level] == params[1]) return SendError(playerid, "Player is already that level!");
  6316. if(params[1] < 0 || params[1] > 5) return SendError(playerid, "Invalid level! Maximum level is "ORAN"5");
  6317.  
  6318. if(params[0] == playerid)
  6319. {
  6320. #if SAVE_IN_LOGS == true
  6321. SaveInLog(SETLEVEL_LOG, "Admin %s set his level to %d | %s on %s", Name(playerid), params[1], LevelName(params[1]), zDate());
  6322. #endif
  6323. SetPVarInt(playerid, "0_Level", params[1]) ;
  6324. P_DATA[playerid][Level] = params[1];
  6325. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" set himself as "ORAN"%s"GREY" of the server!", Name(playerid), playerid, LevelName(params[1]));
  6326. FormatMSG(playerid, Color:GREY, "You set yourself as "ORAN"%s"GREY" of the server!", LevelName(params[1]));
  6327. }
  6328. else
  6329. {
  6330. if(P_DATA[params[0]][Level] < params[1])
  6331. {
  6332. #if SAVE_IN_LOGS == true
  6333. 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());
  6334. #endif
  6335. 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]));
  6336. GameTextForPlayer(params[0], "~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~Promoved!", 6000, 1);
  6337. 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]));
  6338. 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]));
  6339. }
  6340. else
  6341. {
  6342. #if SAVE_IN_LOGS == true
  6343. 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());
  6344. #endif
  6345. 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]));
  6346. GameTextForPlayer(params[0], "~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~r~Demoted!", 6000, 1);
  6347. 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]));
  6348. 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]));
  6349.  
  6350. }
  6351. SetPVarInt(params[0], "0_Level", params[1]) ;
  6352. P_DATA[params[0]][Level] = params[1];
  6353.  
  6354. }
  6355.  
  6356. new Query[120];
  6357. if(AccountExist(Name(params[0])))
  6358. {
  6359. format(Query, 120, "UPDATE `Accounts` SET `Level` = '%d' WHERE `Name` = '%s'", params[1], Name(params[0]));
  6360. DB::Query(_DB, Query);
  6361. }
  6362. }
  6363. return 1;
  6364. }
  6365.  
  6366. CMD:unmute(PARAMS)
  6367. {
  6368. LoginCheck(playerid);
  6369. LevelCheck(playerid, 2);
  6370.  
  6371. if(sscanf(params, "u", params[0])) return SendUsage(playerid, "/unmute "GREY"<id>", "Will unmute the specified player");
  6372. else
  6373. {
  6374. CheckImune(playerid, params[0]);
  6375. if(params[0] == (0xFFFF)) return SendError(playerid, "Player not connected!");
  6376. if(params[0] == playerid ) return SendError(playerid, "You cannot unmute yourself!");
  6377. if(!P_DATA[params[0]][Muted]) return SendError(playerid, "Player is not muted!");
  6378.  
  6379. P_DATA[params[0]][Muted] = 0;
  6380. P_DATA[params[0]][MutedTime] = 0;
  6381.  
  6382. KillTimer(MuteTimer[params[0]]);
  6383. #if SAVE_MUTE == true
  6384.  
  6385. new
  6386. Query[256];
  6387. format(Query, 256, "DELETE FROM `Muted` WHERE `IP` = '%s'", GetPlayerIPEx(params[0]));
  6388. DB::Query(_DB, Query);
  6389.  
  6390.  
  6391. #endif
  6392.  
  6393. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" unmuted player "ORAN"%s[%i]", Name(playerid), playerid, Name(params[0]), params[0]);
  6394. FormatMSG(playerid, Color:GREY, "You unmuted "ORAN"%s[%i]", Name(params[0]), params[0]);
  6395. SendClientMessage(params[0], Color:GREY, "You have been unmuted!");
  6396. }
  6397. return 1;
  6398. }
  6399. CMD:spawnall(PARAMS)
  6400. {
  6401. LoginCheck(playerid);
  6402. LevelCheck(playerid, 4);
  6403.  
  6404. foreach(Player, i)
  6405. {
  6406. if(P_DATA[i][Level] != 5)
  6407. {
  6408. if(i != playerid)
  6409. {
  6410. SpawnPlayer(i);
  6411. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" spawned you and everyone!", Name(playerid), playerid);
  6412. }
  6413. }
  6414. }
  6415. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" spawned everyone!", Name(playerid), playerid);
  6416. SendClientMessage(playerid, Color:GREY, "You spawned everyone in the server!");
  6417. return 1;
  6418. }
  6419. CMD:killall(PARAMS)
  6420. {
  6421. LoginCheck(playerid);
  6422. LevelCheck(playerid, 4);
  6423.  
  6424. foreach(Player, i)
  6425. {
  6426. if(P_DATA[i][Level] != 5)
  6427. {
  6428. if(i != playerid)
  6429. {
  6430. SetPlayerHealth(i, 0.0);
  6431. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" killed you and everyone!", Name(playerid), playerid);
  6432. }
  6433. }
  6434. }
  6435. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" killed everyone!", Name(playerid), playerid);
  6436. SendClientMessage(playerid, Color:GREY, "You killed everyone in the server!");
  6437. return 1;
  6438. }
  6439. CMD:unfreezeall(PARAMS)
  6440. {
  6441. LoginCheck(playerid);
  6442. LevelCheck(playerid, 4);
  6443.  
  6444. foreach(Player, i)
  6445. {
  6446. if(P_DATA[i][Level] != 5)
  6447. {
  6448. if(i != playerid)
  6449. {
  6450. P_DATA[i][Frozen] = 0;
  6451. UnFreeze(i);
  6452. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" defrosted you and everyone!", Name(playerid), playerid);
  6453. }
  6454. }
  6455. }
  6456. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" defrosted everyone!", Name(playerid), playerid);
  6457. SendClientMessage(playerid, Color:GREY, "You defrosted everyone in the server!");
  6458. return 1;
  6459. }
  6460. CMD:freezeall(PARAMS)
  6461. {
  6462. LoginCheck(playerid);
  6463. LevelCheck(playerid, 4);
  6464.  
  6465. foreach(Player, i)
  6466. {
  6467. if(P_DATA[i][Level] != 5)
  6468. {
  6469. if(i != playerid)
  6470. {
  6471. P_DATA[i][Frozen] = 1;
  6472. Freeze(i);
  6473. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" froze you and everyone!", Name(playerid), playerid);
  6474. }
  6475. }
  6476. }
  6477. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" froze everyone!", Name(playerid), playerid);
  6478. SendClientMessage(playerid, Color:GREY, "You froze everyone in the server! However, if the re-connect, they will be able to move again.");
  6479. return 1;
  6480. }
  6481. CMD:banall(PARAMS)
  6482. {
  6483. LoginCheck(playerid);
  6484. LevelCheck(playerid, 5);
  6485.  
  6486. new
  6487. File:zFile,
  6488. zStr[100];
  6489.  
  6490.  
  6491. zFile = fopen(BAN_LOG, io_append);
  6492. format(zStr, sizeof (zStr), "\r\n\r\n\r\n][MASSIVE BAN ON %s[]\r\n", zDate ());
  6493.  
  6494. fwrite(zFile, zStr);
  6495.  
  6496. foreach(Player, i)
  6497. {
  6498. if(P_DATA[i][Level] < 3 || !P_DATA[i][Vip])
  6499. {
  6500. if(i != playerid)
  6501. {
  6502. #if SAVE_IN_LOGS == true
  6503.  
  6504. if(zFile)
  6505. {
  6506.  
  6507. format(zStr, sizeof (zStr), "Player: %s[%i] has been banned by \"%s\" with reason \"Massive ban!\" on %s\r\n",
  6508. Name(i),
  6509. i,
  6510. Name(playerid),
  6511. zDate());
  6512. fwrite(zFile, zStr);
  6513.  
  6514. }
  6515.  
  6516. #endif
  6517. }
  6518. }
  6519. }
  6520. fwrite(zFile, "][!! END OF MASSIVE BAN !![]");
  6521. fclose(zFile);
  6522. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" banned everyone from the server except VIP members and level 3 admins!", Name(playerid), playerid);
  6523. SendClientMessage(playerid, Color:GREY, "You banned everyone from the server!");
  6524. return 1;
  6525. }
  6526. CMD:kickall(PARAMS)
  6527. {
  6528. LoginCheck(playerid);
  6529. LevelCheck(playerid, 5);
  6530.  
  6531.  
  6532. new
  6533. File:zFile,
  6534. zStr[100];
  6535.  
  6536.  
  6537. zFile = fopen(KICK_LOG, io_append);
  6538. format(zStr, sizeof (zStr), "\r\n\r\n\r\n][MASSIVE KICK ON %s[]\r\n", zDate ());
  6539.  
  6540. fwrite(zFile, zStr);
  6541.  
  6542. foreach(Player, i)
  6543. {
  6544. if(P_DATA[i][Level] < 3 || !P_DATA[i][Vip])
  6545. {
  6546. if(i != playerid)
  6547. {
  6548. KickEx(i, Name(i), "Massive kick!", false);
  6549. }
  6550. }
  6551. }
  6552. fwrite(zFile, "][!! END OF MASSIVE KICK !![]");
  6553. fclose(zFile);
  6554. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" kicked everyone from the server except VIP members and level 3 admins!", Name(playerid), playerid);
  6555. SendClientMessage(playerid, Color:GREY, "You kicked everyone from the server!");
  6556. return 1;
  6557. }
  6558. CMD:slapall(PARAMS)
  6559. {
  6560. LoginCheck(playerid);
  6561. LevelCheck(playerid, 4);
  6562.  
  6563. new
  6564. Float:Pos[3],
  6565. Float:Health
  6566. ;
  6567.  
  6568. foreach(Player, i)
  6569. {
  6570. if(P_DATA[i][Level] != 5)
  6571. {
  6572. if(i != playerid)
  6573. {
  6574.  
  6575. GetPlayerPos(i, Pos[0], Pos[1], Pos[2]);
  6576. SetPlayerPos(i, Pos[0], Pos[1], Pos[2] + 3.5);
  6577. GetPlayerHealth(i, Health);
  6578. SetPlayerHealth(i, Health - 30);
  6579. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" unmuted you and everyone!", Name(playerid), playerid);
  6580. }
  6581. }
  6582. }
  6583. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" slapped everyone!", Name(playerid), playerid);
  6584. SendClientMessage(playerid, Color:GREY, "You slapped everyone in the server!");
  6585. return 1;
  6586. }
  6587.  
  6588. CMD:unmuteall(PARAMS)
  6589. {
  6590. LoginCheck(playerid);
  6591. LevelCheck(playerid, 4);
  6592.  
  6593. foreach(Player, i)
  6594. {
  6595. if(P_DATA[i][Level] != 5)
  6596. {
  6597. if(i != playerid)
  6598. {
  6599. P_DATA[i][MutedAll] = 0;
  6600. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" unmuted you and everyone!", Name(playerid), playerid);
  6601. }
  6602. }
  6603. }
  6604. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" unmuted everyone!", Name(playerid), playerid);
  6605. SendClientMessage(playerid, Color:GREY, "You unmuted everyone in the server!");
  6606. return 1;
  6607. }
  6608. CMD:muteall(PARAMS)
  6609. {
  6610. LoginCheck(playerid);
  6611. LevelCheck(playerid, 3);
  6612.  
  6613. foreach(Player, i)
  6614. {
  6615. if(P_DATA[i][Level] != 5)
  6616. {
  6617. if(i != playerid)
  6618. {
  6619. P_DATA[i][MutedAll] = 1;
  6620. FormatMSG(i, Color:GREY, "Admin "ORAN"%s[%i]"GREY" muted you and everyone!", Name(playerid), playerid);
  6621. }
  6622. }
  6623. }
  6624. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" muted everyone!", Name(playerid), playerid);
  6625. SendClientMessage(playerid, Color:GREY, "You muted everyone in the server! However, if the re-connect, they will be able to speak.");
  6626. return 1;
  6627. }
  6628. CMD:mute(PARAMS)
  6629. {
  6630. LoginCheck(playerid);
  6631. LevelCheck(playerid, 2);
  6632.  
  6633. 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");
  6634. else
  6635. {
  6636. CheckImune(playerid, params[0]);
  6637. if(params[0] == (0xFFFF)) return SendError(playerid, "Player not connected!");
  6638. if(params[0] == playerid) return SendError(playerid, "You cannot mute yourself!");
  6639. if(P_DATA[params[0]][Muted]) return SendError(playerid, "Player is already muted!");
  6640.  
  6641. if(!params[1])
  6642. {
  6643.  
  6644. P_DATA[params[0]][Muted] = 1;
  6645. P_DATA[params[0]][MutedTime] = 0;
  6646.  
  6647.  
  6648. #if SAVE_MUTE == true
  6649. new
  6650. pQue[256];
  6651.  
  6652. format(pQue, 256, "SELECT `Key` FROM `Muted` WHERE `IP` = '%s'", GetPlayerIPEx(params[0]));
  6653. new DBResult:R1 = DB::Query(_DB, pQue);
  6654.  
  6655. if(R1)
  6656. {
  6657. if(!DB::Valid(R1))
  6658. {
  6659. DB::Free(R1);
  6660. format(pQue, sizeof (pQue), "INSERT INTO `Muted` VALUES (NULL, '%s', '1', '0', '%s')", GetPlayerIPEx(params[0]), Name(params[0]));
  6661. DB::Query(_DB, pQue);
  6662. }
  6663. else
  6664. {
  6665. DB::Free(R1);
  6666. format(pQue, sizeof (pQue), "UPDATE `Muted` SET `Muted` = '1', `Time` = '0', `RealName` = '%s' WHERE `IP` = '%s'", Name(params[0]), GetPlayerIPEx(params[0]));
  6667. DB::Query(_DB, pQue);
  6668. }
  6669. }
  6670.  
  6671. #endif
  6672.  
  6673. SendAdminCMD(playerid, "Admin "ORAN"%s[%i]"GREY" muted player "ORAN"%s[%i]", Name(playerid), playerid, Name(params[0]), params[0], params[1]);
  6674. FormatMSG(playerid, Color:GREY, "You muted "ORAN"%s[%i]", Name(params[0]), params[0]);
  6675. SendClientMessage(params[0], Color:GREY, "You have been muted!");
  6676. }
  6677. else
  6678. {
  6679. P_DATA[params[0]][Muted] = 1;
  6680.  
  6681. 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]);
  6682. FormatMSG(playerid, Color:GREY, "You muted "ORAN"%s[%i] "GREY"["ORAN"Time: "W"%d"GREY" minutes[", Name(params[0]), params[0], params[1]);
  6683. FormatMSG(params[0], Color:GREY, "You have been muted! "W"["GREE"Time: "W"%d"GREY" minutes"W"[", params[1]);
  6684.  
  6685. #if SAVE_MUTE == true
  6686.  
  6687. new
  6688. pQue[256];
  6689.  
  6690. format(pQue, 256, "SELECT `Key` FROM `Muted` WHERE `IP` = '%s'", GetPlayerIPEx(params[0]));
  6691. new DBResult:R1 = DB::Query(_DB, pQue);
  6692.  
  6693. if(R1)
  6694. {
  6695. if(!DB::Valid(R1))
  6696. {
  6697. DB::Free(R1);
  6698. format(pQue, sizeof (pQue), "INSERT INTO `Muted` VALUES (NULL, '%s', '1', '%d', '%s')", GetPlayerIPEx(params[0]), params[1], Name(params[0]));
  6699. DB::Query(_DB, pQue);
  6700. }
  6701. else
  6702. {
  6703. DB::Free(R1);
  6704. format(pQue, sizeof (pQue), "UPDATE `Muted` SET `Muted` = '1', `Time` = '%d', `RealName` = '%s' WHERE `IP` = '%s'", params[1], Name(params[0]), GetPlayerIPEx(params[0]));
  6705. DB::Query(_DB, pQue);
  6706. }
  6707. }
  6708.  
  6709. #endif
  6710.  
  6711. KillTimer(MuteTimer[params[0]]);
  6712. MuteTimer[params[0]] = SetTimerEx("UnMutePlayer", 60_000, true, "i", params[0]);
  6713. P_DATA[params[0]][MutedTime] = params[1];
  6714. }
  6715. }
  6716. return 1;
  6717. }
  6718.  
  6719. CMD:kick(PARAMS)
  6720. {
  6721. LoginCheck(playerid);
  6722. LevelCheck(playerid, 4);
  6723.  
  6724. 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");
  6725. else
  6726. {
  6727. if(playerid == params[0]) return SendError(playerid, "You can't kick yourself!");
  6728. if(params[0] == (0xFFFF)) return SendError(playerid, "Player not connected!");
  6729.  
  6730. CheckImune(playerid, params[0]);
  6731.  
  6732. KickEx(params[0], Name(playerid), params[1], true);
  6733. }
  6734. return 1;
  6735. }
  6736. CMD:unban(PARAMS)
  6737. {
  6738. LoginCheck(playerid);
  6739. LevelCheck(playerid, 5);
  6740.  
  6741. new Account[50];
  6742. if(sscanf(params, "s[50]", Account)) return SendUsage(playerid, "/unban [name]","Will unban a banned account");
  6743. else
  6744. {
  6745. new DBResult:Result, Query[129];
  6746. format(Query, 129, "SELECT `IP` FROM `Banlist` WHERE `Name` = '%s'", Account);
  6747. Result = DB::Query(_DB, Query);
  6748.  
  6749. if(Result)
  6750. {
  6751. if(DB::Valid(Result))
  6752. {
  6753. new fIP[30];
  6754. DB::GetField(Result, "IP", fIP, 30);
  6755.  
  6756. if(strlen(fIP) > 0)
  6757. {
  6758. new Str[50];
  6759. format(Str, sizeof (Str), "unbanip %s", fIP);
  6760. SendRconCommand(Str), SendRconCommand("reloadbans");
  6761. }
  6762. DB::Free(Result);
  6763. format(Query, 129, "DELETE FROM `Banlist` WHERE `Name` = '%s'", Account);
  6764. DB::Query(_DB, Query);
  6765.  
  6766. FormatMSG(playerid, Color:GREY, "Account "ORAN"%s"GREY" has been removed from the Banlist!", Account);
  6767. }
  6768. else
  6769. {
  6770. DB::Free(Result);
  6771. SendError(playerid, "Account not found in the Banlist!");
  6772. return 1;
  6773. }
  6774. }
  6775.  
  6776. }
  6777. return 1;
  6778. }
  6779.  
  6780. CMD:ban(PARAMS)
  6781. {
  6782. LoginCheck(playerid);
  6783. LevelCheck(playerid, 5);
  6784.  
  6785. new Player, IpBan, Reason[40];
  6786. 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");
  6787. else
  6788. {
  6789. if(playerid == Player) return SendError(playerid, "You can't ban yourself!");
  6790. if(Player == (0xFFFF)) return SendError(playerid, "Player not connected!");
  6791. CheckImune(playerid, Player);
  6792.  
  6793. if(IpBan)
  6794. {
  6795. #if SAVE_IN_LOGS == true
  6796. new
  6797. zStr[256],
  6798. File:zFile;
  6799.  
  6800. format(zStr, sizeof (zStr), "Player: %s[%i] has been IP banned by \"%s\" with reason \"%s\" on %s\r\n",
  6801. Name(playerid),
  6802. playerid,
  6803. Name(playerid),
  6804. Reason,
  6805. zDate());
  6806.  
  6807.  
  6808. zFile = fopen(BAN_LOG, io_append);
  6809. if(zFile)
  6810. {
  6811. fwrite(zFile, zStr);
  6812. fclose(zFile);
  6813. }
  6814. #endif
  6815.  
  6816. FormatMSG(playerid, Color:ORAN, "SERVER:"W" You have been banned from this server! "W"["GREY" %s"W"]", Reason);
  6817. BanEx(Player, Reason);
  6818. }
  6819. else
  6820. {
  6821. BanEx2(Player, Name(playerid), Reason);
  6822. FormatMSG(playerid, Color:ORAN, "SERVER:"W" You have been banned from this server! "W"["GREY" %s"W"]", Reason);
  6823. }
  6824. 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);
  6825.  
  6826. }
  6827. return 1;
  6828. }
  6829. stock AntiIP(const string[])
  6830. {
  6831. static
  6832. RegEx:IP;
  6833. if(!IP)IP = regex_build("(.*?)([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})(.*?)");
  6834.  
  6835. return regex_match_exid(string, IP);
  6836. }
  6837. stock AntiSite(const string[])
  6838. {
  6839. static
  6840. RegEx:Site;
  6841. if(!Site)Site = regex_build("([\\w-]*://)?([\\w-]+\\.)+([\\w-]+)(/[^\\s]*)*");
  6842.  
  6843. return regex_match_exid(string, Site);
  6844. }
  6845. public OnPlayerText(playerid, text[])
  6846. {
  6847. if(!P_DATA[playerid][Muted] || !P_DATA[playerid][MutedAll])
  6848. {P_DATA[playerid][Msgs]++;}
  6849.  
  6850. //If player is NOT the RCON admin and NEITHER the OWNER
  6851. if(!IsPlayerAdmin(playerid) && P_DATA[playerid][Level] != 5)
  6852. {
  6853.  
  6854. //Then, take action!
  6855. if((P_DATA[playerid][Muted] || P_DATA[playerid][MutedAll]))
  6856. {
  6857. if(!P_DATA[playerid][MutedTime])
  6858. SendClientMessage(playerid, Color:ORAN, "SERVER:"W" You are not allowed to chat! You have been muted!");
  6859. else
  6860. FormatMSG(playerid, Color:ORAN, "SERVER:"W" You are still muted! "ORAN"["GREY"Aprox: "W"%d minutes"ORAN"]",P_DATA[playerid][MutedTime]);
  6861.  
  6862. return 0;
  6863. }
  6864.  
  6865.  
  6866. if(S_DATA[AntiRepeat])
  6867. {
  6868. if(!isnull(P_DATA[playerid][RepMSG]))
  6869. {
  6870. if(!strcmp(text, P_DATA[playerid][RepMSG], false))
  6871. {
  6872. SendClientMessage(playerid, Color:ORAN, "SERVER:"W" Please don't repeat yourself!");
  6873. SendAdminCMD(playerid, "Player %s[%i] repeated himself!", Name(playerid), playerid);
  6874. return 0;
  6875. }
  6876. }
  6877. format(P_DATA[playerid][RepMSG], 129, text);
  6878. }
  6879. if(S_DATA[Chat])
  6880. {
  6881. return GameTextForPlayer(playerid, "~n~~n~~n~~n~~r~Chat has been disabled!~w~You cannot send any messages!", 5000, 3);
  6882. }
  6883.  
  6884. P_DATA[playerid][SpamMSG] ++;
  6885. if(!P_DATA[playerid][Muted] && S_DATA[AntiSpam])
  6886. {
  6887. if(P_DATA[playerid][SpamMSG] > MAXIMUM_SPAM && !IsPlayerAdmin(playerid))
  6888. return BanEx2(playerid, .zReason = "Extreme Spam!"),false;
  6889.  
  6890. else if(P_DATA[playerid][SpamMSG] > MEDIUM_SPAM)
  6891. return KickEx(playerid, .zReason = "Massive Spam"),false;
  6892.  
  6893. else if(P_DATA[playerid][SpamMSG] > MINIMUM_SPAM)
  6894. {
  6895. P_DATA[playerid][Muted] = 1;
  6896. P_DATA[playerid][MutedTime] = 1;
  6897. SendClientMessage(playerid, Color:ORAN, "SERVER: "W"You have been muted "ORAN"1"W" minutes for spamming the chat!");
  6898.  
  6899. MuteTimer[playerid] = SetTimerEx("UnMutePlayer", 60_000, true, "i", playerid);
  6900.  
  6901. #if SAVE_MUTE == true
  6902.  
  6903. new pQue[256];
  6904.  
  6905. format(pQue, 256, "SELECT `Key` FROM `Muted` WHERE `IP` = '%s'", GetPlayerIPEx(playerid));
  6906. new DBResult:R1 = DB::Query(_DB, pQue);
  6907.  
  6908. if(R1)
  6909. {
  6910. if(!DB::Valid(R1))
  6911. {
  6912. DB::Free(R1);
  6913. format(pQue, sizeof (pQue), "INSERT INTO `Muted` (`IP`, `Muted`, `Time`, `RealName`) VALUES ('%s', '1', '1', '%s')", GetPlayerIPEx(playerid), Name(playerid));
  6914. DB::Query(_DB, pQue);
  6915. }
  6916. else
  6917. {
  6918. DB::Free(R1);
  6919. format(pQue, sizeof (pQue), "UPDATE `Muted` SET `Muted` = '1', `Time` = '2', `RealName` = '%s' WHERE `IP` = '%s'", Name(playerid), GetPlayerIPEx(playerid));
  6920. DB::Query(_DB, pQue);
  6921. }
  6922. }
  6923. #endif
  6924. return 0;
  6925. }
  6926. }
  6927. }
  6928. if(S_DATA[AntiAD])
  6929. {
  6930. if(!P_DATA[playerid][Muted] || !P_DATA[playerid][MutedAll])
  6931. {
  6932. if(P_DATA[playerid][Vip] > 0)
  6933. {
  6934. if(text[0] == VIP_CHAT_SYMBOL || text[0] == VIP_CHAT_SYMBOL2)
  6935. {
  6936. if(!S_DATA[VipChat] && P_DATA[playerid][Level] < 4)
  6937. return SendError(playerid, "Only the Owner and the Administrator of the server can use the VIP Chat.");
  6938.  
  6939. #if SAVE_IN_LOGS == true
  6940. new
  6941. Date[6];
  6942. getdate(Date[0], Date[1], Date[2]);
  6943. gettime(Date[3], Date[4], Date[5]);
  6944. 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]);
  6945. #endif
  6946.  
  6947.  
  6948. new
  6949. iStr[160];
  6950. format(iStr, sizeof (iStr), "#### "GREY"%s:"W" %s", Name(playerid), text[1]);
  6951.  
  6952. foreach(Player, i){
  6953. if(P_DATA[i][Vip] > 0){
  6954. SendClientMessage(i, Color:BLUE, iStr);
  6955. }
  6956. }
  6957. return 0;
  6958. }
  6959. }
  6960. if(P_DATA[playerid][Level] > 0)
  6961. {
  6962. if(text[0] == ADMIN_CHAT_SYMBOL || text[0] == ADMIN_CHAT_SYMBOL2)
  6963. {
  6964. if(!S_DATA[AdminChat] && P_DATA[playerid][Level] < 4)
  6965. return SendError(playerid, "Only the Owner and the Administrator of the server can use the Admin Chat.");
  6966.  
  6967. #if SAVE_IN_LOGS == true
  6968. new
  6969. Date[6];
  6970. getdate(Date[0], Date[1], Date[2]);
  6971. gettime(Date[3], Date[4], Date[5]);
  6972. 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]);
  6973. #endif
  6974.  
  6975.  
  6976. new
  6977. iStr[160];
  6978. format(iStr, sizeof (iStr), "#### "GREY"%s:"W" %s", Name(playerid), text[1]);
  6979.  
  6980. foreach(Player, i){
  6981. if(P_DATA[i][Level] > 0){
  6982. SendClientMessage(i, 0xFF0000FF, iStr);
  6983. }
  6984. }
  6985. return 0;
  6986. }
  6987. }
  6988. if(text[0] != ADMIN_CHAT_SYMBOL || text[0] != ADMIN_CHAT_SYMBOL2)
  6989. {
  6990. if(AntiIP(text) || AntiSite(text))
  6991. {
  6992. P_DATA[playerid][Warns]++;
  6993.  
  6994. SendPlayerMessageToPlayer(playerid, playerid, text);
  6995. FormatMSG(playerid, Color:ORAN, "*** "GREY"You have been warned for advertising! ("ORAN"%d"GREY"/"ORAN""#MAX_P_WARNS""GREY")", P_DATA[playerid][Warns]);
  6996.  
  6997. if(P_DATA[playerid][Warns] >= MAX_P_WARNS)
  6998. {
  6999. SendClientMessage(playerid, Color:ORAN, "*** "GREY"You have been kicked from the server for advertising!");
  7000.  
  7001. foreach(Player, x)
  7002. {
  7003. if(x != playerid)
  7004. {
  7005. FormatMSG(x, Color:ORAN, "*** "GREY"%s has kicked from the server for advertising.", Name(playerid));
  7006. }
  7007. }
  7008. P_DATA[playerid][Warns] = 0;
  7009. KickEx(playerid, .zReason = "Advertising in the chat");
  7010. }
  7011. return 0;
  7012. }
  7013. SendPlayerMessageToAll(playerid, text);
  7014. }
  7015. }
  7016.  
  7017. }else SendPlayerMessageToAll(playerid, text);
  7018.  
  7019. return 0;
  7020. }
  7021.  
  7022. public OnVehicleDeath(vehicleid)
  7023. {
  7024. foreach(Player, InV)
  7025. {
  7026. if(vehicleid == P_DATA[InV][aCar])
  7027. {
  7028. SendError(InV, "Your admin car has been dstroyed!");
  7029. P_DATA[InV][aCar] = -1;
  7030. UpdatePlayer3DTextLabelText(InV, ZaAdminCar[InV], 0xFF0000FF, "Destroyed!\n{000000}--------------\n"W"You can spawn another one!");
  7031. SetTimerEx("dLabel", 4000, false, "i", InV);
  7032. }
  7033. }
  7034. return 1;
  7035. }
  7036. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  7037. {
  7038. if(strlen(GPVSEx(playerid, "Type")))
  7039. {
  7040. if(PRESSED(KEY_FIRE) && !strcmp(GPVSEx(playerid, "Type"), "Unlimited", false))
  7041. {
  7042. if(!IsPlayerInVehicle(playerid, P_DATA[playerid][aCar])) return 0;
  7043.  
  7044. AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
  7045. P_DATA[playerid][NosTimer] = SetTimerEx("UnlimitedNos",17 * 1000, true, "i", playerid);
  7046.  
  7047. }
  7048. else if(RELEASED(KEY_FIRE) && !strcmp(GPVSEx(playerid, "Type"), "Unlimited", false))
  7049. {
  7050. KillTimer(P_DATA[playerid][NosTimer]),
  7051. RemoveVehicleComponent(GetPlayerVehicleID(playerid), 1010);
  7052. }
  7053.  
  7054. if(PRESSED(KEY_FIRE) && strcmp(GPVSEx(playerid, "Type"), "Unlimited", false))
  7055. {
  7056. if(!IsPlayerInVehicle(playerid, P_DATA[playerid][aCar])) return 0;
  7057.  
  7058. AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
  7059. GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~10~g~~h~x~b~~h~ nitro added!", 1500, 3);
  7060. }
  7061. }
  7062. if(P_DATA[playerid][Vip] > 0)
  7063. {
  7064. if(newkeys & KEY_ACTION && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  7065. {
  7066. new Float:V[3];
  7067. GetVehicleVelocity(GetPlayerVehicleID(playerid), V[0], V[1], V[2]);
  7068. if(floatabs(V[0]) < 3 && floatabs(V[1]) < 3 && floatabs(V[2]) < 3)
  7069. {
  7070. SetVehicleVelocity(GetPlayerVehicleID (playerid), V[0] * P_DATA[playerid][bSpeed], V[1] * P_DATA[playerid][bSpeed], V[2] * P_DATA[playerid][bSpeed] );
  7071. }
  7072. }
  7073.  
  7074. if(PRESSED(KEY_LOOK_BEHIND) && P_DATA[playerid][Spin] == 1 && GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  7075. {
  7076. new Float:P[3];
  7077. GetVehiclePos(GetPlayerVehicleID(playerid), P[0], P[1], P[2] );
  7078. SetVehiclePos(GetPlayerVehicleID(playerid), P[0], P[1], P[2] +1 );
  7079. SetVehicleAngularVelocity(GetPlayerVehicleID(playerid), 0.0, 0.0, 3.0);
  7080. GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~r~WOOSH!", 600, 3);
  7081. }
  7082. }
  7083. return 1;
  7084. }
  7085. CMD:bspeed(PARAMS)
  7086. {
  7087. if(P_DATA[playerid][Vip] > 0)
  7088. {
  7089. if(!P_DATA[playerid][Boost])
  7090. return SendError(playerid, "Speed Boost must be activated first! Activate it from "BLUE"/PCP");
  7091.  
  7092. new Speed;
  7093. if(sscanf(params, "d", Speed))
  7094. {
  7095. SendUsage(playerid, "/bspeed "GREY"<speed> "W"(Speed is betwen 0-30)", "Wil change speed boost!");
  7096. return 1;
  7097. }
  7098. else
  7099. {
  7100. switch(P_DATA[playerid][Vip])
  7101. {
  7102. case (1):
  7103. {
  7104. if(Speed < 0 || Speed > 10)
  7105. return SendError(playerid, "Level 1 VIP Members are allowed only up to "BLUE"10"W".");
  7106. }
  7107. case (2):
  7108. {
  7109. if(Speed < 0 || Speed > 20)
  7110. return SendError(playerid, "Level 2 VIP Members are allowed only up to "BLUE"20"W".");
  7111. }
  7112. case (3):
  7113. {
  7114. if(Speed < 0 || Speed > 30)
  7115. return SendError(playerid, "Level 3 VIP Members are allowed only up to "BLUE"30"W".");
  7116. }
  7117. }
  7118. new Float:Speed2 = Speed;
  7119. P_DATA[playerid][bSpeed] = (Speed) ? (Speed2 / 2.367) : (0.0) ;
  7120. P_DATA[playerid][Boost] = 1;
  7121.  
  7122. if(Speed)FormatMSG(playerid, ~1, "Speed Boost set to "BLUE"%d"W" ("BLUE"%.3f"W")", Speed, P_DATA[playerid][bSpeed]);
  7123. else
  7124. {
  7125. P_DATA[playerid][Boost] = 0;
  7126. P_DATA[playerid][bSpeed] = 0;
  7127. SendClientMessage(playerid, Color:ORAN, "Speed Boost disabled!");
  7128. }
  7129. }
  7130. }
  7131. else
  7132. {
  7133. SendError(playerid, "Only VIP members allowed!");
  7134. }
  7135. return 1;
  7136. }
  7137.  
  7138. FormatList(playerid)
  7139. {
  7140. new Str[1024];
  7141. strcat(Str, ""GREY"Name\n\
  7142. "GREY"Money\n\
  7143. "GREY"Score\n\
  7144. "GREY"Cookies\n\
  7145. "GREY"Respect\n\
  7146. "GREY"Kills\n\
  7147. "GREY"Deaths\n\
  7148. "GREY"Messages\n\
  7149. "GREY"Commands\n\
  7150. "GREY"Fail Commands\n\
  7151. "GREY"Online Time\n\
  7152. "GREY"Admin Level\n\
  7153. "GREY"VIP Level\n\
  7154. "GREY"Change Password", 1024);
  7155.  
  7156. if(playerid != GetPVarInt(playerid, "StatsOf"))
  7157. {
  7158. strcat(Str, "\n"ORAN"Ban Account\n\
  7159. "ORAN"Delete Account", 1024);
  7160. }
  7161.  
  7162. return Str;
  7163. }
  7164.  
  7165. FormatInside(playerid, Player, what[] = "z", extra[] = " ", zelse[] =" ")
  7166. {
  7167. new Str[256];
  7168. if(strcmp(what, "z", true))
  7169. {
  7170. if(Player == playerid){
  7171. format(Str, sizeof (Str), ""GREY"Changing "ORAN"your"GREY" %s\n\n"ORAN"%s", what, extra);}
  7172. else{
  7173. format(Str, sizeof (Str), ""GREY"Changing "ORAN"%s"GREY"'s %s\n\n"ORAN"%s", Name(Player), what, extra);}
  7174. }
  7175. else
  7176. 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);
  7177.  
  7178. return Str;
  7179. }
  7180. NameExist(name[])
  7181. {
  7182. foreach(Player, i)
  7183. {
  7184. if(!strcmp(name, Name(i), false)) return 1;
  7185. }
  7186. return 0;
  7187. }
  7188. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  7189. {
  7190. if(playerid != clickedplayerid)
  7191. {
  7192. ShowPlayerDialog(playerid, Dialog:CLICK, LIST, Name(clickedplayerid), ""BLUE"Send Personal Message\n\
  7193. "BLUE"Give Respect\n\
  7194. "BLUE"Give Money\n\
  7195. "BLUE"See Stats\n\
  7196. "ORAN"Report", "Select", "Exit");
  7197. SetPVarInt(playerid, "ClickedTO", clickedplayerid);
  7198. }else SendError(playerid, "Please select someone else other than you!");
  7199. }
  7200. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  7201. {
  7202. new Query[500];
  7203.  
  7204. if(response)
  7205. {
  7206. iDialog<PCP>
  7207. {
  7208. switch(listitem)
  7209. {
  7210. case 1:
  7211. {
  7212. if(S_DATA[AutoLogin])
  7213. {
  7214. P_DATA[playerid][pAuto] = 1;
  7215. SPD(playerid, Dialog:PCPBack, BOX, ""W"Auto-Login", ""BLUE"Auto-Login\n\n"W"This feature has been enabled!", "Back", "");
  7216. }
  7217. else
  7218. {
  7219. P_DATA[playerid][pAuto] = 0;
  7220. SPD(playerid, Dialog:PCPBack, BOX, ""W"Auto-Login", ""BLUE"Auto-Login\n\n"W"This feature is not available!!", "Back", "");
  7221. }
  7222. }
  7223. case 2:
  7224. {
  7225. P_DATA[playerid][BAPMs] = 1;
  7226. SPD(playerid, Dialog:PCPBack, BOX, ""W"Block PM", ""BLUE"Block Personal Messages\n\n"W"This feature has been enabled!", "Back", "");
  7227. }
  7228. case 3:
  7229. {
  7230. cmd_stats(playerid,"");
  7231. }
  7232. case 4: cmd_pcp(playerid, "");
  7233. case 5:
  7234. {
  7235. P_DATA[playerid][God] = 1;
  7236. SPD(playerid, Dialog:PCPBack, BOX, ""W"Godlike", ""BLUE"Godlike\n\n"W"This feature has been enabled!\nYou won't loose health anymore.", "Back", "");
  7237. }
  7238. case 6:
  7239. {
  7240. P_DATA[playerid][CarGod] = 1;
  7241. 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", "");
  7242. }
  7243. case 7:
  7244. {
  7245. P_DATA[playerid][Boost] = 1;
  7246. 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", "");
  7247. }
  7248. case 8:
  7249. {
  7250. P_DATA[playerid][VIPTag] = 1;
  7251. 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", "");
  7252.  
  7253. Delete3DTextLabel(P_DATA[playerid][Tag3D]);
  7254. P_DATA[playerid][Tag3D] = Create3DTextLabel("VIP Member", Color:BLUE, 0.0, 0.0, 0.0, 90.0, 0, 1);
  7255. Attach3DTextLabelToPlayer(P_DATA[playerid][Tag3D], playerid, 0.0, 0.0, 1.2);
  7256. }
  7257. case 9: cmd_pcp(playerid, "");
  7258. case 10:
  7259. {
  7260. P_DATA[playerid][Spin] = 1;
  7261. 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", "");
  7262. }
  7263. case 11:
  7264. {
  7265. for(new i = 0; i < 5; i++)
  7266. if(IsPlayerAttachedObjectSlotUsed(playerid, i))
  7267. RemovePlayerAttachedObject(playerid, i);
  7268.  
  7269. P_DATA[playerid][Incred] = 1;
  7270. SetPlayerAttachedObject(playerid, 0, 18693, 5, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
  7271. SetPlayerAttachedObject(playerid, 1, 18693, 6, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
  7272. SetPlayerAttachedObject(playerid, 2, 18703, 6, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
  7273. SetPlayerAttachedObject(playerid, 3, 18703, 5, 1.983503, 1.558882, -0.129482, 86.705787, 308.978118, 268.198822, 1.500000, 1.500000, 1.500000 );
  7274. SetPlayerAttachedObject(playerid, 4, 18965, 2, 0.111052, 0.021643, -0.000846, 92.280899, 92.752510, 358.071044, 1.200000, 1.283168, 1.200000 );
  7275.  
  7276. SPD(playerid, Dialog:PCPBack, BOX, ""W"Incredible", ""BLUE"Incredible\n\n"W"This feature has been enabled!\nCheck your character!", "Back", "");
  7277. }
  7278. case 12: cmd_pcp(playerid, "");
  7279. case 13:
  7280. {
  7281. SPD(playerid, Dialog:PCPShout, INPUT, ""W"Shout to the server!", ""W"Insert the text you want to shout:", "Insert", "Back");
  7282. }
  7283. }
  7284. }
  7285. }
  7286. else
  7287. {
  7288. iDialog<PCP>
  7289. {
  7290. switch(listitem)
  7291. {
  7292. case 1:
  7293. {
  7294. if(S_DATA[AutoLogin])
  7295. {
  7296. P_DATA[playerid][pAuto] = 0;
  7297. SPD(playerid, Dialog:PCPBack, BOX, ""W"Auto-Login", ""BLUE"Auto-Login\n\n"W"This feature has been disabled!", "Back", "");
  7298. }
  7299. else
  7300. {
  7301. P_DATA[playerid][pAuto] = 0;
  7302. SPD(playerid, Dialog:PCPBack, BOX, ""W"Auto-Login", ""BLUE"Auto-Login\n\n"W"This feature is not available!!", "Back", "");
  7303. }
  7304. }
  7305. case 2:
  7306. {
  7307. P_DATA[playerid][BAPMs] = 0;
  7308. SPD(playerid, Dialog:PCPBack, BOX, ""W"Block PM", ""BLUE"Block Personal Messages\n\n"W"This feature has been disabled!", "Back", "");
  7309. }
  7310. case 3:
  7311. {
  7312. cmd_stats(playerid,"");
  7313. }
  7314. case 4: cmd_pcp(playerid, "");
  7315. case 5:
  7316. {
  7317. P_DATA[playerid][God] = 0;
  7318. SPD(playerid, Dialog:PCPBack, BOX, ""W"Godlike", ""BLUE"Godlike\n\n"W"This feature has been disabled!\nYou will loose health.", "Back", "");
  7319. }
  7320. case 6:
  7321. {
  7322. P_DATA[playerid][CarGod] = 0;
  7323. 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", "");
  7324. }
  7325. case 7:
  7326. {
  7327. P_DATA[playerid][Boost] = 0;
  7328. SPD(playerid, Dialog:PCPBack, BOX, ""W"Vehicle Boost", ""BLUE"Vehicle Boost\n\n"W"This feature has been disabled!", "Back", "");
  7329. }
  7330. case 8:
  7331. {
  7332. P_DATA[playerid][VIPTag] = 0;
  7333. 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", "");
  7334.  
  7335. Delete3DTextLabel(P_DATA[playerid][Tag3D]);
  7336. }
  7337. case 9: cmd_pcp(playerid, "");
  7338. case 10:
  7339. {
  7340. P_DATA[playerid][Spin] = 0;
  7341. SPD(playerid, Dialog:PCPBack, BOX, ""W"Vehicle Spin", ""BLUE"Vehicle Spin\n\n"W"This feature has been disabled!", "Back", "");
  7342. }
  7343. case 11:
  7344. {
  7345. for(new i = 0; i < 5; i++)
  7346. if(IsPlayerAttachedObjectSlotUsed(playerid, i))
  7347. RemovePlayerAttachedObject(playerid, i);
  7348.  
  7349. P_DATA[playerid][Incred] = 0;
  7350.  
  7351. SPD(playerid, Dialog:PCPBack, BOX, ""W"Incredible", ""BLUE"Incredible\n\n"W"This feature has been enabled!\nCheck your character!", "Back", "");
  7352. }
  7353. case 12: cmd_pcp(playerid, "");
  7354. case 13:
  7355. {
  7356. SPD(playerid, Dialog:PCPShout, INPUT, ""W"Shout to the server!", ""W"Insert the text you want to shout:", "Insert", "Back");
  7357. }
  7358. }
  7359. }
  7360. }
  7361.  
  7362. iDialog<PCPBack>
  7363. {
  7364. cmd_pcp(playerid, "");
  7365. }
  7366. iDialog<PCPShout>
  7367. {
  7368. if(response)
  7369. {
  7370. if(strlen(inputtext))
  7371. {
  7372. SendClientMessageToAll(Color:BLUE, inputtext);
  7373. }
  7374. else SPD(playerid, Dialog:PCPShout, INPUT, ""W"Shout to the server!", ""W"Insert the text you want to shout:", "Insert", "Back");
  7375. }
  7376. else cmd_pcp(playerid, "");
  7377. }
  7378. iDialog<CLICK_REPORT>
  7379. {
  7380. if(!IsPlayerConnected(GetPVarInt(playerid, "ClickedTO")))
  7381. {
  7382. SendError(playerid, "Player is no longer connected to the server!");
  7383. DeletePVar(playerid, "ClickedTO");
  7384. return 1;
  7385. }
  7386. if(!response)
  7387. return ShowPlayerDialog(playerid, Dialog:CLICK, LIST, Name(GetPVarInt(playerid, "ClickedTO")), ""BLUE"Send Personal Message\n\
  7388. "BLUE"Give Respect\n\
  7389. "BLUE"Give Money\n\
  7390. "BLUE"See Stats\n\
  7391. "ORAN"Report", "Select", "Exit");
  7392. new
  7393. Report[256];
  7394.  
  7395. if(sscanf(inputtext, "s[256]", Report) || !strlen(Report))
  7396. return SendError(playerid, "Please insert a reason!"),
  7397. OnDialogResponse(playerid, Dialog:CLICK, 1, 4, "");
  7398. else
  7399. {
  7400. if(strlen(Report) < 10)
  7401. return SendError(playerid, "The reason must be at least "BLUE"10"GREY" characters long!"),
  7402. OnDialogResponse(playerid, Dialog:CLICK, 1, 4, "");
  7403. new
  7404. Player = GetPVarInt(playerid, "ClickedTO"),
  7405. Str[256];
  7406.  
  7407. 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);
  7408. SPD(playerid, Dialog:Empty, BOX, ""W"Player reported!", Str, "Close", "");
  7409.  
  7410. foreach(Player, i)
  7411. {
  7412. if(P_DATA[i][Level] > 2)
  7413. {
  7414. if(i != playerid)
  7415. {
  7416. FormatMSG(i, Color:BLUE, "REPORT: "GREY"Player "ORAN"%s[%i]"GREY" reported "ORAN"%s[%i]"GREY"", Name(playerid), playerid, Name(Player), Player);
  7417. FormatMSG(i, Color:GREE, "MESSAGE:"GREY" %s", Report);
  7418. }
  7419. }
  7420. }
  7421.  
  7422. format(Str, sizeof(Str), "\r\n---------------------------------------------------------\r\n\
  7423. Reporter: %s\r\n\
  7424. Reported: %s\r\n\
  7425. Message: %s\r\n\
  7426. Date: %s\r\n\
  7427. ---------------------------------------------------------\r\n",
  7428. Name(playerid),
  7429. Name(Player),
  7430. Report,
  7431. zDate());
  7432. new
  7433. File: ReportLog = fopen(REPORT_LOG, io_append);
  7434.  
  7435. if(ReportLog)
  7436. {
  7437. fwrite(ReportLog, Str);
  7438. fclose(ReportLog);
  7439. }
  7440. }
  7441. }
  7442.  
  7443. iDialog<CLICK_MONEY>
  7444. {
  7445. if(!IsPlayerConnected(GetPVarInt(playerid, "ClickedTO")))
  7446. {
  7447. SendError(playerid, "Player is no longer connected to the server!");
  7448. DeletePVar(playerid, "ClickedTO");
  7449. return 1;
  7450. }
  7451. if(!response)
  7452. return ShowPlayerDialog(playerid, Dialog:CLICK, LIST, Name(GetPVarInt(playerid, "ClickedTO")), ""BLUE"Send Personal Message\n\
  7453. "BLUE"Give Respect\n\
  7454. "BLUE"Give Money\n\
  7455. "BLUE"See Stats\n\
  7456. "ORAN"Report", "Select", "Exit");
  7457. new
  7458. pMoney;
  7459. if(sscanf(inputtext, "i", pMoney) || !pMoney)
  7460. return SendError(playerid, "Please insert a correct value!"),
  7461. OnDialogResponse(playerid, Dialog:CLICK, 1, 2, "");
  7462. else
  7463. {
  7464. new
  7465. Player = GetPVarInt(playerid, "ClickedTO"),
  7466. Str[256];
  7467.  
  7468. if(GetPlayerMoney(playerid) < pMoney)
  7469. return SendError(playerid, "Not enough money to send!"),
  7470. OnDialogResponse(playerid, Dialog:CLICK, 1, 2, "");
  7471.  
  7472. GivePlayerMoney(Player, pMoney);
  7473. GivePlayerMoney(playerid, -pMoney);
  7474.  
  7475. format(Str, sizeof(Str), ""W"You gave a "GREE"$%d"W" to:\n"BLUE"%s"W" ID: "BLUE"%d", pMoney, Name(Player), Player);
  7476. SPD(playerid, Dialog:Empty, BOX, ""W"Money sent!", Str, "Close", "");
  7477. FormatMSG(Player, Color:BLUE, "***"GREY" You received "GREE"$%d"GREY" from player "BLUE"%s[%i]", pMoney, Name(playerid), playerid);
  7478. }
  7479. }
  7480. iDialog<CLICK_RP>
  7481. {
  7482. if(!IsPlayerConnected(GetPVarInt(playerid, "ClickedTO")))
  7483. {
  7484. SendError(playerid, "Player is no longer connected to the server!");
  7485. DeletePVar(playerid, "ClickedTO");
  7486. return 1;
  7487. }
  7488. if(!response)
  7489. return ShowPlayerDialog(playerid, Dialog:CLICK, LIST, Name(GetPVarInt(playerid, "ClickedTO")), ""BLUE"Send Personal Message\n\
  7490. "BLUE"Give Respect\n\
  7491. "BLUE"Give Money\n\
  7492. "BLUE"See Stats\n\
  7493. "ORAN"Report", "Select", "Exit");
  7494. new
  7495. Player = GetPVarInt(playerid, "ClickedTO"),
  7496. Str[256],
  7497. Time[5];
  7498. switch(listitem)
  7499. {
  7500. case (0):
  7501. {
  7502. if(P_DATA[playerid][Vip] != 3)
  7503. {
  7504. format(Query, 256, "SELECT `Key` FROM `Positive` WHERE `Name` = '%s'", Name(playerid));
  7505.  
  7506. new
  7507. DBResult:R2 = DB::Query(_DB, Query);
  7508.  
  7509. gettime(Time[0], Time[1]);
  7510. getdate(.day = Time[2]);
  7511.  
  7512. if(R2)
  7513. {
  7514. if(DB::Valid(R2))
  7515. {
  7516. new
  7517. Field[64],
  7518. T2[3];
  7519.  
  7520. DB::GetField(R2, "Expiration", Field, sizeof (Field));
  7521. DB::Free(R2);
  7522. if(!isnull(Field))
  7523. {
  7524. sscanf(Field, "p<|>iii", Time[2], Time[0], Time[1]);
  7525.  
  7526. gettime(T2[0], T2[1]);
  7527. getdate(.day = T2[2]);
  7528.  
  7529. if(Time[0] == 0) Time[0] = 24;
  7530. if(T2[2] == Time[2])
  7531. {
  7532. if(T2[0] == Time[0])
  7533. {
  7534. if(T2[1] < Time[1])
  7535. {
  7536. SendError(playerid, "You are allowed to give only one "GREE"+"GREY" respect per hour!");
  7537. FormatMSG(playerid, Color:GREY, "You can repeat the process after "BLUE"%d"GREY":"BLUE"%d "GREY"!", Time[0], Time[1]);
  7538. return 1;
  7539. }
  7540. }
  7541. else if(T2[0] < Time[0])
  7542. {
  7543. SendError(playerid, "You are allowed to give only one "GREE"+"GREY" respect per hour!");
  7544. FormatMSG(playerid, Color:GREY, "You can repeat the process after "BLUE"%d"GREY":"BLUE"%d "GREY"!", Time[0], Time[1]);
  7545. return 1;
  7546. }
  7547. }
  7548. }
  7549.  
  7550. 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));
  7551. DB::Query(_DB, Query);
  7552. }
  7553. else
  7554. {
  7555. DB::Free(R2);
  7556. 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]);
  7557. DB::Query(_DB, Query);
  7558. }
  7559. }
  7560.  
  7561. 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);
  7562. }else format(Str, sizeof (Str), ""W"You gave a "GREE"Positive Respect"W" to:\n"BLUE"%s"W" ID: "BLUE"%d", Name(Player), Player);
  7563.  
  7564. P_DATA[Player][Positive] += 1;
  7565. SetPVarInt(Player, "0_Positive", P_DATA[Player][Positive]);
  7566. FormatMSG(Player, Color:ORAN, "*** "GREY"You received a "GREE"+1"GREY" respect from "BLUE"%s[%i]", Name(playerid), playerid);
  7567.  
  7568. SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Respect given", Str, "Close", "");
  7569. }
  7570. case (1):
  7571. {
  7572. if(P_DATA[playerid][Vip] != 3)
  7573. {
  7574. format(Query, 256, "SELECT `Key` FROM `Negative` WHERE `Name` = '%s'", Name(playerid));
  7575.  
  7576. new
  7577. DBResult:R2 = DB::Query(_DB, Query);
  7578.  
  7579. gettime(Time[0], Time[1]);
  7580. getdate(.day = Time[2]);
  7581.  
  7582. if(R2)
  7583. {
  7584. if(DB::Valid(R2))
  7585. {
  7586. new
  7587. Field[64],
  7588. T2[3];
  7589.  
  7590. DB::GetField(R2, "Expiration", Field, sizeof (Field));
  7591. DB::Free(R2);
  7592. if(!isnull(Field))
  7593. {
  7594. sscanf(Field, "p<|>iii", Time[2], Time[0], Time[1]);
  7595.  
  7596. gettime(T2[0], T2[1]);
  7597. getdate(.day = T2[2]);
  7598.  
  7599. if(Time[0] == 0) Time[0] = 24;
  7600. if(T2[2] == Time[2])
  7601. {
  7602. if(T2[0] == Time[0])
  7603. {
  7604. if(T2[1] < Time[1])
  7605. {
  7606. SendError(playerid, "You are allowed to give only one "ORAN"-"GREY" respect per hour!");
  7607. FormatMSG(playerid, Color:GREY, "You can repeat the process after "BLUE"%d"GREY":"BLUE"%d "GREY"!", Time[0], Time[1]);
  7608. return 1;
  7609. }
  7610. }
  7611. else if(T2[0] < Time[0])
  7612. {
  7613. SendError(playerid, "You are allowed to give only one "ORAN"-"GREY" respect per hour!");
  7614. FormatMSG(playerid, Color:GREY, "You can repeat the process after "BLUE"%d"GREY":"BLUE"%d "GREY"!", Time[0], Time[1]);
  7615. return 1;
  7616. }
  7617. }
  7618. }
  7619.  
  7620. 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));
  7621. DB::Query(_DB, Query);
  7622. }
  7623. else
  7624. {
  7625. DB::Free(R2);
  7626. 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]);
  7627. DB::Query(_DB, Query);
  7628. }
  7629. }
  7630. 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);
  7631. }else format(Str, sizeof (Str), ""W"You gave a "ORAN"Negative Respect"W" to:\n"BLUE"%s"W" ID: "BLUE"%d", Name(Player), Player);
  7632.  
  7633. P_DATA[Player][Negative] += 1;
  7634. SetPVarInt(Player, "0_Negative", P_DATA[Player][Negative]);
  7635.  
  7636. FormatMSG(Player, Color:ORAN, "*** "GREY"You received a "ORAN"-1"GREY" respect from "BLUE"%s[%i]", Name(playerid), playerid);
  7637. SPD(playerid, Dialog:Empty, BOX, "{FFFFFF}Respect given", Str, "Close", "");
  7638. }
  7639. }
  7640. }
  7641. iDialog<CLICK_PM>
  7642. {
  7643. if(!response)
  7644. return ShowPlayerDialog(playerid, Dialog:CLICK, LIST, Name(GetPVarInt(playerid, "ClickedTO")), ""BLUE"Send Personal Message\n\
  7645. "BLUE"Give Respect\n\
  7646. "BLUE"Give Money\n\
  7647. "BLUE"See Stats\n\
  7648. "ORAN"Report", "Select", "Exit");
  7649.  
  7650. if(P_DATA[playerid][Muted])
  7651. return ShowPlayerDialog(playerid, Dialog:CLICK, LIST, Name(GetPVarInt(playerid, "ClickedTO")), ""BLUE"Send Personal Message\n\
  7652. "BLUE"Give Respect\n\
  7653. "BLUE"Give Money\n\
  7654. "BLUE"See Stats\n\
  7655. "ORAN"Report", "Select", "Exit"),
  7656. SendError(playerid, "You are still muted! Check with "ORAN"/mutecheck"GREY" to see when it will be lifted!");
  7657.  
  7658. if(!IsPlayerConnected(GetPVarInt(playerid, "ClickedTO")))
  7659. {
  7660. SendError(playerid, "Player is no longer connected to the server!");
  7661. DeletePVar(playerid, "ClickedTO");
  7662. return 1;
  7663. }
  7664. new
  7665. Message[140];
  7666. if(sscanf(inputtext, "s[140]", Message))
  7667. return OnDialogResponse(playerid, Dialog:CLICK, 1, 0, ""),
  7668. SendError(playerid, "Please enter a message to send!");
  7669. else
  7670. {
  7671. if(strlen(Message) < 5)
  7672. return OnDialogResponse(playerid, Dialog:CLICK, 1, 0, ""),
  7673. SendError(playerid, "Message must be at least "BLUE"5"GREY" characters long.");
  7674.  
  7675. new
  7676. Player = GetPVarInt(playerid, "ClickedTO");
  7677.  
  7678. FormatMSG(Player, Color:GREY, "From "BLUE"%s[%i]"W": %s", Name(playerid), playerid, Message);
  7679. FormatMSG(playerid, Color:GREY, "PM Sent to "BLUE"%s[%i]"W": %s", Name(Player), Player, Message);
  7680.  
  7681. if(S_DATA[ReadPM])
  7682. {
  7683. SendAdminCMD(playerid, "PM Detected: "BLUE"%s[%i] "GREY"to"BLUE" %s[%i]", Name(playerid), playerid, Name(Player), Player);
  7684. SendAdminCMD(playerid, "Message: "BLUE"%s", Message);
  7685. }
  7686. }
  7687. }
  7688.  
  7689. iDialog<CLICK>
  7690. {
  7691. if(!response)
  7692. return DeletePVar(playerid, "ClickedTO"),
  7693. false;
  7694.  
  7695. if(!IsPlayerConnected(GetPVarInt(playerid, "ClickedTO")))
  7696. {
  7697. SendError(playerid, "Player is no longer connected to the server!");
  7698. DeletePVar(playerid, "ClickedTO");
  7699. return 1;
  7700. }
  7701. switch(listitem)
  7702. {
  7703. case (0):
  7704. {
  7705. new
  7706. Player = GetPVarInt(playerid, "ClickedTO"),
  7707. Str[129];
  7708.  
  7709. 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);
  7710.  
  7711. SPD(playerid, Dialog:CLICK_PM, INPUT, "{FFFFFF}Send a Personal Message", Str, "Send", "Back");
  7712. }
  7713. case (1): SPD(playerid, Dialog:CLICK_RP, LIST, "{FFFFFF}Select Rspect type", ""GREE"Positive\n"ORAN"Negative", "Select", "Back");
  7714. case (2):
  7715. {
  7716. new
  7717. Player = GetPVarInt(playerid, "ClickedTO"),
  7718. Str[129];
  7719.  
  7720. 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);
  7721.  
  7722. SPD(playerid, Dialog:CLICK_MONEY, INPUT, "{FFFFFF}Send money", Str, "Send", "Back");
  7723. }
  7724. case (3):
  7725. {
  7726. format(WhosStats, sizeof (WhosStats), ""ORAN"%s{FFFFFF}'s stats", Name(GetPVarInt(playerid, "ClickedTO")));
  7727. FormatStats(GetPVarInt(playerid, "ClickedTO"));
  7728. }
  7729. case (4):
  7730. {
  7731. new
  7732. Player = GetPVarInt(playerid, "ClickedTO"),
  7733. Str[129];
  7734.  
  7735. 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);
  7736.  
  7737. SPD(playerid, Dialog:CLICK_REPORT, INPUT, "{FFFFFF}Reporting player", Str, "Send", "Back");
  7738. }
  7739. }
  7740. }
  7741.  
  7742. iDialog<TOP>
  7743. {
  7744. return cmd_top(playerid, "");
  7745. }
  7746. iDialog<TOP_RESPECT>
  7747. {
  7748.  
  7749. if(!response) cmd_top(playerid, "");
  7750. else
  7751. {
  7752. switch(listitem)
  7753. {
  7754. case 0: ShowTopStats(playerid, "Positive", "Respected Players");
  7755. case 1: ShowTopStats(playerid, "Negative", "Disrespected Players");
  7756. }
  7757. }
  7758. }
  7759. iDialog<TOP_SELECT>
  7760. {
  7761. if(!response) return 1;
  7762. else
  7763. {
  7764. switch(listitem)
  7765. {
  7766. case 0: ShowTopStats(playerid, "Kills", "Killers");
  7767. case 1: ShowTopStats(playerid, "Deaths", "Deaths");
  7768. case 2: ShowTopStats(playerid, "Rank", "Ranked");
  7769. case 3: SPD(playerid, Dialog:TOP_RESPECT, LIST, "{FFFFFF}Select type", ""W"Positive\n"W"Negative", "Select", "Back");
  7770. case 4: ShowTopStats(playerid, "Hours", "Hours");
  7771. case 5:
  7772. {
  7773. new Speed = GetTickCount(),
  7774. DialString[3_0_0_0],
  7775. String[2][128],
  7776. sQuery[2][256],
  7777. DBResult:Result1;
  7778.  
  7779. format(sQuery[0], 256, "SELECT `Name` FROM `Top` ORDER BY (`Ratio` * 1) DESC limit %d", MAX_TOP_LIMIT);
  7780.  
  7781. Result1 = DB::Query(_DB, sQuery[0]);
  7782.  
  7783. format(DialString, sizeof (DialString), "{FFFFFF}Server top "ORAN" Kills/Deaths ratio\n\n\n"W"Pos. Player = Ratio");
  7784. for (new Qr; Qr < DB::Valid(Result1); Qr++)
  7785. {
  7786. db_get_field(Result1, 0, String[0], 128);
  7787.  
  7788. format(sQuery[1], 256, "SELECT `Ratio` FROM `Top` WHERE `Name` = '%s'", String[0]);
  7789.  
  7790. new DBResult:Result2 = DB::Query(_DB, sQuery[1]);
  7791. db_get_field(Result2, 0, String[1], 128);
  7792.  
  7793. format(DialString, sizeof (DialString), "%s\n"BLUE"%d."GREY" %s "W": %s", DialString, Qr + 1, String[0], String[1]);
  7794.  
  7795. db_next_row(Result1);
  7796. DB::Free(Result2);
  7797. }
  7798. DB::Free(Result1);
  7799. format(DialString, sizeof (DialString), "%s\n\n"W"Top list generated in "ORAN"%d "W"ms.", DialString, GetTickCount() - Speed);
  7800. SPD(playerid, Dialog:TOP, BOX, ""W"TOP PLAYERS", DialString, "Close", "");
  7801. }
  7802. }
  7803. }
  7804. }
  7805.  
  7806. switch(dialogid)
  7807. {
  7808. CaseDialog<NAME>
  7809. {
  7810. if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  7811.  
  7812. new
  7813. NewName[MAX_PLAYER_NAME];
  7814. if(sscanf(inputtext, "s["#MAX_PLAYER_NAME"]", NewName))
  7815. {
  7816. OnDialogResponse(playerid, Dialog:SetStatsTrue, 1, NAME, "");
  7817. return 1;
  7818. }
  7819. else
  7820. {
  7821. if(strlen(NewName) > MAX_PLAYER_NAME || strlen(NewName) < 5)
  7822. return SendError(playerid, "Invalid name length! Max: "ORAN""#MAX_PLAYER_NAME""GREY" Min: "ORAN"5"),
  7823. OnDialogResponse(playerid, Dialog:SetStatsTrue, 1, NAME, "");
  7824.  
  7825. new
  7826. Player = GetPVarInt(playerid, "StatsOf");
  7827.  
  7828. if(Player == 0xFFFF)
  7829. return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
  7830.  
  7831. if(NameExist(NewName))
  7832. return SendError(playerid, "The name entered is already used by someone else!"),
  7833. OnDialogResponse(playerid, Dialog:SetStatsTrue, 1, NAME, "");
  7834.  
  7835. if(Player != playerid)
  7836. {
  7837. FormatMSG(playerid, Color:GREY, "You changed the name of "ORAN"%s"GREY" to "ORAN"%s"GREY"", Name(Player), NewName);
  7838. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" changed your name to "ORAN"%s"GREY"", Name(playerid), playerid, NewName);
  7839. }
  7840. 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!");}
  7841. SetPlayerName(Player, NewName);
  7842.  
  7843. OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  7844. }
  7845. }
  7846. CaseDialog<MONEY>
  7847. {
  7848. if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  7849.  
  7850. if(sscanf(inputtext, "d", inputtext[0]))
  7851. {
  7852. OnDialogResponse(playerid, Dialog:SetStatsTrue, 1, MONEY, "");
  7853. return 1;
  7854. }
  7855. else
  7856. {
  7857. new
  7858. Player = GetPVarInt(playerid, "StatsOf");
  7859.  
  7860. if(Player == 0xFFFF)
  7861. return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
  7862.  
  7863. ResetPlayerMoney(Player), GivePlayerMoney(Player, inputtext[0]);
  7864. OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  7865.  
  7866. if(Player != playerid)
  7867. {
  7868. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s money to "ORAN"$%d"GREY"", Name(Player), inputtext[0]);
  7869. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your money to "ORAN"$%d"GREY"", Name(playerid), playerid, inputtext[0]);
  7870. }
  7871. else
  7872. FormatMSG(playerid, Color:GREY, "You set your money to "ORAN"$%d"GREY" ", inputtext[0]);
  7873.  
  7874. }
  7875. }
  7876. CaseDialog<SCORE>
  7877. {
  7878. if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  7879.  
  7880. if(sscanf(inputtext, "d", inputtext[0]))
  7881. {
  7882. OnDialogResponse(playerid, Dialog:SetStatsTrue, 1, SCORE, "");
  7883. return 1;
  7884. }
  7885. else
  7886. {
  7887. new
  7888. Player = GetPVarInt(playerid, "StatsOf");
  7889.  
  7890. if(Player == 0xFFFF)
  7891. return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
  7892.  
  7893. SetPlayerScore(Player, inputtext[0]);
  7894. OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  7895.  
  7896. if(Player != playerid)
  7897. {
  7898. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s score to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
  7899. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your score to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
  7900. }
  7901. else
  7902. FormatMSG(playerid, Color:GREY, "You set your score to "ORAN"%d"GREY" ", inputtext[0]);
  7903.  
  7904. }
  7905. }
  7906. CaseDialog<COOKIES>
  7907. {
  7908. if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  7909.  
  7910. if(sscanf(inputtext, "d", inputtext[0]))
  7911. {
  7912. OnDialogResponse(playerid, Dialog:SetStatsTrue, 1, COOKIES, "");
  7913. return 1;
  7914. }
  7915. else
  7916. {
  7917. new
  7918. Player = GetPVarInt(playerid, "StatsOf");
  7919.  
  7920. if(Player == 0xFFFF)
  7921. return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
  7922.  
  7923. SetPVarInt(Player, "0_Cookies", inputtext[0]);
  7924. P_DATA[Player][Cookies] = inputtext[0];
  7925.  
  7926. OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  7927.  
  7928. if(Player != playerid)
  7929. {
  7930. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s cookies to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
  7931. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your cookies to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
  7932. }
  7933. else
  7934. FormatMSG(playerid, Color:GREY, "You set your cookies to "ORAN"%d"GREY" ", inputtext[0]);
  7935.  
  7936. }
  7937. }
  7938. CaseDialog<RESPECT>
  7939. {
  7940. if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  7941.  
  7942. new
  7943. _2DS[2][129],
  7944. _Dialog,
  7945. Player = GetPVarInt(playerid, "StatsOf");
  7946.  
  7947. if(Player == 0xFFFF)
  7948. return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
  7949.  
  7950. switch(listitem)
  7951. {
  7952. case 0:{ if(Player != playerid)format(_2DS[0], 129, "Changing "ORAN"%s"GREY"'s Positive Respect\nPlease insert your respect value:", Name(Player));
  7953. else _2DS[0] = "Changing "ORAN"your"GREY"'s Positive Respect\nPlease insert your respect value:";
  7954. _2DS[1] = "{FFFFFF}Changing Positive"; _Dialog = Dialog:RESPECT_POS;}
  7955.  
  7956.  
  7957. case 1:{ if(Player != playerid)format(_2DS[0], 129, "Changing "ORAN"%s"GREY"'s Negative Respect\nPlease insert your respect value:", Name(Player));
  7958. else _2DS[0] = "Changing "ORAN"your"GREY"'s Positive Respect\nPlease insert your respect value:";
  7959. _2DS[1] = "{FFFFFF}Changing Negative" ; _Dialog = Dialog:RESPECT_NEG;}
  7960. }
  7961. SPD(playerid, _Dialog, INPUT, _2DS[1], _2DS[0], "Set", "Back");
  7962. }
  7963. CaseDialog<RESPECT_POS>
  7964. {
  7965. if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  7966.  
  7967. if(sscanf(inputtext, "d", inputtext[0]))
  7968. {
  7969. OnDialogResponse(playerid, Dialog:SetStatsTrue, true, 0, "");
  7970. return 1;
  7971. }
  7972. else
  7973. {
  7974. new
  7975. Player = GetPVarInt(playerid, "StatsOf");
  7976.  
  7977. if(Player == 0xFFFF)
  7978. return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
  7979.  
  7980. SetPVarInt(Player, "0_Positive", inputtext[0]);
  7981. P_DATA[Player][Positive] = inputtext[0];
  7982.  
  7983. OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  7984.  
  7985. if(Player != playerid)
  7986. {
  7987. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s Positive Respect to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
  7988. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your Positive Respect to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
  7989. }
  7990. else
  7991. FormatMSG(playerid, Color:GREY, "You set your Positive Respect to "ORAN"%d"GREY" ", inputtext[0]);
  7992.  
  7993. #if UPDATE_TOP_ALWAYS == true
  7994. new DBResult: R1;
  7995. format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(Player));
  7996. R1 = DB::Query(_DB, Query);
  7997.  
  7998. if(R1)
  7999. {
  8000. if(DB::Valid(R1))
  8001. {
  8002. DB::Free(R1);
  8003. format(Query, sizeof(Query), "UPDATE `Top` SET `Positive` = '%d' WHERE `Name` = '%s'", inputtext[0], Name(Player));
  8004. DB::Query(_DB, Query);
  8005. }
  8006. else
  8007. {
  8008. DB::Free(R1);
  8009. format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`,`Positive`) VALUES('%s','%d')", Name(Player), inputtext[0]);
  8010. DB::Query(_DB, Query);
  8011. }
  8012. }
  8013. #endif
  8014. }
  8015. }
  8016. CaseDialog<RESPECT_NEG>
  8017. {
  8018. if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  8019.  
  8020. if(sscanf(inputtext, "d", inputtext[0]))
  8021. {
  8022. OnDialogResponse(playerid, Dialog:SetStatsTrue, true, 1, "");
  8023. return 1;
  8024. }
  8025. else
  8026. {
  8027. new
  8028. Player = GetPVarInt(playerid, "StatsOf");
  8029.  
  8030. if(Player == 0xFFFF)
  8031. return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
  8032.  
  8033. SetPVarInt(Player, "0_Negative", inputtext[0]);
  8034. P_DATA[Player][Negative] = inputtext[0];
  8035.  
  8036. OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  8037.  
  8038. if(Player != playerid)
  8039. {
  8040. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s Negative Respect to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
  8041. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your Negative Respect to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
  8042. }
  8043. else
  8044. FormatMSG(playerid, Color:GREY, "You set your Negative Respect to "ORAN"%d"GREY" ", inputtext[0]);
  8045.  
  8046. #if UPDATE_TOP_ALWAYS == true
  8047. new DBResult: R1;
  8048.  
  8049. format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(Player));
  8050. R1 = DB::Query(_DB, Query);
  8051.  
  8052. if(R1)
  8053. {
  8054. if(DB::Valid(R1))
  8055. {
  8056. DB::Free(R1);
  8057. format(Query, sizeof(Query), "UPDATE `Top` SET `Negative` = '%d' WHERE `Name` = '%s'", inputtext[0], Name(Player));
  8058. DB::Query(_DB, Query);
  8059. }
  8060. else
  8061. {
  8062. DB::Free(R1);
  8063. format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`,`Negative`) VALUES('%s','%d')", Name(Player),inputtext[0]);
  8064. DB::Query(_DB, Query);
  8065. }
  8066. }
  8067. #endif
  8068. }
  8069. }
  8070. CaseDialog<KILLS>
  8071. {
  8072. if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  8073.  
  8074. if(sscanf(inputtext, "d", inputtext[0]))
  8075. {
  8076. OnDialogResponse(playerid, Dialog:SetStatsTrue, true, KILLS, "");
  8077. return 1;
  8078. }
  8079. else
  8080. {
  8081. new
  8082. Player = GetPVarInt(playerid, "StatsOf");
  8083.  
  8084. if(Player == 0xFFFF)
  8085. return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
  8086.  
  8087. SetPVarInt(Player, "0_Kills", inputtext[0]);
  8088. P_DATA[Player][Kills] = inputtext[0];
  8089.  
  8090. OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  8091.  
  8092. if(Player != playerid)
  8093. {
  8094. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s kills to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
  8095. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your kills to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
  8096. }
  8097. else
  8098. FormatMSG(playerid, Color:GREY, "You set your kills to "ORAN"%d"GREY" ", inputtext[0]);
  8099.  
  8100. #if UPDATE_TOP_ALWAYS == true
  8101. new DBResult: R1;
  8102.  
  8103. format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(Player));
  8104. R1 = DB::Query(_DB, Query);
  8105.  
  8106. if(R1)
  8107. {
  8108. if(DB::Valid(R1))
  8109. {
  8110. DB::Free(R1);
  8111. 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));
  8112. DB::Query(_DB, Query);
  8113. }
  8114. else
  8115. {
  8116. DB::Free(R1);
  8117. 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]));
  8118. DB::Query(_DB, Query);
  8119. }
  8120. }
  8121. #endif
  8122. }
  8123. }
  8124. CaseDialog<DEATHS>
  8125. {
  8126. if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  8127.  
  8128. if(sscanf(inputtext, "d", inputtext[0]))
  8129. {
  8130. OnDialogResponse(playerid, Dialog:SetStatsTrue, true, DEATHS, "");
  8131. return 1;
  8132. }
  8133. else
  8134. {
  8135. new
  8136. Player = GetPVarInt(playerid, "StatsOf");
  8137.  
  8138. if(Player == 0xFFFF)
  8139. return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
  8140.  
  8141. SetPVarInt(Player, "0_Deaths", inputtext[0]);
  8142. P_DATA[Player][Deaths] = inputtext[0];
  8143.  
  8144. OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  8145.  
  8146. if(Player != playerid)
  8147. {
  8148. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s deaths to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
  8149. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your deaths to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
  8150. }
  8151. else
  8152. FormatMSG(playerid, Color:GREY, "You set your deaths to "ORAN"%d"GREY" ", inputtext[0]);
  8153.  
  8154. #if UPDATE_TOP_ALWAYS == true
  8155. new DBResult: R1;
  8156.  
  8157. format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(Player));
  8158. R1 = DB::Query(_DB, Query);
  8159.  
  8160. if(R1)
  8161. {
  8162. if(DB::Valid(R1))
  8163. {
  8164. DB::Free(R1);
  8165. 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));
  8166. DB::Query(_DB, Query);
  8167. }
  8168. else
  8169. {
  8170. DB::Free(R1);
  8171. 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]));
  8172. DB::Query(_DB, Query);
  8173. }
  8174. }
  8175. #endif
  8176. }
  8177. }
  8178. CaseDialog<MESSAGES>
  8179. {
  8180. if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  8181.  
  8182. if(sscanf(inputtext, "d", inputtext[0]))
  8183. {
  8184. OnDialogResponse(playerid, Dialog:SetStatsTrue, true, MESSAGES, "");
  8185. return 1;
  8186. }
  8187. else
  8188. {
  8189. new
  8190. Player = GetPVarInt(playerid, "StatsOf");
  8191.  
  8192. if(Player == 0xFFFF)
  8193. return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
  8194.  
  8195. SetPVarInt(Player, "0_Messages", inputtext[0]);
  8196. P_DATA[Player][Msgs] = inputtext[0];
  8197.  
  8198. OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  8199.  
  8200. if(Player != playerid)
  8201. {
  8202. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s sent messages to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
  8203. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your sent messages to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
  8204. }
  8205. else
  8206. FormatMSG(playerid, Color:GREY, "You set your sent messages to "ORAN"%d"GREY" ", inputtext[0]);
  8207.  
  8208. }
  8209. }
  8210. CaseDialog<COMMANDS>
  8211. {
  8212. if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  8213.  
  8214. if(sscanf(inputtext, "d", inputtext[0]))
  8215. {
  8216. OnDialogResponse(playerid, Dialog:SetStatsTrue, true, COMMANDS, "");
  8217. return 1;
  8218. }
  8219. else
  8220. {
  8221. new
  8222. Player = GetPVarInt(playerid, "StatsOf");
  8223.  
  8224. if(Player == 0xFFFF)
  8225. return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
  8226.  
  8227. SetPVarInt(Player, "0_Commands", inputtext[0]);
  8228. P_DATA[Player][Cmds] = inputtext[0];
  8229.  
  8230. OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  8231.  
  8232. if(Player != playerid)
  8233. {
  8234. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s used commands to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
  8235. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your used commands to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
  8236. }
  8237. else
  8238. FormatMSG(playerid, Color:GREY, "You set your used commands to "ORAN"%d"GREY" ", inputtext[0]);
  8239.  
  8240. }
  8241. }
  8242. CaseDialog<FCOMMANDS>
  8243. {
  8244. if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  8245.  
  8246. if(sscanf(inputtext, "d", inputtext[0]))
  8247. {
  8248. OnDialogResponse(playerid, Dialog:SetStatsTrue, true, FCOMMANDS, "");
  8249. return 1;
  8250. }
  8251. else
  8252. {
  8253. new
  8254. Player = GetPVarInt(playerid, "StatsOf");
  8255.  
  8256. if(Player == 0xFFFF)
  8257. return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
  8258.  
  8259. SetPVarInt(Player, "0_Fail_Commands", inputtext[0]);
  8260. P_DATA[Player][fCmds] = inputtext[0];
  8261.  
  8262. OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  8263.  
  8264. if(Player != playerid)
  8265. {
  8266. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s fail commands to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
  8267. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your fail commands to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
  8268. }
  8269. else
  8270. FormatMSG(playerid, Color:GREY, "You set your fail commands to "ORAN"%d"GREY" ", inputtext[0]);
  8271.  
  8272. }
  8273. }
  8274. CaseDialog<ONLINE>
  8275. {
  8276. if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  8277.  
  8278. new
  8279. _2DS2[2][129],
  8280. _Dialog,
  8281. Player = GetPVarInt(playerid, "StatsOf");
  8282.  
  8283. if(Player == 0xFFFF)
  8284. return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
  8285.  
  8286. switch(listitem)
  8287. {
  8288. case 0:{ if(Player != playerid)format(_2DS2[0], 129, ""GREY"Changing "ORAN"%s"GREY"'s Hours\nPlease insert the hour value:", Name(Player));
  8289. else _2DS2[0] = ""GREY"Changing "ORAN"your"GREY" Hours\nPlease insert the hour value:";
  8290. _2DS2[1] = "{FFFFFF}Changing Hours" ; _Dialog = Dialog:ONLINE_H; }
  8291.  
  8292. case 1:{ if(Player != playerid)format(_2DS2[0], 129, ""GREY"Changing "ORAN"%s"GREY"'s Minutes\nPlease insert the hour value:", Name(Player));
  8293. else _2DS2[0] = ""GREY"Changing "ORAN"your"GREY" Minutes\nPlease insert the hour value:";
  8294. _2DS2[1] = "{FFFFFF}Changing Minutes" ; _Dialog = Dialog:ONLINE_M;}
  8295.  
  8296. case 2:{ if(Player != playerid)format(_2DS2[0], 129, ""GREY"Changing "ORAN"%s"GREY"'s Seconds\nPlease insert the hour value:", Name(Player));
  8297. else _2DS2[0] = ""GREY"Changing "ORAN"your"GREY" Seconds\nPlease insert the hour value:";
  8298. _2DS2[1] = "{FFFFFF}Changing Seconds" ; _Dialog = Dialog:ONLINE_S;}
  8299. }
  8300. SPD(playerid, _Dialog, INPUT, _2DS2[1], _2DS2[0], "Set", "Back");
  8301. }
  8302. CaseDialog<ONLINE_H>
  8303. {
  8304. if(!response) return OnDialogResponse(playerid, Dialog:SetStatsTrue, true, ONLINE, "");
  8305.  
  8306. if(sscanf(inputtext, "d", inputtext[0]))
  8307. {
  8308. OnDialogResponse(playerid, Dialog:ONLINE, true, 0, "");
  8309. return 1;
  8310. }
  8311. else
  8312. {
  8313. new
  8314. Player = GetPVarInt(playerid, "StatsOf");
  8315.  
  8316. if(Player == 0xFFFF)
  8317. return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
  8318.  
  8319. P_DATA[Player][Hours] = inputtext[0];
  8320. P_DATA[Player][ConnTime] = gettime();
  8321.  
  8322. OnDialogResponse(playerid, Dialog:SetStatsTrue, true, ONLINE, "");
  8323.  
  8324. if(Player != playerid)
  8325. {
  8326. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s online hours to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
  8327. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your online hours to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
  8328. }
  8329. else
  8330. FormatMSG(playerid, Color:GREY, "You set your online hours to "ORAN"%d"GREY" ", inputtext[0]);
  8331.  
  8332. #if UPDATE_TOP_ALWAYS == true
  8333. new DBResult: R1;
  8334.  
  8335. format(Query, sizeof(Query), "SELECT `Key` FROM `Top` WHERE `Name` = '%s'", Name(Player));
  8336. R1 = DB::Query(_DB, Query);
  8337.  
  8338. if(R1)
  8339. {
  8340. if(DB::Valid(R1))
  8341. {
  8342. DB::Free(R1);
  8343. format(Query, sizeof(Query), "UPDATE `Top` SET `Hours` = '%d' WHERE `Name` = '%s'", inputtext[0], Name(Player));
  8344. DB::Query(_DB, Query);
  8345. }
  8346. else
  8347. {
  8348. DB::Free(R1);
  8349. format(Query, sizeof(Query), "INSERT INTO `Top` (`Name`, `Hours`) VALUES('%s','%d')",Name(Player), inputtext[0]);
  8350. DB::Query(_DB, Query);
  8351. }
  8352. }
  8353. #endif
  8354.  
  8355. }
  8356. }
  8357. CaseDialog<ONLINE_M>
  8358. {
  8359. if(!response) return OnDialogResponse(playerid, Dialog:SetStatsTrue, true, ONLINE, "");
  8360.  
  8361. if(sscanf(inputtext, "d", inputtext[0]))
  8362. {
  8363. OnDialogResponse(playerid, Dialog:ONLINE, true, 1, "");
  8364. return 1;
  8365. }
  8366. else
  8367. {
  8368. if(inputtext[0] > 60 || inputtext[0] < 0)
  8369. return OnDialogResponse(playerid, Dialog:ONLINE, true, 1, ""),
  8370. SendError(playerid, "Minutes must be from "ORAN"0"GREY" to "ORAN"60"GREY".");
  8371. new
  8372. Player = GetPVarInt(playerid, "StatsOf");
  8373.  
  8374. if(Player == 0xFFFF)
  8375. return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
  8376.  
  8377. P_DATA[Player][Minutes] = inputtext[0];
  8378. P_DATA[Player][ConnTime] = gettime();
  8379.  
  8380. OnDialogResponse(playerid, Dialog:SetStatsTrue, true, ONLINE, "");
  8381.  
  8382. if(Player != playerid)
  8383. {
  8384. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s online minutes to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
  8385. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your online minutes to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
  8386. }
  8387. else
  8388. FormatMSG(playerid, Color:GREY, "You set your online minutes to "ORAN"%d"GREY" ", inputtext[0]);
  8389.  
  8390. }
  8391. }
  8392. CaseDialog<ONLINE_S>
  8393. {
  8394. if(!response) return OnDialogResponse(playerid, Dialog:SetStatsTrue, true, ONLINE, "");
  8395.  
  8396. if(sscanf(inputtext, "d", inputtext[0]))
  8397. {
  8398. OnDialogResponse(playerid, Dialog:ONLINE, true, 2, "");
  8399. return 1;
  8400. }
  8401. else
  8402. {
  8403. if(inputtext[0] > 60 || inputtext[0] < 0)
  8404. return OnDialogResponse(playerid, Dialog:ONLINE, true, 2, ""),
  8405. SendError(playerid, "Seconds must be from "ORAN"0"GREY" to "ORAN"60"GREY".");
  8406. new
  8407. Player = GetPVarInt(playerid, "StatsOf");
  8408.  
  8409. if(Player == 0xFFFF)
  8410. return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
  8411.  
  8412. P_DATA[Player][Seconds] = inputtext[0];
  8413. P_DATA[Player][ConnTime] = gettime();
  8414.  
  8415. OnDialogResponse(playerid, Dialog:SetStatsTrue, true, ONLINE, "");
  8416.  
  8417. if(Player != playerid)
  8418. {
  8419. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s online seonds to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
  8420. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your online seonds to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
  8421. }
  8422. else
  8423. FormatMSG(playerid, Color:GREY, "You set your online seonds to "ORAN"%d"GREY" ", inputtext[0]);
  8424.  
  8425. }
  8426. }
  8427. CaseDialog<LEVEL>
  8428. {
  8429. if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  8430.  
  8431. if(sscanf(inputtext, "d", inputtext[0]))
  8432. {
  8433. OnDialogResponse(playerid, Dialog:SetStatsTrue, true, LEVEL, "");
  8434. return 1;
  8435. }
  8436. else
  8437. {
  8438. new
  8439. Player = GetPVarInt(playerid, "StatsOf");
  8440.  
  8441. if(Player == 0xFFFF)
  8442. return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
  8443.  
  8444. if(inputtext[0] < 0 || inputtext[0] > 5)
  8445. return OnDialogResponse(playerid, Dialog:SetStatsTrue, true, LEVEL, ""),
  8446. SendError(playerid, "Invalid level! Min. "ORAN"0"GREY" Max. "ORAN"5");
  8447.  
  8448. SetPVarInt(Player, "0_Level", inputtext[0]);
  8449. P_DATA[Player][Level] = inputtext[0];
  8450.  
  8451. OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  8452.  
  8453. if(Player != playerid)
  8454. {
  8455. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY" as "ORAN"%s"GREY" of the server!", Name(Player), LevelName(inputtext[0]));
  8456. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s"GREY" set you as "ORAN"%s"GREY" of the server!", Name(playerid), playerid, LevelName(inputtext[0]));
  8457. }
  8458. else
  8459. FormatMSG(playerid, Color:GREY, "You set yourself as "ORAN"%s"GREY" of the server!", LevelName(inputtext[0]));
  8460.  
  8461. }
  8462. }
  8463. CaseDialog<VLEVEL>
  8464. {
  8465. if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  8466.  
  8467. if(sscanf(inputtext, "d", inputtext[0]))
  8468. {
  8469. OnDialogResponse(playerid, Dialog:SetStatsTrue, true, VLEVEL, "");
  8470. return 1;
  8471. }
  8472. else
  8473. {
  8474. new
  8475. Player = GetPVarInt(playerid, "StatsOf");
  8476.  
  8477. if(Player == 0xFFFF)
  8478. return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
  8479.  
  8480. if(inputtext[0] < 0 || inputtext[0] > 3)
  8481. return OnDialogResponse(playerid, Dialog:SetStatsTrue, true, LEVEL, ""),
  8482. SendError(playerid, "Invalid level! Min. "ORAN"0"GREY" Max. "ORAN"3");
  8483.  
  8484. SetPVarInt(Player, "0_Vip", inputtext[0]);
  8485. P_DATA[Player][Vip] = inputtext[0];
  8486.  
  8487. OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  8488.  
  8489. if(Player != playerid)
  8490. {
  8491. FormatMSG(playerid, Color:GREY, "You set "ORAN"%s"GREY"'s VIP Level to "ORAN"%d"GREY"", Name(Player), inputtext[0]);
  8492. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s[%i]"GREY" set your VIP Level to "ORAN"%d"GREY"", Name(playerid), playerid, inputtext[0]);
  8493. }
  8494. else
  8495. FormatMSG(playerid, Color:GREY, "You set your VIP Level to "ORAN"%d"GREY" ", inputtext[0]);
  8496.  
  8497. }
  8498. }
  8499. CaseDialog<CPASS>
  8500. {
  8501. if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  8502.  
  8503. new NewPass[30];
  8504. if(sscanf(inputtext, "s[30]", NewPass))
  8505. {
  8506. OnDialogResponse(playerid, Dialog:SetStatsTrue, true, CPASS, "");
  8507. return 1;
  8508. }
  8509. else
  8510. {
  8511. new
  8512. Player = GetPVarInt(playerid, "StatsOf");
  8513.  
  8514. if(Player == 0xFFFF)
  8515. return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
  8516.  
  8517. if(strlen(NewPass) < MIN_PASS_LEN || strlen(NewPass) > MAX_PASS_LEN)
  8518. return SendError(playerid, "An error has occured. Invalid Password length!"),
  8519. OnDialogResponse(playerid, Dialog:SetStatsTrue, true, CPASS, "");
  8520.  
  8521. new Buf[129];
  8522.  
  8523. WP_Hash(Buf, (129), NewPass);
  8524. format(Query, 280, "UPDATE `Accounts` SET `Password` = '%s' WHERE `Name` = '%s'", Buf, Name(Player));
  8525. DB::Query(_DB, Query);
  8526.  
  8527.  
  8528. if(Player != playerid)
  8529. FormatMSG(playerid, Color:GREY, "You changed "ORAN"%s"GREY"'s password to "ORAN"%s", Name(Player), NewPass);
  8530. else
  8531. FormatMSG(playerid, Color:GREY, "You changed your password to "ORAN"%s", NewPass);
  8532. }
  8533. }
  8534. CaseDialog<BACCOUNT>
  8535. {
  8536. if(!response) return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  8537.  
  8538. new Reason[129];
  8539. if(sscanf(inputtext, "s[129]", Reason))
  8540. {
  8541. OnDialogResponse(playerid, Dialog:SetStatsTrue, true, BACCOUNT, "");
  8542. return 1;
  8543. }
  8544. else
  8545. {
  8546. if(strlen(Reason) < 5 || strlen(Reason) > 129)
  8547. return SendError(playerid, "The reason must be Min. "ORAN"5"GREY" Max. "ORAN"129"GREY" characters long!"),
  8548. OnDialogResponse(playerid, Dialog:SetStatsTrue, true, BACCOUNT, "");
  8549.  
  8550. new
  8551. Player = GetPVarInt(playerid, "StatsOf");
  8552.  
  8553. if(Player == 0xFFFF)
  8554. return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
  8555.  
  8556. format(Query, 129, "INSERT INTO `Banlist` VALUES('%s', '%s', '%s', '%s', '%s')", GetPlayerIPEx(Player), Name(Player), Reason, Name(playerid), zDate());
  8557. DB::Query(_DB, Query);
  8558.  
  8559. OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  8560.  
  8561. if(Player != playerid)
  8562. {
  8563. FormatMSG(playerid, Color:GREY, "You banned "ORAN"%s"GREY"'s account with reason "ORAN"%s", Name(Player), Reason);
  8564. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s"GREY" banned your account with reason:", Name(playerid));
  8565. FormatMSG(Player, Color:GREY, "REASON: "ORAN"%s",Reason);
  8566. }
  8567. else
  8568. return 0;
  8569.  
  8570. KickEx(Player, "System", "Account banned with [/setstats]", false);
  8571. }
  8572. }
  8573. CaseDialog<DACCOUNT>
  8574. {
  8575. if(!response)
  8576. return OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  8577.  
  8578. new
  8579. Player = GetPVarInt(playerid, "StatsOf");
  8580.  
  8581. if(Player == 0xFFFF)
  8582. return SendError(playerid, "OPERATION ABORDED! The user you where editing has been disconnected!");
  8583.  
  8584. OnDialogResponse(playerid, Dialog:SetStatsSure, true, 0, "");
  8585.  
  8586. if(Player != playerid)
  8587. {
  8588. FormatMSG(playerid, Color:GREY, "You deleted "ORAN"%s"GREY"'s account.", Name(Player));
  8589. FormatMSG(Player, Color:GREY, "Admin "ORAN"%s"GREY" deleted your account", Name(playerid));
  8590. SendClientMessage(Player, Color:GREY, "You will be kicked in 2 seconds!");
  8591. SendClientMessage(Player, Color:GREY, "Later you can come back without an account.");
  8592.  
  8593. format(Query, 120, "DELETE FROM `Accounts` WHERE `Name` = '%s'", Name(Player));
  8594. DB::Query(_DB, Query);
  8595. }
  8596. else
  8597. return 0;
  8598.  
  8599. KickEx(Player, "System", "Account banned with [/setstats]", false);
  8600. }
  8601. }
  8602.  
  8603. iDialog<SetStatsTrue>
  8604. {
  8605. if(response)
  8606. {
  8607. new id = GetPVarInt(playerid, "StatsOf");
  8608. switch(listitem)
  8609. {
  8610. case NAME: \
  8611. SPD(playerid, Dialog:NAME, INPUT, "{FFFFFF}Changing Name", \
  8612. FormatInside(playerid, id, "Name", "Please insert the new name!"), "Insert", "Back");
  8613.  
  8614.  
  8615. case MONEY: \
  8616. SPD(playerid, Dialog:MONEY, INPUT, "{FFFFFF}Changing Money", \
  8617. FormatInside(playerid, id, "Money", "Please insert the new money value!"),"Insert", "Back");
  8618.  
  8619.  
  8620. case SCORE: \
  8621. SPD(playerid, Dialog:SCORE, INPUT, "{FFFFFF}Changing Score", \
  8622. FormatInside(playerid, id, "Score", "Please insert the new score!"),"Insert", "Back");
  8623.  
  8624.  
  8625. case COOKIES: \
  8626. SPD(playerid, Dialog:COOKIES, INPUT, "{FFFFFF}Changing Cookies", \
  8627. FormatInside(playerid, id, "Cookies", "Please insert the new cookies!"), "Insert", "Back");
  8628.  
  8629.  
  8630. case RESPECT: \
  8631. SPD(playerid, Dialog:RESPECT, LIST, "{FFFFFF}Changing Respect", \
  8632. "Positive\nNegative", "Select", "Back");
  8633.  
  8634.  
  8635.  
  8636. case KILLS: \
  8637. SPD(playerid, Dialog:KILLS, INPUT, "{FFFFFF}Changing Kills", \
  8638. FormatInside(playerid, id, "Kills", "Please insert the new kills!"), "Insert", "Back");
  8639.  
  8640.  
  8641. case DEATHS: \
  8642. SPD(playerid, Dialog:DEATHS, INPUT, "{FFFFFF}Changing Deaths", \
  8643. FormatInside(playerid, id, "Deaths", "Please insert the new deaths!"), "Insert", "Back");
  8644.  
  8645.  
  8646. case MESSAGES: \
  8647. SPD(playerid, Dialog:MESSAGES, INPUT, "{FFFFFF}Changing Messages Sent", \
  8648. FormatInside(playerid, id, "Messages", "Please insert the new messages!"), "Insert", "Back");
  8649.  
  8650.  
  8651. case COMMANDS: \
  8652. SPD(playerid, Dialog:COMMANDS, INPUT, "{FFFFFF}Changing Commands Used", \
  8653. FormatInside(playerid, id, "Used Commands", "Please insert the new used commands value!"), "Insert", "Back");
  8654.  
  8655.  
  8656. case FCOMMANDS: \
  8657. SPD(playerid, Dialog:FCOMMANDS,INPUT, "{FFFFFF}Changing Fail Commands", \
  8658. FormatInside(playerid, id, "Fail Commands", "Please insert the new failed commands value !"), "Insert", "Back");
  8659.  
  8660.  
  8661. case ONLINE: \
  8662. SPD(playerid, Dialog:ONLINE, LIST, "{FFFFFF}Changing Online Time", \
  8663. "Hours\nMinutes\nSeconds", "Select", "Back");
  8664.  
  8665.  
  8666. case LEVEL: \
  8667. SPD(playerid, Dialog:LEVEL, INPUT, "{FFFFFF}Changing Admin Level", \
  8668. FormatInside(playerid, id, "Admin Level", "Please insert the new admin level!"), "Insert", "Back");
  8669.  
  8670.  
  8671. case VLEVEL: \
  8672. SPD(playerid, Dialog:VLEVEL, INPUT, "{FFFFFF}Changing VIP Level", \
  8673. FormatInside(playerid, id, "VIP Level", "Please insert the new VIP level!"), "Insert", "Back");
  8674.  
  8675.  
  8676. case CPASS: \
  8677. SPD(playerid, Dialog:CPASS, INPUT, "{FFFFFF}Changing Password", \
  8678. FormatInside(playerid, id, "Password", "Please insert the new password!"), "Insert", "Back");
  8679.  
  8680.  
  8681. case BACCOUNT: \
  8682. SPD(playerid, Dialog:BACCOUNT, INPUT, "{FFFFFF}Banning Account", \
  8683. FormatInside(playerid, id, .zelse = "Banning", .extra = "Account"), "Yes" , "Back");
  8684.  
  8685.  
  8686. case DACCOUNT: \
  8687. SPD(playerid, Dialog:DACCOUNT, BOX, "{FFFFFF}Deleting Account", \
  8688. FormatInside(playerid, id, .zelse = "Deleting", .extra = "Account"), "Yes" , "Back");
  8689. }
  8690. }else DeletePVar(playerid, "StatsOf");
  8691. }
  8692. iDialog<SetStatsSure>
  8693. {
  8694. if(response)
  8695. {
  8696. new zStr[30];
  8697. format(zStr, 30, "%s", Name(GetPVarInt(playerid, "StatsOf")));
  8698. ShowPlayerDialog(playerid, Dialog:SetStatsTrue, LIST, zStr, FormatList(playerid), "Change", "Exit");
  8699.  
  8700. }else DeletePVar(playerid, "StatsOf");
  8701. }
  8702. iDialog<cPanel_Back> cmd_acp(playerid, "");
  8703.  
  8704. iDialog<ACCP_LOAD>
  8705. {
  8706. if(!response)
  8707. return cmd_accp(playerid, "");
  8708.  
  8709. new Accp_String[16], Accp_Vars[6], DBResult:Result;
  8710. format(Query, sizeof(Query), "SELECT `ACCP` FROM `Accounts` WHERE `Name` = '%s'", Name(playerid));
  8711. Result = DB::Query(_DB, Query);
  8712.  
  8713. if(Result)
  8714. {
  8715. if(DB::Valid(Result))
  8716. {
  8717. new Field[50];
  8718. DB::GetField(Result, "ACCP", Field, sizeof(Field));
  8719. SetPVarString(playerid, "ACCP_DATA", Field);
  8720.  
  8721. DB::Free(Result);
  8722.  
  8723. if(!sscanf(GPVSEx(playerid, "ACCP_DATA"), "p<:>s[16]iiiiii",Accp_String,
  8724. Accp_Vars[0],
  8725. Accp_Vars[1],
  8726. Accp_Vars[2],
  8727. Accp_Vars[3],
  8728. Accp_Vars[4],
  8729. Accp_Vars[5]))
  8730. {
  8731. SetPVarString(playerid, "Type", Accp_String);
  8732. P_DATA[playerid][A_Component1] = Accp_Vars[0];
  8733. P_DATA[playerid][A_Component2] = Accp_Vars[1];
  8734. P_DATA[playerid][A_Component3] = Accp_Vars[2];
  8735. P_DATA[playerid][A_Component4] = Accp_Vars[3];
  8736. P_DATA[playerid][A_Wheels] = Accp_Vars[4];
  8737. P_DATA[playerid][A_Color ] = Accp_Vars[5];
  8738.  
  8739. }
  8740.  
  8741. if(P_DATA[playerid][A_Component1] != 0)AddVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Component1]);
  8742. if(P_DATA[playerid][A_Component2] != 0)AddVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Component2]);
  8743. if(P_DATA[playerid][A_Component3] != 0)AddVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Component3]);
  8744. if(P_DATA[playerid][A_Component4] != 0)AddVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Component4]);
  8745. if(P_DATA[playerid][A_Wheels] != 0)AddVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Wheels]);
  8746. if(P_DATA[playerid][A_Color] != 0)ChangeVehicleColor(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Color], P_DATA[playerid][A_Color]);
  8747.  
  8748. SendClientMessage(playerid, Color:GREY, "The components of your Admin Vehicle have been loaded!");
  8749. }
  8750. else
  8751. {
  8752. SendClientMessage(playerid, Color:GREY, "Failed to load the components from the database!");
  8753. }
  8754. }
  8755. }
  8756. iDialog<ACCP_DISCARD>
  8757. {
  8758. if(!response)
  8759. return cmd_accp(playerid, "");
  8760.  
  8761. if(P_DATA[playerid][A_Component1] != 0)RemoveVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Component1]);
  8762. if(P_DATA[playerid][A_Component2] != 0)RemoveVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Component2]);
  8763. if(P_DATA[playerid][A_Component3] != 0)RemoveVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Component3]);
  8764. if(P_DATA[playerid][A_Component4] != 0)RemoveVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Component4]);
  8765. if(P_DATA[playerid][A_Wheels] != 0)RemoveVehicleComponent(GetPlayerVehicleID(playerid), P_DATA[playerid][A_Wheels]);
  8766. if(P_DATA[playerid][A_Color] != 0)ChangeVehicleColor(GetPlayerVehicleID(playerid), 0, 0);
  8767.  
  8768. P_DATA[playerid][A_Component1] = 0;
  8769. P_DATA[playerid][A_Component2] = 0;
  8770. P_DATA[playerid][A_Component3] = 0;
  8771. P_DATA[playerid][A_Component4] = 0;
  8772. P_DATA[playerid][A_Wheels] = 0;
  8773. P_DATA[playerid][A_Color] = 0;
  8774.  
  8775. SendClientMessage(playerid, Color:GREY, "The components of your Admin Vehicle have been discarted! You can "BLUE"Save Changes"GREY" from Admin Car cPanel again!");
  8776.  
  8777. }
  8778. iDialog<ACCP_SAVE>
  8779. {
  8780. if(!response) return cmd_accp(playerid, "");
  8781.  
  8782. CheckComponents(playerid,"No changes have been made to your Admin Car!");
  8783.  
  8784. new zQuery[300];
  8785. format(zQuery, 300, "UPDATE `Accounts` SET ACCP = '%s:%d:%d:%d:%d:%d:%d', ACCPSav = '1' WHERE `Name` = '%s'",
  8786. (strlen(GPVSEx(playerid, "Type")) ? (GPVSEx(playerid, "Type")) : ("None")),
  8787. (P_DATA[playerid][A_Component1]) ? (P_DATA[playerid][A_Component1]) : (0),
  8788. (P_DATA[playerid][A_Component2]) ? (P_DATA[playerid][A_Component2]) : (0),
  8789. (P_DATA[playerid][A_Component3]) ? (P_DATA[playerid][A_Component3]) : (0),
  8790. (P_DATA[playerid][A_Component4]) ? (P_DATA[playerid][A_Component4]) : (0),
  8791. (P_DATA[playerid][A_Wheels]) ? (P_DATA[playerid][A_Wheels]) : (0) ,
  8792. (P_DATA[playerid][A_Color]) ? (P_DATA[playerid][A_Color]) : (0),
  8793. Name(playerid));
  8794. DB::Query(_DB, zQuery);
  8795.  
  8796.  
  8797. P_DATA[playerid][Accp_Saved] = 1;
  8798.  
  8799. SendClientMessage(playerid, Color:GREY, "The components of Admin Vehicle have been saved! Later select "BLUE"Load Changes"GREY" from Admin Car cPanel!");
  8800.  
  8801. }
  8802. iDialog<ACCP_COMPS>
  8803. {
  8804. if(!response) return OnDialogResponse(playerid, Dialog:ACCP, 1, 2, "");
  8805.  
  8806. AddVehicleComponent(GetPlayerVehicleID(playerid), ACCP_Components[listitem][iComponent]);
  8807. FormatMSG(playerid, Color:GREY, "You added "ORAN"%s"GREY" on your Admin Car!", ACCP_Components[listitem][icName]);
  8808.  
  8809. switch(listitem)
  8810. {
  8811. case 0,1: P_DATA[playerid][A_Component1] = ACCP_Components[listitem][iComponent];
  8812. case 2,3,4: P_DATA[playerid][A_Component2] = ACCP_Components[listitem][iComponent];
  8813. case 5: P_DATA[playerid][A_Component3] = ACCP_Components[listitem][iComponent];
  8814. case 6: P_DATA[playerid][A_Component4] = ACCP_Components[listitem][iComponent];
  8815. }
  8816.  
  8817. return cmd_accp(playerid,"");
  8818. }
  8819.  
  8820. iDialog<ACCP_WHEELS>
  8821. {
  8822. if(!response) return OnDialogResponse(playerid, Dialog:ACCP, 1, 2, "");
  8823.  
  8824. AddVehicleComponent(GetPlayerVehicleID(playerid), Wheels[listitem][iWheel]);
  8825. FormatMSG(playerid, Color:GREY, "You added wheels "ORAN"%s"GREY" on your Admin Car!",Wheels[listitem][iwName]);
  8826.  
  8827. P_DATA[playerid][A_Wheels] = Wheels[listitem][iWheel];
  8828.  
  8829. return cmd_accp(playerid,"");
  8830. }
  8831.  
  8832. iDialog<ACCP_COLORS>
  8833. {
  8834. if(!response) return cmd_accp(playerid,"");
  8835.  
  8836. ChangeVehicleColor(GetPlayerVehicleID(playerid),ACCP_Colors[listitem][ivColor], ACCP_Colors[listitem][ivColor]);
  8837. FormatMSG(playerid, Color:GREY, "You changed your vehicle's color to color to %s%s!", ACCP_Colors[listitem][ivcRGB], ACCP_Colors[listitem][ivcName]);
  8838.  
  8839. P_DATA[playerid][A_Color] = ACCP_Colors[listitem][ivColor];
  8840.  
  8841. return cmd_accp(playerid,"");
  8842. }
  8843.  
  8844. iDialog<ACCP_C_C>
  8845. {
  8846. if(!response) return cmd_accp(playerid,"");
  8847.  
  8848. switch(listitem)
  8849. {
  8850. case (0):
  8851. {
  8852. new Str[1024];
  8853. for (new c = 0; c < sizeof(Wheels); c++)
  8854. {format(Str, sizeof (Str), "%s"GREY"ID: "ORAN"%d "GREY" NAME: "ORAN"%s\n",Str, Wheels[c][iWheel], Wheels[c][iwName]);}
  8855.  
  8856. SPD(playerid, Dialog:ACCP_WHEELS, LIST, "Change: "ORAN"Wheels", Str, "Change", "Back");
  8857. }
  8858. case (1):
  8859. {
  8860. new Str[1024];
  8861. for (new c = 0; c < sizeof(ACCP_Components); c++)
  8862. {format(Str, sizeof (Str), "%s"GREY"%s\n",Str, ACCP_Components[c][icName]);}
  8863.  
  8864. SPD(playerid, Dialog:ACCP_COMPS, LIST, "Add: "ORAN"Components", Str, "Change", "Back");
  8865. }
  8866. }
  8867. }
  8868.  
  8869. iDialog<ACCP>
  8870. {
  8871. if(response)
  8872. {
  8873. switch(listitem)
  8874. {
  8875. case (0): SPD(playerid, Dialog:ACCP_NOS, LIST, "Add: "ORAN"Nos", ""GREY"2x\n\
  8876. "GREY"5x\n\
  8877. "GREY"10x\n\
  8878. "GREY"Unlimited\n\
  8879. "ORAN"Remove Nos", "Add", "Back");
  8880.  
  8881. case (1):
  8882. {
  8883. new Str[512];
  8884. for (new c = 0; c < sizeof(ACCP_Colors); c++)
  8885. { format(Str, sizeof (Str), "%s%s%s\n", Str, ACCP_Colors[c][ivcRGB], ACCP_Colors[c][ivcName]); }
  8886.  
  8887. SPD(playerid, Dialog:ACCP_COLORS, LIST, "Change: "ORAN"Colors", Str, "Change", "Back");
  8888. }
  8889. case (2): SPD(playerid, Dialog:ACCP_C_C, LIST, "Add: "ORAN"Components", ""GREY"Wheels\n\
  8890. "GREY"Components", "Add", "Back");
  8891.  
  8892. case (3):
  8893. {
  8894.  
  8895. CheckComponents(playerid, "There are no changes to save!");
  8896.  
  8897. SPD(playerid, Dialog:ACCP_SAVE, BOX, "Save: "ORAN"Changes!", ""GREY"Saving changes made to your vehicle can be used everytime, anywhere!\n\
  8898. Changes will be saved into your account.\n\
  8899. Later select the "BLUE"Load Changes"GREY" item on your Admin Car cPanel.\n\
  8900. It's totally free and usable anytime!\n\n\
  8901. Want to "ORAN"save"GREY" or go "ORAN"back"GREY" ?", "Save", "Back");
  8902. }
  8903. case (4):
  8904. {
  8905. if(!P_DATA[playerid][Accp_Saved])
  8906. return SendError(playerid, "You didn't save any changes to your vehicle!"), cmd_accp(playerid, "");
  8907.  
  8908. SPD(playerid, Dialog:ACCP_LOAD, BOX, "Load: "ORAN"Changes!", ""GREY"With this you will load the changes you saved last time\n\
  8909. If you want to remove the changes select the "ORAN"Discard Changes"GREY" from Admin Car cPanel!\n\n\
  8910. Want to "ORAN"load"GREY" or go "ORAN"back"GREY" ?", "Load", "Back");
  8911. }
  8912. case (5):
  8913. {
  8914. CheckComponents(playerid, "There are no changes to discard due to the fact that there aren't any!");
  8915.  
  8916. SPD(playerid, Dialog:ACCP_DISCARD, BOX, "Discard: "ORAN"Changes!", ""GREY"You are about to discard the changes made to your vehicle!\n\
  8917. Ani component, nos type, wheels, colors selected for your Admin Car WILL BE DELETED!!\n\n\
  8918. Want to "ORAN"discard"GREY" or go "ORAN"back"GREY" ?", "Discard", "Back");
  8919. }
  8920. }
  8921. }
  8922. }
  8923. iDialog<ACCP_NOS>
  8924. {
  8925. if(!response) return cmd_accp(playerid,"");
  8926. switch(listitem)
  8927. {
  8928. case (0): AddVehicleComponent(GetPlayerVehicleID(playerid), 1009),SetPVarString(playerid, "Type", "2x");
  8929. case (1): AddVehicleComponent(GetPlayerVehicleID(playerid), 1008),SetPVarString(playerid, "Type", "5x");
  8930. case (2): AddVehicleComponent(GetPlayerVehicleID(playerid), 1010),SetPVarString(playerid, "Type", "10x");
  8931. case (3): AddVehicleComponent(GetPlayerVehicleID(playerid), 1010),SetPVarString(playerid, "Type", "Unlimited");
  8932. case (4):
  8933. {
  8934. if(!strcmp(GPVSEx(playerid, "Type"), "None", false))
  8935. return SendError(playerid, "You don't have NOS installed!"),
  8936. OnDialogResponse(playerid, Dialog:ACCP, 1, 0, "");
  8937.  
  8938. SendClientMessage(playerid, Color:ORAN, "ACCP: "GREY"You removed your Nitro from vehicle!");
  8939.  
  8940. RemoveVehicleComponent(GetPlayerVehicleID(playerid), 1010),
  8941. RemoveVehicleComponent(GetPlayerVehicleID(playerid), 1009),
  8942. RemoveVehicleComponent(GetPlayerVehicleID(playerid), 1008),
  8943. SetPVarString(playerid, "Type", "None");
  8944. }
  8945. }
  8946. if(listitem != 4)
  8947. {
  8948. FormatMSG(playerid, Color:ORAN, "ACCP: "GREY" You have added "ORAN"%s"GREY" nitro to your vehicle!", GPVSEx(playerid, "Type"));
  8949.  
  8950. if(!strcmp(GPVSEx(playerid, "Type"), "Unlimited", false))
  8951. SendClientMessage(playerid, Color:ORAN, "NOTE:"GREY" Hold your left mouse button for unlimited nos!");
  8952.  
  8953. else
  8954. SendClientMessage(playerid, Color:ORAN, "NOTE:"GREY" Press "ORAN"2"GREY" or "ORAN"Left Mouse Button"GREY" to recharge when exhausted!");
  8955.  
  8956. return cmd_accp(playerid,"");
  8957. }
  8958. }
  8959. iDialog<cPanel_Ping>
  8960. {
  8961. if(!response)
  8962. {
  8963. S_DATA[Ping] = 0;
  8964.  
  8965. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Ping Kicker",
  8966. ""W"Feature "ORAN"\"Ping Kicker\""W" has been disabled!\n\
  8967. Players won't be kicked from the server for high ping.", "Back", "");
  8968. }
  8969. else
  8970. {
  8971. new sPing[10];
  8972. if(sscanf(inputtext, "s[10]", sPing)) return OnDialogResponse(playerid, Dialog:cPanel, 1, 2, "");
  8973. else
  8974. {
  8975. if(!IsNumeric(sPing))
  8976. {
  8977. if(!strcmp(sPing, "off", true))
  8978. {
  8979. S_DATA[Ping] = 0;
  8980. new INI:
  8981. ServerData = INI_Open(SERVER_FILE);
  8982. INI_WriteInt(ServerData, INI_Server_Info[2][isName], 0);
  8983. INI_Close(ServerData);
  8984. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Ping Kicker", \
  8985. ""W"Feature "ORAN"\"Ping Kicker\""W" has been disabled!\n\
  8986. Players won't be kicked if they have a high ping", "Back", "");
  8987. return 0;
  8988. }
  8989. else
  8990. {
  8991. SPD(playerid, Dialog:cPanel_Ping, INPUT, ""W"cPanel: "ORAN"Ping Kicker","\n\n\
  8992. "GREY"Please write down the ping needed for the player to get kicked.\n\
  8993. If you write "ORAN"OFF"GREY" the "ORAN"Ping Kicker"GREY" will be disabled.", "Enter", "Disable");
  8994. }
  8995. }
  8996. else
  8997. {
  8998. if(strval(sPing) < MIN_PING_LIMIT || strval(sPing) > MAX_PING_LIMIT)
  8999. return SPD(playerid, Dialog:cPanel_Ping, INPUT, ""W"cPanel: "ORAN"Ping Kicker",
  9000. ""ORAN"ERROR:"W" Min. Ping: "ORAN""#MIN_PING_LIMIT" "W"| Max. Ping: "ORAN""#MAX_PING_LIMIT"\n\n\
  9001. "GREY"Please write down the ping needed for the player to get kicked.\n\
  9002. If you write "ORAN"OFF"GREY" the "ORAN"Ping Kicker"GREY" will be disabled.", "Enter", "Disable");
  9003.  
  9004. S_DATA[Ping] = strval(sPing);
  9005.  
  9006. new INI: ServerData = INI_Open(SERVER_FILE);
  9007. INI_WriteInt(ServerData, INI_Server_Info[2][isName], strval(sPing));
  9008. INI_Close(ServerData);
  9009.  
  9010. new zStr[256];
  9011. format(zStr, sizeof (zStr), ""W"Feature "ORAN"\"Ping Kicker\""W" has been enabled!\n\
  9012. Players will be kicked if they exceed the "ORAN"%d"W" ping limit!", strval(sPing));
  9013. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Ping Kicker", zStr, "Back", "");
  9014.  
  9015. }
  9016. }
  9017. }
  9018. }
  9019. iDialog<cPanel>
  9020. {
  9021. if(response)
  9022. {
  9023. new INI:
  9024. ServerData = INI_Open(SERVER_FILE);
  9025. switch(listitem)
  9026. {
  9027. case 0:
  9028. {
  9029. INI_WriteInt(ServerData, INI_Server_Info[0][isName], 1);
  9030. S_DATA[AntiSpam] = 1;
  9031. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti-Spam",\
  9032. ""W"Feature "ORAN"\"Anti-Spam\""W" has been enabled!\n\
  9033. Players won't be able to spam the chat and will be kicked for abuse.", "Back", "");
  9034. }
  9035. case 1:
  9036. {
  9037. INI_WriteInt(ServerData, INI_Server_Info[1][isName], 1);
  9038. S_DATA[AntiCSpam] = 1;
  9039. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Command Spam",\
  9040. ""W"Feature "ORAN"\"Anti Command Spam\""W" has been enabled!\n\
  9041. Players won't be able to spam the chat with commands.", "Back", "");
  9042. }
  9043. case 2:
  9044. {
  9045. SPD(playerid, Dialog:cPanel_Ping, INPUT, ""W"cPanel: "ORAN"Ping Kicker","\n\n\
  9046. "GREY"Please write down the ping needed for the player to get kicked.\n\
  9047. If you write "ORAN"OFF"GREY" the "ORAN"Ping Kicker"GREY" will be disabled.", "Enter", "Disable");
  9048. }
  9049. case 3:
  9050. {
  9051. INI_WriteInt(ServerData, INI_Server_Info[3][isName], 1);
  9052. S_DATA[RCONProt] = 1;
  9053. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"RCON Protection",\
  9054. ""W"Feature "ORAN"\"Rcon Protection\""W" has been enabled!\n\
  9055. After "ORAN""#MAX_RCON_ATTEMPTS" attempts players will be banned\n\
  9056. from the server for repeated login attempts", "Back", "");
  9057. }
  9058. case 4:
  9059. {
  9060. INI_WriteInt(ServerData, INI_Server_Info[4][isName], 1);
  9061. S_DATA[TellPlayer] = 1;
  9062. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Tell Player",\
  9063. ""W"Feature "ORAN"\"Tell Player\""W" has been enabled!\n\
  9064. Players will receive a message when typing an admin command\n\
  9065. telling them that their admin level is not high enough!", "Back", "");
  9066. }
  9067. case 5:
  9068. {
  9069. INI_WriteInt(ServerData, INI_Server_Info[5][isName], 0);
  9070. S_DATA[Chat] = 0;
  9071. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Block Chat",\
  9072. ""W"The "ORAN"Chat"W" has been unblocked!\n\
  9073. Players are able to speak in the chat!", "Back", "");
  9074. }
  9075.  
  9076. case 6:
  9077. {
  9078. INI_WriteInt(ServerData, INI_Server_Info[6][isName], 1);
  9079. S_DATA[ReadPM] = 1;
  9080. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Read Personal Messages",\
  9081. ""W"Feature "ORAN"\"Read PMs\""W" has been enabled!\n\
  9082. Administrators will be able to see the messages\n\
  9083. sent by members to others!", "Back", "");
  9084. }
  9085. case 7:
  9086. {
  9087. INI_WriteInt(ServerData, INI_Server_Info[7][isName], 1);
  9088. S_DATA[ReadCMD] = 1;
  9089. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Read Commands",\
  9090. ""W"Feature "ORAN"\"Read Commands\""W" has been enabled!\n\
  9091. Administrators will be able to see the commands a player used!", "Back", "");
  9092. }
  9093. case 8:
  9094. {
  9095. INI_WriteInt(ServerData, INI_Server_Info[8][isName], 1);
  9096. S_DATA[AKA] = 1;
  9097. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"AKA",\
  9098. ""W"Feature "ORAN"\"AKA\""W" has been enabled!\n\
  9099. Admins will see the AKA names of a player!", "Back", "");
  9100. }
  9101.  
  9102. case 9:
  9103. {
  9104. SPD(playerid, Dialog:cPanel2, LIST, ""ORAN"Server Control Panel"W" Page: 2", cPanel2(), "Enable", "Disable");
  9105. }
  9106. }
  9107. INI_Close(ServerData);
  9108. }
  9109. else
  9110. {
  9111. new INI:
  9112. ServerData = INI_Open(SERVER_FILE);
  9113. switch(listitem)
  9114. {
  9115. case 0:
  9116. {
  9117. INI_WriteInt(ServerData, INI_Server_Info[0][isName], 0);
  9118. S_DATA[AntiSpam] = 0;
  9119. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti-Spam",\
  9120. ""W"Feature "ORAN"\"Anti-Spam\""W" has been disabled!\n\
  9121. Players will be able to spam the chat.", "Back", "");
  9122. }
  9123. case 1:
  9124. {
  9125. INI_WriteInt(ServerData, INI_Server_Info[1][isName], 0);
  9126. S_DATA[AntiCSpam] = 0;
  9127. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Command Spam",\
  9128. ""W"Feature "ORAN"\"Anti Command Spam\""W" has been disabled!\n\
  9129. Players will be able to spam the chat with commands.", "Back", "");
  9130. }
  9131. case 2:
  9132. {
  9133. INI_WriteInt(ServerData, INI_Server_Info[2][isName], 0);
  9134. S_DATA[Ping] = 0;
  9135. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Ping Kicker",\
  9136. ""W"Feature "ORAN"\"Ping Kicker\""W" has been disabled!\n\
  9137. Players won't be kicked for a high ping.", "Back", "");
  9138. }
  9139. case 3:
  9140. {
  9141. INI_WriteInt(ServerData, INI_Server_Info[3][isName], 0);
  9142. S_DATA[RCONProt] = 0;
  9143. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"RCON Protection",\
  9144. ""W"Feature "ORAN"\"Rcon Protection\""W" has been disabled!\n\
  9145. Players won't be banned from the server for RCON login attempts.", "Back", "");
  9146. }
  9147. case 4:
  9148. {
  9149. INI_WriteInt(ServerData, INI_Server_Info[4][isName], 0);
  9150. S_DATA[TellPlayer] = 0;
  9151. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Tell Player",\
  9152. ""W"Feature "ORAN"\"Tell Player\""W" has been disabled!\n\
  9153. Players won't be informed that their level is not high enough\n\
  9154. to execute the admin command, actually, no message will be sent.", "Back", "");
  9155. }
  9156. case 5:
  9157. {
  9158. INI_WriteInt(ServerData, INI_Server_Info[5][isName], 1);
  9159. S_DATA[Chat] = 1;
  9160. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Block Chat",\
  9161. ""W"The "ORAN"Chat"W" has been blocked!\n\
  9162. Players won't be able to speak in the chat", "Back", "");
  9163. }
  9164. case 6:
  9165. {
  9166. INI_WriteInt(ServerData, INI_Server_Info[6][isName], 0);
  9167. S_DATA[ReadPM] = 0;
  9168. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Read Personal Messages",\
  9169. ""W"Feature "ORAN"\"Read PMs\""W" has been disabled!\n\
  9170. Personal Messages are now PERSONAL!", "Back", "");
  9171. }
  9172. case 7:
  9173. {
  9174. INI_WriteInt(ServerData, INI_Server_Info[7][isName], 0);
  9175. S_DATA[ReadCMD] = 0;
  9176. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Read Commands",\
  9177. ""W"Feature "ORAN"\"Read Commands\""W" has been disabled!\n\
  9178. Reading Commands is now disabled, Admins won't see.!", "Back", "");
  9179. }
  9180. case 8:
  9181. {
  9182. INI_WriteInt(ServerData, INI_Server_Info[8][isName], 0);
  9183. S_DATA[AKA] = 0;
  9184. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"AKA",\
  9185. ""W"Feature "ORAN"\"AKA\""W" has been disabled!\n\
  9186. Admins won't see the AKA the players logged with!", "Back", "");
  9187. }
  9188. }
  9189. INI_Close(ServerData);
  9190. }
  9191. }
  9192. iDialog<cPanel2>
  9193. {
  9194. if(response)
  9195. {
  9196. new INI:
  9197. ServerData = INI_Open(SERVER_FILE);
  9198. switch(listitem)
  9199. {
  9200. case 0:
  9201. {
  9202. INI_WriteInt(ServerData, INI_Server_Info[9][isName], 1);
  9203. S_DATA[ShowFunction] = 1;
  9204. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Show Function",\
  9205. ""W"Feature "ORAN"\"Show Function\""W" has been enabled!\n\
  9206. When admins type an admin command, they will see the \""ORAN"Function: "W"blabla\"", "Back", "");
  9207. }
  9208. case 1:
  9209. {
  9210. INI_WriteInt(ServerData, INI_Server_Info[10][isName], 1);
  9211. S_DATA[AntiRepeat] = 1;
  9212. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Message Repeat",\
  9213. ""W"Feature "ORAN"\"Anti Message Repeat\""W" has been enabled!\n\
  9214. Players will be warned if they continue to send same message in the chat!", "Back", "");
  9215. }
  9216. case 2:
  9217. {
  9218. INI_WriteInt(ServerData, INI_Server_Info[11][isName], 1);
  9219. S_DATA[AutoLogin] = 1;
  9220. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Auto Login",\
  9221. ""W"Feature "ORAN"\"Auto Login\""W" has been enabled!\n\
  9222. When players connect and the IP with which they left matches\n\
  9223. the one they connected with and the name is same they will\n\
  9224. auto login into their account without password request\n\n\
  9225. "ORAN"# Could be unsafe! Use carfully!", "Back", "");
  9226. }
  9227. case 3:
  9228. {
  9229. #if USE_RANKS == true
  9230.  
  9231. INI_WriteInt(ServerData, INI_Server_Info[12][isName], 1);
  9232. S_DATA[AnnRank] = 1;
  9233. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Announce Rank",\
  9234. ""W"Feature "ORAN"\"Announce Rank\""W" has been enabled!\n\
  9235. When a player will rank up, will tell to the whole server\n\
  9236. This feature can get frustrating when the server is crowded!", "Back", "");
  9237.  
  9238. #else
  9239.  
  9240. cmd_acp(playerid, "");
  9241. SendError(playerid, "Using Ranks is disabled from script!");
  9242.  
  9243. #endif
  9244. }
  9245. case 4:
  9246. {
  9247. INI_WriteInt(ServerData, INI_Server_Info[13][isName], 1);
  9248. S_DATA[AntiAD] = 1;
  9249. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Advertising",\
  9250. ""W"Feature "ORAN"\"Anti Advertising\""W" has been enabled!\n\
  9251. Players that will advertise will be warned then kicked!", "Back", "");
  9252. }
  9253. case 5:
  9254. {
  9255. INI_WriteInt(ServerData, INI_Server_Info[14][isName], 0);
  9256. S_DATA[AdminChat] = 1;
  9257. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Advertising",\
  9258. ""W"Feature "ORAN"\"Bloch Admin Chat\""W" has been enabled!\n\
  9259. All admins will be able to chat trough Admin Chat", "Back", "");
  9260. }
  9261. case 6:
  9262. {
  9263. INI_WriteInt(ServerData, INI_Server_Info[15][isName], 0);
  9264. S_DATA[VipChat] = 1;
  9265. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Advertising",\
  9266. ""W"Feature "ORAN"\"Block VIP Chat\""W" has been enabled!\n\
  9267. VIP members can now chat freely trough VIP Chat.", "Back", "");
  9268. }
  9269. case 7:
  9270. {
  9271. cmd_acp(playerid, "");
  9272. }
  9273. }
  9274. INI_Close(ServerData);
  9275. }
  9276. else
  9277. {
  9278. new INI:
  9279. ServerData = INI_Open(SERVER_FILE);
  9280.  
  9281. switch(listitem)
  9282. {
  9283. case 0:
  9284. {
  9285. INI_WriteInt(ServerData, INI_Server_Info[9][isName], 0);
  9286. S_DATA[ShowFunction] = 0;
  9287. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Show Function",\
  9288. ""W"Feature "ORAN"\"Show Function\""W" has been disabled!\n\
  9289. When admins type an admin command, they won't see the \"Function: blabla\"", "Back", "");
  9290. }
  9291. case 1:
  9292. {
  9293. INI_WriteInt(ServerData, INI_Server_Info[10][isName], 0);
  9294. S_DATA[AntiRepeat] = 0;
  9295. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Message Repeat",\
  9296. ""W"Feature "ORAN"\"Anti Message Repeat\""W" has been disabled!\n\
  9297. Players are now allowed to repeate themselves in the chat!", "Back", "");
  9298. }
  9299. case 2:
  9300. {
  9301. INI_WriteInt(ServerData, INI_Server_Info[11][isName], 0);
  9302. S_DATA[AutoLogin] = 0;
  9303. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Auto Login",\
  9304. ""W"Feature "ORAN"\"Auto Login\""W" has been disabled!\n\
  9305. On connection player will need to enter their passwords\n\
  9306. to enter their accounts!\n\n\
  9307. "GREE"# Safest Way!", "Back", "");
  9308. }
  9309. case 3:
  9310. {
  9311. #if USE_RANKS == true
  9312.  
  9313. INI_WriteInt(ServerData, INI_Server_Info[12][isName], 0);
  9314. S_DATA[AnnRank] = 0;
  9315. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Announce Rank",\
  9316. ""W"Feature "ORAN"\"Announce Rank\""W" has been disabled!\n\
  9317. Only the ranked up player will see the message!", "Back", "");
  9318.  
  9319. #else
  9320.  
  9321. cmd_acp(playerid, "");
  9322. SendError(playerid, "Using Ranks is disabled from script!");
  9323.  
  9324. #endif
  9325. }
  9326. case 4:
  9327. {
  9328. INI_WriteInt(ServerData, INI_Server_Info[13][isName], 0);
  9329. S_DATA[AntiAD] = 0;
  9330. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Advertising",\
  9331. ""W"Feature "ORAN"\"Anti Advertising\""W" has been disabled!\n\
  9332. Players will now be able to send IP in chat!!!", "Back", "");
  9333. }
  9334. case 5:
  9335. {
  9336. INI_WriteInt(ServerData, INI_Server_Info[14][isName], 0);
  9337. S_DATA[AdminChat] = 0;
  9338. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Advertising",\
  9339. ""W"Feature "ORAN"\"Bloch Admin Chat\""W" has been disabled!\n\
  9340. Only Administrators and Owners will be able to Admin Chat", "Back", "");
  9341. }
  9342. case 6:
  9343. {
  9344. INI_WriteInt(ServerData, INI_Server_Info[15][isName], 0);
  9345. S_DATA[VipChat] = 0;
  9346. SPD(playerid, Dialog:cPanel_Back, BOX, ""W"cPanel: "ORAN"Anti Advertising",\
  9347. ""W"Feature "ORAN"\"Block VIP Chat\""W" has been disabled!\n\
  9348. VIP members won't be able to chat trough VIP Chat.", "Back", "");
  9349. }
  9350. case 7:
  9351. {
  9352. cmd_acp(playerid, "");
  9353. }
  9354. }
  9355. INI_Close(ServerData);
  9356. }
  9357. }
  9358.  
  9359. switch(dialogid)
  9360. {
  9361. CaseDialog<Register1> if(response)RegisterPlayer(playerid, Dialog:Register1, inputtext);
  9362. CaseDialog<Login>
  9363. {
  9364. #if SECURITY_QUESTION == true
  9365.  
  9366. SPD(playerid, Dialog:Login2, INPUT, ""W"Account login", ""W"Please write your password!", "Login", "Forg. Pass");
  9367.  
  9368. #else
  9369.  
  9370. SPD(playerid, Dialog:Login2, INPUT, ""W"Account login", ""W"Please write your password!", "Login", "Kick");
  9371.  
  9372. #endif
  9373. }
  9374. CaseDialog<Register>
  9375. {
  9376. if(! response) return KickEx(playerid, .zReason = "Not registering", .tell = true);
  9377.  
  9378. if(strlen(inputtext))
  9379. {
  9380. if(strlen(inputtext) < MIN_PASS_LEN || strlen(inputtext) > MAX_PASS_LEN)
  9381. return ShowPlayerDialog
  9382. (
  9383. playerid,
  9384. Dialog:Register,
  9385. DIALOG_STYLE_INPUT,
  9386. ""W"Register an account",
  9387. ""ORAN"ERROR:"W" An error has occured while trying to register the account, please try again!!\n\n\
  9388. Please write your desired password.", "Register", "Kick");
  9389.  
  9390. #if SECURITY_QUESTION == false
  9391.  
  9392. RegisterPlayer(playerid, Dialog:Register, inputtext);
  9393.  
  9394. #else
  9395.  
  9396. SetPVarString(playerid, "TempPass", inputtext);
  9397. 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", "");
  9398.  
  9399. #endif
  9400. }
  9401. else
  9402. {
  9403. new zStr[256];
  9404. format(zStr, sizeof (zStr), "{FF0000}Please write a password!\n\n"W"Please write your desired password", Name(playerid), GetServerHostName());
  9405. ShowPlayerDialog(playerid, Dialog:Register, DIALOG_STYLE_INPUT, ""W"Register an account", zStr, "Register", "Kick");
  9406. }
  9407. }
  9408. CaseDialog<SQuestion>
  9409. {
  9410. if(response || !response)
  9411. {
  9412. if(strlen(inputtext))
  9413. {
  9414. if(strlen(inputtext) > 10 && strlen(inputtext) < 90)
  9415. {
  9416. if(strfind(inputtext, "?", true) != -1)
  9417. {
  9418. SetPVarString(playerid, "Question", inputtext);
  9419. new Str[190];
  9420. format(Str, 190, ""W"Your secret question is:\n "BLUE"%s\n\n"W"Please insert the answer:", inputtext);
  9421. SPD(playerid, Dialog:SAnswer, INPUT, ""W"Secret Answer",Str, "Insert", "Back");
  9422. }
  9423. 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", "");
  9424. }
  9425. 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", "");
  9426. }
  9427. 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", "");
  9428. }
  9429. }
  9430. CaseDialog<SAnswer2>
  9431. {
  9432. RegisterPlayer(playerid, Dialog:Register1, GPVSEx(playerid, "TempPass"));
  9433. }
  9434. CaseDialog<SAnswer>
  9435. {
  9436. if(response)
  9437. {
  9438. new Str[190];
  9439. if(strlen(inputtext))
  9440. {
  9441. if(strlen(inputtext) > 4 && strlen(inputtext) < 90)
  9442. {
  9443. SetPVarString(playerid, "Answer", inputtext);
  9444.  
  9445. 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);
  9446. SPD(playerid, Dialog:SAnswer2, BOX, ""W"Account login",Str, "Continue", "");
  9447.  
  9448. format(Query, 200, "UPDATE `Accounts` SET `Question` = '%s', `Answer` = '%s' WHERE `Name` = '%s'", GPVSEx(playerid, "Question"), inputtext, Name(playerid));
  9449. DB::Query(_DB, Query);
  9450. }
  9451. else
  9452. {
  9453. 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"));
  9454. SPD(playerid, Dialog:SAnswer, INPUT, ""W"Secret Answer",Str, "Insert", "Back");
  9455. }
  9456. }
  9457. else
  9458. {
  9459. 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"));
  9460. SPD(playerid, Dialog:SAnswer, INPUT, ""W"Secret Answer",Str, "Insert", "Back");
  9461. }
  9462. }
  9463. else
  9464. {
  9465. DeletePVar(playerid, "Question");
  9466. 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", "");
  9467. }
  9468. }
  9469. CaseDialog<Login2>
  9470. {
  9471. if(response)
  9472. {
  9473. if(strlen(inputtext))LoginPlayer(playerid, inputtext);
  9474. else
  9475. {
  9476. #if SECURITY_QUESTION == true
  9477.  
  9478. SPD(playerid, Dialog:Login2, INPUT, ""W"Account login", ""ORAN"ERROR:"W" No password entered!\n\n"W"Please write your password!", "Login", "Forg. Pass");
  9479.  
  9480. #else
  9481.  
  9482. SPD(playerid, Dialog:Login2, INPUT, ""W"Account login", ""ORAN"ERROR:"W" No password entered!\n\n"W"Please write your password!", "Login", "Kick");
  9483.  
  9484. #endif
  9485. }
  9486.  
  9487. }
  9488. else
  9489. {
  9490. #if SECURITY_QUESTION == true
  9491.  
  9492. SPD(playerid, Dialog:ForgPass, INPUT, ""W"Forgot Password", ""W"Please insert the answer to your secret question for password retrival", "Insert", "Back");
  9493.  
  9494. #else
  9495.  
  9496. KickEx(playerid, "System", "Not logging in");
  9497.  
  9498. #endif
  9499. }
  9500. }
  9501. CaseDialog<ForgPass>
  9502. {
  9503. if(response)
  9504. {
  9505. if(strlen(inputtext))
  9506. {
  9507. new DBResult:Result;
  9508. format(Query, 200, "SELECT `Question`, `Answer`, `RPassword` FROM `Accounts` WHERE `Name` = '%s';", Name(playerid));
  9509. Result = DB::Query(_DB, Query);
  9510.  
  9511. if(Result)
  9512. {
  9513. if(DB::Valid(Result))
  9514. {
  9515. new Field[129];
  9516.  
  9517. DB::GetField(Result, "Answer", Field, sizeof(Field));
  9518. SetPVarString(playerid, "TempAnswer", Field);
  9519.  
  9520. DB::GetField(Result, "Question", Field, sizeof(Field));
  9521. SetPVarString(playerid, "Question", Field);
  9522.  
  9523. if(!strcmp(GPVSEx(playerid, "TempAnswer"), inputtext, false))
  9524. {
  9525. DB::GetField(Result, "RPassword", Field, sizeof(Field));
  9526.  
  9527. new Str[100];
  9528. format(Str, 100, ""W"The answer is correct!\n\nYour password is:"BLUE" %s", Field);
  9529. 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", "");
  9530.  
  9531. DB::Free(Result);
  9532.  
  9533. DeletePVar(playerid, "TempAnswer");
  9534. }
  9535. else
  9536. {
  9537. DB::Free(Result);
  9538. 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");
  9539. }
  9540. }
  9541. }
  9542. }else SPD(playerid, Dialog:ForgPass, INPUT, ""W"Forgot Password", ""W"Please insert the answer to your secret question for password retrival", "Insert", "Back");
  9543. }
  9544. else
  9545. {
  9546. #if SECURITY_QUESTION == true
  9547.  
  9548. SPD(playerid, Dialog:Login2, INPUT, ""W"Account login", ""W"Please write your password!", "Login", "Forg. Pass");
  9549.  
  9550. #else
  9551.  
  9552. SPD(playerid, Dialog:Login2, INPUT, ""W"Account login", ""W"Please write your password!", "Login", "Kick");
  9553.  
  9554. #endif
  9555. }
  9556.  
  9557. }
  9558.  
  9559. CaseDialog<Login3>
  9560. {
  9561. if(response)
  9562. {
  9563. if(strlen(inputtext)) LoginPlayer(playerid, inputtext);
  9564. else
  9565. {
  9566. #if SECURITY_QUESTION == true
  9567.  
  9568. SPD(playerid, Dialog:Login3, INPUT, ""W"Account login", ""ORAN"ERROR:"W" No password entered!\n\n"W"Please write your password!", "Login", "Forg. Pass");
  9569.  
  9570. #else
  9571.  
  9572. SPD(playerid, Dialog:Login3, INPUT, ""W"Account login", ""ORAN"ERROR:"W" No password entered!\n\n"W"Please write your password!", "Login", "Kick");
  9573.  
  9574. #endif
  9575. }
  9576. }
  9577. }
  9578. }
  9579. return 0;
  9580. }
  9581.  
  9582. Public:dLabel(InV) return DeletePlayer3DTextLabel(InV, ZaAdminCar[InV]);
  9583. Public:UnlimitedNos(playerid)AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
  9584.  
  9585. Public:LoadAKA(playerid, name[], value[])
  9586. {
  9587. new pIP[30];
  9588. GetPlayerIp(playerid, pIP, 30);
  9589. if(!strcmp(name, pIP)) SetPVarString(playerid, "pAKA", value);
  9590. }
  9591. Public:PingKick()
  9592. {
  9593. foreach(Player, i)
  9594. {
  9595. if(S_DATA[Ping] != 0)
  9596. {
  9597. if(GetPlayerPing(i) > S_DATA[Ping] && P_DATA[i][Level] < IPGKICK)
  9598. {
  9599. new Str[30];
  9600. format(Str, sizeof (Str), "Exceeding Ping Limit of %d", S_DATA[Ping]);
  9601. KickEx(i, .zAdmin = "System", .zReason = Str, .tell = true);
  9602. }
  9603. }
  9604. }
  9605. }
  9606. Public:BlockChat(playerid)
  9607. {
  9608. if(S_DATA[Chat]) return SendError(playerid, "Chat already blocked!");
  9609. S_DATA[Chat] = 1;
  9610. SendAdminCMD(-1, "Admin "ORAN"%s[%i]"GREY" blocked the chat.", Name(playerid), playerid);
  9611. SendClientMessage(playerid, Color:GREY, "You blocked the chat.");
  9612.  
  9613. foreach(Player, i)
  9614. {
  9615. if(P_DATA[i][Level] <= 0)
  9616. {
  9617. SendClientMessage(i, -1, "- * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *");
  9618. FormatMSG(i, -1, "Chat has been disabled by the Owner: %s", Name(playerid));
  9619. SendClientMessage(i, -1, "- * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *");
  9620. }
  9621. }
  9622. return 1;
  9623. }
  9624.  
  9625. Public:JailPlayer(playerid)
  9626. {
  9627. KillTimer(JailTimer[playerid]);
  9628.  
  9629. UnFreeze(playerid);
  9630.  
  9631. SetPlayerPos(playerid, 197.6661, 173.8179, 1003.0234);
  9632. SetPlayerInterior(playerid,3);
  9633. SetCameraBehindPlayer(playerid);
  9634.  
  9635. if(P_DATA[playerid][Frozen])
  9636. {
  9637. Freeze(playerid);
  9638. }
  9639. JailTimer[playerid] = SetTimerEx("UnjailPlayer", 60_000, true, "d", playerid);
  9640. P_DATA[playerid][Jailed] = 1;
  9641. }
  9642. Public:UnjailPlayer(playerid)
  9643. {
  9644.  
  9645. --P_DATA[playerid][JailTime];
  9646.  
  9647.  
  9648. if(!P_DATA[playerid][JailTime])
  9649. {
  9650. KillTimer(JailTimer[playerid]);
  9651. UnjailPlayer(playerid);
  9652.  
  9653. P_DATA[playerid][Jailed] = 0;
  9654. P_DATA[playerid][JailTime] = 0;
  9655.  
  9656. SetPlayerInterior(playerid, 0);
  9657. SetPlayerPos(playerid, 0.0, 0.0, 0.0);
  9658. PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
  9659.  
  9660. SpawnPlayer(playerid);
  9661. SendClientMessage(playerid, Color:ORAN, "SERVER:"W" You have been un-jailed by the system!");
  9662.  
  9663. #if SAVE_JAIL == true
  9664. new
  9665. Query[256];
  9666. format(Query, 256, "DELETE FROM `Jailed` WHERE `IP` = '%s'", GetPlayerIPEx(playerid));
  9667. DB::Query(_DB, Query);
  9668. #endif
  9669. }
  9670. else if(P_DATA[playerid][JailTime] == 1){
  9671. GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~b~~h~JAIL INFO~n~~b~~h~One~w~ minute left", 10000, 3);}
  9672.  
  9673. else if(P_DATA[playerid][JailTime] > 1)
  9674. {
  9675. new Str[129];
  9676. format(Str, 129, "~n~~n~~n~~n~~n~~n~~b~~h~JAIL INFO~n~~b~~h~%d~w~ minutes left", P_DATA[playerid][JailTime]);
  9677. GameTextForPlayer(playerid, Str, 10000, 3);
  9678. }
  9679.  
  9680. return 1;
  9681. }
  9682.  
  9683. PcPanel(playerid)
  9684. {
  9685.  
  9686. new Str[2_0_0_0];
  9687.  
  9688. format(Str, sizeof (Str), ""ORAN"Exit cPanel\n\
  9689. "W"Auto-Login\t\t%s\n\
  9690. "W"Block PMs\t\t%s\n\
  9691. "W"My stats",
  9692. (S_DATA[AutoLogin] && P_DATA[playerid][pAuto]) ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9693. P_DATA[playerid][BAPMs] ? (""GREE"Enabled") : (""ORAN"Disabled"));
  9694.  
  9695. switch(P_DATA[playerid][Vip])
  9696. {
  9697. case 1:
  9698. {
  9699. format(Str, sizeof (Str), "%s\n"BLUE"VIP LEVEL 1\n\
  9700. "W"Godlike\t\t%s\n\
  9701. "W"Vehicle God\t\t%s\n\
  9702. "W"Vehicle Boost\t\t%s\n\
  9703. "W"Wear VIP Tag\t\t%s",
  9704. Str,
  9705. P_DATA[playerid][God] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9706. P_DATA[playerid][CarGod] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9707. P_DATA[playerid][Boost] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9708. P_DATA[playerid][VIPTag] ? (""GREE"Enabled") : (""ORAN"Disabled"));
  9709. }
  9710. case 2:
  9711. {
  9712. format(Str, sizeof (Str), "%s\n"BLUE"VIP LEVEL 1\n\
  9713. "W"Godlike\t\t\t%s\n\
  9714. "W"Vehicle God\t\t%s\n\
  9715. "W"Vehicle Boost\t\t%s\n\
  9716. "W"Wear VIP Tag\t\t%s\n\
  9717. "BLUE"VIP LEVEL 2\n\
  9718. "W"Vehicle Spin\t\t%s\n\
  9719. "W"Incredible\t\t%s",
  9720. Str,
  9721. P_DATA[playerid][God] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9722. P_DATA[playerid][CarGod] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9723. P_DATA[playerid][Boost] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9724. P_DATA[playerid][VIPTag] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9725. P_DATA[playerid][Spin] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9726. P_DATA[playerid][Incred] ? (""GREE"Enabled") : (""ORAN"Disabled"));
  9727. }
  9728. case 3:
  9729. {
  9730. format(Str, sizeof (Str), "%s\n"BLUE"VIP LEVEL 1\n\
  9731. "W"Godlike\t\t\t%s\n\
  9732. "W"Vehicle God\t\t%s\n\
  9733. "W"Vehicle Boost\t\t%s\n\
  9734. "W"Wear VIP Tag\t\t%s\n\
  9735. "BLUE"VIP LEVEL 2\n\
  9736. "W"Vehicle Spin\t\t%s\n\
  9737. "W"Incredible\t\t%s\n\
  9738. "BLUE"VIP LEVEL 3\n\
  9739. "W"Shout",
  9740. Str,
  9741. P_DATA[playerid][God] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9742. P_DATA[playerid][CarGod] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9743. P_DATA[playerid][Boost] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9744. P_DATA[playerid][VIPTag] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9745. P_DATA[playerid][Spin] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9746. P_DATA[playerid][Incred] ? (""GREE"Enabled") : (""ORAN"Disabled"));
  9747. }
  9748. }
  9749. return Str;
  9750. }
  9751. cPanel()
  9752. {
  9753. new PingString[50], Str[1024];
  9754. if(S_DATA[Ping] != 0) format(PingString, sizeof (PingString), ""GREE"Enabled"W"\tPing Limit: "ORAN"%d", S_DATA[Ping]); else PingString = ""ORAN"Disabled";
  9755. format(Str, sizeof (Str), ""W"Anti Spam\t\t%s\n\
  9756. "W"Anti Command Spam\t%s\n\
  9757. "W"Ping Kicker\t\t%s\n\
  9758. "W"RCON Protection\t%s\n\
  9759. "W"Tell Player\t\t%s\n\
  9760. "W"Chat\t\t\t%s\n\
  9761. "W"Read Commands\t%s\n\
  9762. "W"Read PMs\t\t%s\n\
  9763. "W"AKA\t\t\t%s\n\
  9764. "GREY"..: Page 2\n\
  9765. "ORAN"..: Exit",
  9766. S_DATA[AntiSpam] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9767. S_DATA[AntiCSpam] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9768. PingString,
  9769. S_DATA[RCONProt] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9770. S_DATA[TellPlayer] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9771. S_DATA[Chat] ? (""ORAN"Blocked") : (""GREE"Free to chat"),
  9772. S_DATA[ReadPM] ? (""GREE"Reading") : (""ORAN"Not Reading"),
  9773. S_DATA[ReadCMD] ? (""GREE"Reading") : (""ORAN"Not Reading"),
  9774. S_DATA[AKA] ? (""GREE"Enabled") : (""ORAN"Disabled"));
  9775.  
  9776.  
  9777.  
  9778. return Str;
  9779. }
  9780. cPanel2()
  9781. {
  9782. new Str[512];
  9783. format(Str, sizeof (Str), ""W"Show Function\t\t%s\n\
  9784. "W"Anti Message Repeat\t%s\n\
  9785. "W"Autologin\t\t%s\n\
  9786. "W"Announce Rank-Up\t%s\n\
  9787. "W"Anti Advertising\t%s\n\
  9788. "W"Admin Chat\t\t%s\n\
  9789. "W"VIP Chat\t\t%s\n\
  9790. "GREY"..: Back\n\
  9791. "ORAN"..: Exit",
  9792. S_DATA[ShowFunction] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9793. S_DATA[AntiRepeat] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9794. S_DATA[AutoLogin] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9795. S_DATA[AnnRank] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9796. S_DATA[AntiAD] ? (""GREE"Enabled") : (""ORAN"Disabled"),
  9797. S_DATA[AdminChat] ? (""GREE"Allowed") : (""ORAN"Not Allowed"),
  9798. S_DATA[VipChat] ? (""GREE"Allowed") : (""ORAN"Not Allowed"));
  9799.  
  9800.  
  9801.  
  9802. return Str;
  9803. }
  9804. OnlineCheck(type[], C)
  9805. {
  9806. new cS[126];
  9807. if(!strcmp(type, "Admins"))
  9808. {
  9809. if(C > 1) format(cS, sizeof (cS), ""W"There are "BLUE"%d"W" Administrators online!\n\n", C);
  9810. else format(cS, sizeof (cS), ""W"There is only "BLUE"1"W" Administrator online!\n\n");
  9811. }
  9812. else if(!strcmp(type, "Vips"))
  9813. {
  9814. if(C > 1) format(cS, sizeof (cS), ""W"There are "BLUE"%d"W" VIP Members online!\n\n", C);
  9815. else format(cS, sizeof (cS), ""W"There is only "BLUE"1"W" VIP Member online!\n\n");
  9816. }
  9817. else if(!strcmp(type, "Jailed"))
  9818. {
  9819. if(C > 1) format(cS, sizeof (cS), ""W"There are "BLUE"%d"W" Jailed players online!\n\n", C);
  9820. else format(cS, sizeof (cS), ""W"There is only "BLUE"1"W" Jailed player online!\n\n");
  9821. }
  9822. else if(!strcmp(type, "Muted"))
  9823. {
  9824. if(C > 1) format(cS, sizeof (cS), ""W"There are "BLUE"%d"W" Muted players online!\n\n", C);
  9825. else format(cS, sizeof (cS), ""W"There is only "BLUE"1"W" Muted player online!\n\n");
  9826. }
  9827. else if(!strcmp(type, "Frozen"))
  9828. {
  9829. if(C > 1) format(cS, sizeof (cS), ""W"There are "BLUE"%d"W" Frozen players online!\n\n", C);
  9830. else format(cS, sizeof (cS), ""W"There is only "BLUE"1"W" Frozen player online!\n\n");
  9831. }
  9832. return cS;
  9833. }
  9834. Public: LowerSpam()
  9835. {
  9836. foreach(Player, playerid)
  9837. {
  9838. if(P_DATA[playerid][SpamMSG] > 0) P_DATA[playerid][SpamMSG]--;
  9839. if(P_DATA[playerid][cSpam] > 0) P_DATA[playerid][cSpam]--;
  9840. }
  9841. }
  9842.  
  9843. fNMB(nmb)
  9844. {
  9845. new Str[4];
  9846. format(Str, sizeof (Str), "%d", nmb);
  9847. return Str;
  9848. }
  9849.  
  9850.  
  9851. FormatStats(playerid)
  9852. {
  9853. #if USE_RANKS == true
  9854. format(StatsString, sizeof (StatsString), "\n"W"Viewing %s\n\n\
  9855. "W"Level: "ORAN"%s\n\
  9856. "W"Vip: "ORAN"%s\n\
  9857. "W"Kills: "ORAN"%d\n\
  9858. "W"Deaths: "ORAN"%d\n\
  9859. "W"Ratio: "ORAN"%.3f\n\
  9860. "W"Rank: "ORAN"%s\n\
  9861. "W"Cookies: "ORAN"%d\n\
  9862. "W"Respect: "GREE"+%d"W"/"ORAN"-%d\n",
  9863. WhosStats,
  9864. LevelName(GetPVarInt(playerid, "0_Level")),
  9865. (GetPVarInt(playerid, "0_Vip")) ? (fNMB(GetPVarInt(playerid, "0_Vip"))) : ("NO!"),
  9866. GetPVarInt(playerid, "0_Kills"),
  9867. GetPVarInt(playerid, "0_Deaths"),
  9868. (Float:GetPVarInt(playerid, "0_Kills") / Float:GetPVarInt(playerid, "0_Deaths")),
  9869. RankName(GetPVarInt(playerid, "0_Rank")),
  9870. GetPVarInt(playerid, "0_Cookies"),
  9871. GetPVarInt(playerid, "0_Positive"),
  9872. GetPVarInt(playerid, "0_Negative"));
  9873. #else
  9874. format(StatsString, sizeof (StatsString), "\n"W"Viewing %s\n\n\
  9875. "W"Level: "ORAN"%s\n\
  9876. "W"Vip: "ORAN"%s\n\
  9877. "W"Kills: "ORAN"%d\n\
  9878. "W"Deaths: "ORAN"%d\n\
  9879. "W"Ratio: "ORAN"%.3f\n\
  9880. "W"Cookies: "ORAN"%d\n\
  9881. "W"Respect: "GREE"+%d"W"/"ORAN"-%d\n",
  9882. WhosStats,
  9883. LevelName(GetPVarInt(playerid, "0_Level")),
  9884. (GetPVarInt(playerid, "0_Vip")) ? (fNMB(GetPVarInt(playerid, "0_Vip"))) : ("NO!"),
  9885. GetPVarInt(playerid, "0_Kills"),
  9886. GetPVarInt(playerid, "0_Deaths"),
  9887. (Float:GetPVarInt(playerid, "0_Kills") / Float:GetPVarInt(playerid, "0_Deaths")),
  9888. GetPVarInt(playerid, "0_Cookies"),
  9889. GetPVarInt(playerid, "0_Positive"),
  9890. GetPVarInt(playerid, "0_Negative"));
  9891. #endif
  9892. format(StatsString, sizeof (StatsString), "%s\
  9893. "W"Money: "ORAN"%d\n\
  9894. "W"Score: "ORAN"%d\n\
  9895. "W"Online: "ORAN"%s\n\
  9896. "W"Commands: "ORAN"%d\n\
  9897. "W"Fail Cmds: "ORAN"%d\n\
  9898. "W"Messages: "ORAN"%d\n\
  9899. "W"Kicks: "ORAN"%d\n\
  9900. "W"Account date: "ORAN"%s\n\
  9901. "W"Account ID: "ORAN"%d\n\n",
  9902. StatsString,
  9903. GetPlayerMoney(playerid),
  9904. GetPlayerScore(playerid),
  9905. FormatOnline(playerid),
  9906. P_DATA[playerid][Cmds],
  9907. P_DATA[playerid][fCmds],
  9908. P_DATA[playerid][Msgs],
  9909. P_DATA[playerid][Kicks],
  9910. GPVSEx(playerid, "AccountDate"),
  9911. P_DATA[playerid][AccID]);
  9912. return 1;
  9913. }
  9914. #if USE_RANKS == true
  9915. RankName(rank) return _RankNames[rank];
  9916.  
  9917. #endif
  9918. LevelName(iLevel)
  9919. {
  9920. new zLevel[35];
  9921. if (iLevel == 0) format(zLevel, 35, "%s", _Levels[0]);
  9922. else if(iLevel == 1) format(zLevel, 35, "%s", _Levels[1]);
  9923. else if(iLevel == 2) format(zLevel, 35, "%s", _Levels[2]);
  9924. else if(iLevel == 3) format(zLevel, 35, "%s", _Levels[3]);
  9925. else if(iLevel == 4) format(zLevel, 35, "%s", _Levels[4]);
  9926. else if(iLevel >= 5) format(zLevel, 35, "%s", _Levels[5]);
  9927. else zLevel = "<< Error >>";
  9928. return zLevel;
  9929. }
  9930.  
  9931. LoginPlayer(playerid, const pPass[], pAutoLogin = false)
  9932. {
  9933.  
  9934. new Buf[129], Query[280], DBResult:Result;
  9935. WP_Hash(Buf, (129), pPass);
  9936.  
  9937. format(Query, 280, "SELECT `Key` FROM `Accounts` WHERE `Name` = '%s' AND `Password` = '%s'", Name(playerid), Buf);
  9938. Result = DB::Query(_DB, Query);
  9939.  
  9940. if(Result)
  9941. {
  9942. if(DB::Valid(Result))
  9943. {
  9944. DB::Free(Result);
  9945. new Accp_String[16], Accp_Vars[6], Str[256];
  9946.  
  9947. LoadPlayerData(playerid);
  9948. P_DATA[playerid][Logged] = 1;
  9949.  
  9950.  
  9951. sscanf(GPVSEx(playerid, "Online"), "p<:>iii", P_DATA[playerid][Hours],P_DATA[playerid][Minutes],P_DATA[playerid][Seconds]);
  9952.  
  9953. if(!sscanf(GPVSEx(playerid, "ACCP_DATA"), "p<:>s[16]iiiiii",Accp_String,
  9954. Accp_Vars[0],
  9955. Accp_Vars[1],
  9956. Accp_Vars[2],
  9957. Accp_Vars[3],
  9958. Accp_Vars[4],
  9959. Accp_Vars[5]))
  9960. {
  9961. SetPVarString(playerid, "Type", Accp_String);
  9962. P_DATA[playerid][A_Component1] = Accp_Vars[0];
  9963. P_DATA[playerid][A_Component2] = Accp_Vars[1];
  9964. P_DATA[playerid][A_Component3] = Accp_Vars[2];
  9965. P_DATA[playerid][A_Component4] = Accp_Vars[2];
  9966. P_DATA[playerid][A_Wheels] = Accp_Vars[3];
  9967. P_DATA[playerid][A_Color] = Accp_Vars[4];
  9968. }
  9969. else
  9970. {
  9971. SetPVarString(playerid, "Type", "None");
  9972. P_DATA[playerid][A_Component1] = 0;
  9973. P_DATA[playerid][A_Component2] = 0;
  9974. P_DATA[playerid][A_Component3] = 0;
  9975. P_DATA[playerid][A_Component4] = 0;
  9976. P_DATA[playerid][A_Wheels] = 0;
  9977. P_DATA[playerid][A_Color] = 0;
  9978. }
  9979. SetPVarInt(playerid, "0_Level", P_DATA[playerid][Level]);
  9980. SetPVarInt(playerid, "0_Vip", P_DATA[playerid][Vip]);
  9981. SetPVarInt(playerid, "0_Kills", P_DATA[playerid][Kills]);
  9982. SetPVarInt(playerid, "0_Deaths", P_DATA[playerid][Deaths]);
  9983. SetPVarInt(playerid, "0_Messages", P_DATA[playerid][Msgs]);
  9984. SetPVarInt(playerid, "0_Commands", P_DATA[playerid][Cmds]);
  9985. SetPVarInt(playerid, "0_Fail_Commands", P_DATA[playerid][fCmds]);
  9986. SetPVarInt(playerid, "0_Cookies", P_DATA[playerid][Cookies]);
  9987. SetPVarInt(playerid, "0_God", P_DATA[playerid][God]);
  9988. SetPVarInt(playerid, "0_CarGod", P_DATA[playerid][CarGod]);
  9989. SetPVarInt(playerid, "0_Positive", P_DATA[playerid][Positive]);
  9990. SetPVarInt(playerid, "0_Negative", P_DATA[playerid][Negative]);
  9991. SetPVarInt(playerid, "0_Rank", P_DATA[playerid][Rank]);
  9992.  
  9993.  
  9994. if(!pAutoLogin)
  9995. {
  9996.  
  9997. if(P_DATA[playerid][Level] > 0 && P_DATA[playerid][Vip] > 0)
  9998. {
  9999. 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]);
  10000. if(P_DATA[playerid][VIPTag])
  10001. {
  10002. Delete3DTextLabel(P_DATA[playerid][Tag3D]);
  10003. P_DATA[playerid][Tag3D] = Create3DTextLabel("VIP Member", Color:BLUE, 0.0, 0.0, 0.0, 90.0, 0, 1);
  10004.  
  10005. }
  10006. }
  10007. else if(P_DATA[playerid][Level] > 0 && P_DATA[playerid][Vip] <= 0)
  10008. format(Str, sizeof (Str), ""W"Welcome "ORAN"%s.\n\n"W"-------------------\nAdmin: "ORAN"%s",Name(playerid), LevelName(P_DATA[playerid][Level]));
  10009.  
  10010. else if(P_DATA[playerid][Level] <= 0 && P_DATA[playerid][Vip] > 0)
  10011. {
  10012. format(Str, sizeof (Str), ""W"Welcome "ORAN"%s.\n\n"W"-------------------\nVIP: "ORAN"%d",Name(playerid), P_DATA[playerid][Vip]);
  10013.  
  10014. if(P_DATA[playerid][VIPTag])
  10015. {
  10016. Delete3DTextLabel(P_DATA[playerid][Tag3D]);
  10017. P_DATA[playerid][Tag3D] = Create3DTextLabel("VIP Member", Color:BLUE, 0.0, 0.0, 0.0, 90.0, 0, 1);
  10018.  
  10019. }
  10020. }
  10021. else if(P_DATA[playerid][Level] == 0 && P_DATA[playerid][Vip] == 0)
  10022. format(Str, sizeof (Str), ""W"Welcome "ORAN"%s.\n\n"W"-------------------",Name(playerid));
  10023.  
  10024. format(Str, sizeof (Str), "%s\n"W"Online: "ORAN"%s\n"W"Kills: "ORAN"%d\n"W"Deaths: "ORAN"%d"W"\n-------------------\n",
  10025. Str,
  10026. FormatOnline(playerid),
  10027. P_DATA[playerid][Kills],
  10028. P_DATA[playerid][Deaths]);
  10029.  
  10030. SPD(playerid, 9000, BOX, ""W"Succesfully logged in!", Str, "Close", "");
  10031. }
  10032. else
  10033. {
  10034. 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")");
  10035. SPD(playerid, 9000, BOX, ""W"Succesfully logged in!", Str, "Close", "");
  10036. }
  10037. }
  10038. else
  10039. {
  10040. --P_DATA[playerid][LogFail];
  10041.  
  10042. new zStr[256];
  10043.  
  10044. if(P_DATA[playerid][LogFail] != 0)
  10045. {
  10046. 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]);
  10047.  
  10048. #if SECURITY_QUESTION == true
  10049.  
  10050. SPD(playerid, Dialog:Login2, INPUT, ""W"Account login error", zStr, "Login", "Forg. Pass");
  10051.  
  10052. #else
  10053.  
  10054. SPD(playerid, Dialog:Login2, INPUT, ""W"Account login error", zStr, "Login", "Kick");
  10055.  
  10056. #endif
  10057. }
  10058. else if(P_DATA[playerid][LogFail] <= 0)
  10059. {
  10060. GameTextForPlayer(playerid, "~r~Kicked from the server~n~~w~REASON: ~g~Exceeding login fails.", 60000, 3);
  10061. KickEx(playerid, .zReason = "Exceeding login tries", .tell = true);
  10062. }
  10063. }
  10064. }
  10065. }
  10066.  
  10067. CMD:mutecheck(PARAMS)
  10068. {
  10069. if(!P_DATA[playerid][Muted]) return SendClientMessage(playerid, Color:ORAN, "SERVER: "W"You are not muted!");
  10070.  
  10071. if(P_DATA[playerid][MutedTime] > 0)
  10072. {
  10073. FormatMSG(playerid, Color:ORAN, "SERVER:"W" You will be unmuted after "ORAN"%d"W" seconds!", P_DATA[playerid][MutedTime]);
  10074. }
  10075. else if(P_DATA[playerid][MutedTime] == 0)
  10076. {
  10077. SendClientMessage(playerid, Color:ORAN, "SERVER:"W" You will never be unmuted automatically! (Even after connect!)");
  10078. }
  10079. return 1;
  10080. }
  10081.  
  10082. Public:GodLike()
  10083. {
  10084. foreach(Player, i)
  10085. {
  10086. if(GetPVarInt(i, "0_God") == 1 || P_DATA[i][God])
  10087. {
  10088. new Float: H;
  10089. GetPlayerHealth(i, H);
  10090. if(H < 300) SetPlayerHealth(i, 9999);
  10091. }
  10092. if(GetPVarInt(i, "0_CarGod") == 1 || P_DATA[i][CarGod])
  10093. {
  10094. if(IsPlayerInAnyVehicle(i))
  10095. {
  10096. SetVehicleHealth(GetPlayerVehicleID(i), 1000);
  10097. RepairVehicle(GetPlayerVehicleID(i));
  10098. }
  10099. }
  10100. }
  10101. }
  10102. GetPlayerIPEx(playerid)
  10103. {
  10104. new pIP[30];
  10105. GetPlayerIp(playerid, pIP, sizeof(pIP));
  10106. return pIP;
  10107. }
  10108.  
  10109. SavePlayerData(playerid)
  10110. {
  10111. new Query[700];
  10112. if(AccountExist(Name(playerid)))
  10113. {
  10114. format(Query, sizeof(Query), "UPDATE `Accounts` SET \
  10115. `Online` = '%s', \
  10116. `Level` = '%d', \
  10117. `VIP` = '%d', \
  10118. `Rank` = '%d', \
  10119. `Autologin` = '%d', \
  10120. `Money` = '%d', \
  10121. `Score` = '%d', \
  10122. `Kills` = '%d', \
  10123. `Deaths` = '%d', \
  10124. `Cookies` = '%d', \
  10125. `Positive` = '%d', \
  10126. `Negative` = '%d' WHERE `Name` = '%s'",
  10127. FormatOnline(playerid),
  10128. P_DATA[playerid][Level],
  10129. P_DATA[playerid][Vip],
  10130. P_DATA[playerid][Rank],
  10131. P_DATA[playerid][pAuto],
  10132. GetPlayerMoney(playerid),
  10133. GetPlayerScore(playerid),
  10134. P_DATA[playerid][Kills],
  10135. P_DATA[playerid][Deaths],
  10136. P_DATA[playerid][Cookies],
  10137. P_DATA[playerid][Positive],
  10138. P_DATA[playerid][Negative],
  10139. Name(playerid));
  10140. DB::Query(_DB, Query);
  10141. format(Query, sizeof(Query), "UPDATE `Accounts` SET \
  10142. `Messages` = '%d', \
  10143. `Commands` = '%d', \
  10144. `fCommands` = '%d', \
  10145. `Warns` = '%d', \
  10146. `Kicks` = '%d', \
  10147. `God` = '%d', \
  10148. `Cargod` = '%d', \
  10149. `ACCPSav` = '%d', \
  10150. `BlockPM` = '%d', \
  10151. `Boost` = '%d', \
  10152. `bSpeed` = '%f', \
  10153. `WearTag` = '%d', \
  10154. `Incred` = '%d', \
  10155. `Spin` = '%d' WHERE `Name` = '%s'",
  10156. P_DATA[playerid][Msgs],
  10157. P_DATA[playerid][Cmds],
  10158. P_DATA[playerid][fCmds],
  10159. P_DATA[playerid][Warns],
  10160. P_DATA[playerid][Kicks],
  10161. P_DATA[playerid][God],
  10162. P_DATA[playerid][CarGod],
  10163. P_DATA[playerid][Accp_Saved],
  10164. P_DATA[playerid][BAPMs],
  10165. P_DATA[playerid][Boost],
  10166. Float:P_DATA[playerid][bSpeed],
  10167. P_DATA[playerid][VIPTag],
  10168. P_DATA[playerid][Incred],
  10169. P_DATA[playerid][Spin],
  10170. Name(playerid));
  10171. DB::Query(_DB, Query);
  10172. }
  10173. else
  10174. {
  10175. printf("Account: %s doesn't exist! Server tried to save data on it!", Name(playerid));
  10176. }
  10177.  
  10178.  
  10179. format(Query, sizeof (Query),"SELECT `Key` FROM `Top` WHERE `Name` = '%s' LIMIT 1", Name(playerid));
  10180.  
  10181. new DBResult:Q_RESULT;
  10182. Q_RESULT = DB::Query(_DB, Query);
  10183. if(DB::Valid(Q_RESULT))
  10184. {
  10185. DB::Free(Q_RESULT);
  10186. format(Query, sizeof (Query),"UPDATE `Top` SET `Kills` = '%d',`Deaths` = '%d',`Hours` = '%d',`Rank` = '%d',`Ratio` = '%f',`Negative` = '%d',`Positive` = '%d' WHERE `Name` = '%s'",
  10187. P_DATA[playerid][Kills],
  10188. P_DATA[playerid][Deaths],
  10189. P_DATA[playerid][Hours],
  10190. P_DATA[playerid][Rank],
  10191. (Float:P_DATA[playerid][Kills] / Float:P_DATA[playerid][Deaths]),
  10192. P_DATA[playerid][Negative],
  10193. P_DATA[playerid][Positive],
  10194. Name(playerid));
  10195. DB::Free(Q_RESULT);
  10196. DB::Query(_DB, Query);
  10197.  
  10198. }
  10199. else
  10200. {
  10201. format(Query, sizeof (Query), "INSERT INTO `Top` (`Name`,`Kills`,`Deaths`,`Hours`,`Rank`,`Ratio`,`Negative`,`Positive`) VALUES('%s','%d','%d','%d','%d','%f','%d','%d')",
  10202. Name(playerid),
  10203. P_DATA[playerid][Kills],
  10204. P_DATA[playerid][Deaths],
  10205. P_DATA[playerid][Hours],
  10206. P_DATA[playerid][Rank],
  10207. (Float:P_DATA[playerid][Kills] / Float:P_DATA[playerid][Deaths]),
  10208. P_DATA[playerid][Negative],
  10209. P_DATA[playerid][Positive]);
  10210.  
  10211. DB::Query(_DB, Query);
  10212.  
  10213. }
  10214. #if TRACK_ACCOUNTS == true
  10215.  
  10216. new
  10217. Str[24],fStr[2_0_0_0], Player = playerid;
  10218.  
  10219. format(Str, sizeof(Str) + strlen(STATS_LOC), ""#STATS_LOC"%s.ini", Name(Player));
  10220.  
  10221. new
  10222. Online[3];
  10223. TotalGameTime(Player, Online[0], Online[1], Online[2]);
  10224. format(fStr, 2_0_0_0, "Date: %s (saved on disconnect)\r\n------------------------------------------\r\n\
  10225. Registration Date: %s\r\n\
  10226. IP: %s\r\n\
  10227. Account ID: %d\r\n\
  10228. Level: %d\r\n\
  10229. VIP: %d\r\n\
  10230. Rank: %d\r\n\
  10231. Commands Used: %d\r\n\
  10232. Failed Commands: %d\r\n\
  10233. Messages Sent: %d\r\n\
  10234. Cookies: %d\r\n",
  10235. zDate (),
  10236. GPVSEx(Player, "AccountDate"),
  10237. PlayerIP[Player],
  10238. P_DATA[Player][AccID],
  10239. P_DATA[Player][Level],
  10240. P_DATA[Player][Vip],
  10241. P_DATA[Player][Rank],
  10242. P_DATA[Player][Cmds],
  10243. P_DATA[Player][fCmds],
  10244. P_DATA[Player][Msgs],
  10245. P_DATA[Player][Cookies]);
  10246. format(fStr, 2_0_0_0, "%s\
  10247. Online: %d:%d:%d\r\n\
  10248. Respect: %d/-%d\r\n\
  10249. Money: %d\r\n\
  10250. Score: %d\r\n\
  10251. Deaths: %d\r\n\
  10252. Kills: %d\r\n\
  10253. Ratio: %.3f\r\n\
  10254. Kicks Received: %d\r\n",
  10255. fStr,
  10256. Online[0], Online[1], Online[2],
  10257. P_DATA[Player][Positive],
  10258. P_DATA[Player][Negative],
  10259. GetPlayerMoney(Player),
  10260. GetPlayerScore(Player),
  10261. P_DATA[Player][Deaths],
  10262. P_DATA[Player][Kills],
  10263. (Float:P_DATA[Player][Deaths] / Float:P_DATA[Player][Kills]),
  10264. P_DATA[Player][Kicks]);
  10265.  
  10266. new
  10267. File:Stats = fopen(Str, io_append);
  10268.  
  10269. if(Stats)
  10270. {
  10271. if(fexist(Str)) fwrite(Stats, "\r\n\r\n\r\n");
  10272. fwrite(Stats, fStr);
  10273. fclose(Stats);
  10274. }
  10275.  
  10276. #endif
  10277. return 1;
  10278. }
  10279.  
  10280. RegisterPlayer(playerid, returndialog, inputtext[])
  10281. {
  10282. if(!strlen(inputtext) || strlen(inputtext) < MIN_PASS_LEN || strlen(inputtext) > MAX_PASS_LEN)
  10283. return ShowPlayerDialog
  10284. (
  10285. playerid,
  10286. returndialog,
  10287. DIALOG_STYLE_INPUT,
  10288. ""W"Register an account",
  10289. ""ORAN"ERROR:"W" An error has occured while trying to register the account, please try again!!\n\n\
  10290. Please write your desired password.", "Register", "Kick");
  10291.  
  10292. new Buf[129], Query[500], zStr[450];
  10293.  
  10294. WP_Hash(Buf, (129), inputtext);
  10295. format(Query, sizeof(Query), "INSERT INTO `Accounts` \
  10296. VALUES(NULL, '%s', '%s', '%s', '00:00:00', '%s', '0', '0', \
  10297. '0', '0', '2000', '0', '0', '0', '0', '0', '0', \
  10298. '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', \
  10299. '0', '0', '%s', '%s', '%s', '0', '0', '0')", GetPlayerIPEx(playerid), Name(playerid), Buf, zDate(), inputtext, GPVSEx(playerid, "Question"), GPVSEx(playerid, "Answer"));
  10300. DB::Query(_DB, Query);
  10301. format(Query, sizeof(Query), "SELECT `Key` FROM `Accounts` WHERE `Name` = '%s'", Name(playerid));
  10302. new DBResult:Result = DB::Query(_DB, Query);
  10303.  
  10304. if(Result)
  10305. {
  10306. if(DB::Valid(Result))
  10307. {
  10308. new Field[15];
  10309. DB::GetField(Result, "Key", Field, sizeof(Field));
  10310. S_DATA[sAccounts] = strval(Field);
  10311. P_DATA[playerid][AccID] = strval(Field);
  10312.  
  10313. DB::Free(Result);
  10314. }
  10315. }
  10316.  
  10317. #if SECURITY_QUESTION == true
  10318.  
  10319. format(zStr, sizeof (zStr), ""W"Account succesfully created!\n\n\
  10320. "ORAN"["W" Account Information "ORAN"]\n\
  10321. "W"Account: "BLUE"%s\n\
  10322. "W"Password: "BLUE"%s\n\
  10323. "W"Account ID: "BLUE"%d\n\
  10324. "W"Created On: "BLUE"%s\n", Name(playerid), inputtext, S_DATA[sAccounts], zDate());
  10325.  
  10326. format(zStr, sizeof (zStr), "%s\
  10327. "W"Secret Question: "BLUE"%s\n\
  10328. "W"Secret Answer: "BLUE"%s\n\n\n\
  10329. Thanks for registering an account.\n\
  10330. Please procceed with login.", zStr, GPVSEx(playerid, "Question"), GPVSEx(playerid, "Answer"));
  10331.  
  10332. #else
  10333.  
  10334. format(zStr, sizeof (zStr), ""W"Account succesfully created!\n\n\
  10335. "ORAN"["W" Account Information "ORAN"]\n\
  10336. "W"Account: "BLUE"%s\n\
  10337. "W"Password: "BLUE"%s\n\
  10338. "W"Account ID: "BLUE"%d\n\
  10339. "W"Created On: "BLUE"%s\n\n\
  10340. Thanks for registering an account.\n\
  10341. Please procceed with login.", Name(playerid), inputtext, S_DATA[sAccounts], zDate());
  10342.  
  10343. #endif
  10344. SPD(playerid, Dialog:Login, BOX, ""W"Account Information", zStr, "Continue", "");
  10345.  
  10346. new INI:
  10347. Accounts = INI_Open(USER_ID);
  10348. INI_WriteInt(Accounts, "Accounts_Created", S_DATA[sAccounts]);
  10349. INI_WriteString(Accounts, "Last_Account", Name(playerid));
  10350. INI_WriteString(Accounts, "Last_Account_Date", zDate());
  10351. INI_Close(Accounts);
  10352. return 1;
  10353. }
  10354. FormatOnline(playerid)
  10355. {
  10356. new zStr[15], T[3];
  10357. TotalGameTime(playerid, T[0], T[1], T[2]);
  10358. format(zStr, sizeof (zStr), "%d:%d:%d", T[0], T[1], T[2]);
  10359. return zStr;
  10360. }
  10361. ClearVars(playerid)
  10362. {
  10363. DestroyVehicle(P_DATA[playerid][GiveCar]);
  10364. Delete3DTextLabel(P_DATA[playerid][Tag3D]);
  10365.  
  10366. P_DATA[playerid][Kills] = 0;
  10367. P_DATA[playerid][Deaths] = 0;
  10368. P_DATA[playerid][Hours] = 0;
  10369. P_DATA[playerid][Rank] = 0;
  10370. P_DATA[playerid][Msgs] = 0;
  10371. P_DATA[playerid][Cmds] = 0;
  10372. P_DATA[playerid][fCmds] = 0;
  10373. P_DATA[playerid][Cookies] = 0;
  10374. P_DATA[playerid][Negative] = 0;
  10375. P_DATA[playerid][Positive] = 0;
  10376. P_DATA[playerid][Money] = 0;
  10377. P_DATA[playerid][Score] = 0;
  10378. P_DATA[playerid][Banned] = 0;
  10379. P_DATA[playerid][Kicks] = 0;
  10380. P_DATA[playerid][Logged] = 0;
  10381. P_DATA[playerid][Muted] = 0;
  10382. P_DATA[playerid][Frozen] = 0;
  10383. P_DATA[playerid][Jailed] = 0;
  10384. P_DATA[playerid][MutedTime] = 0;
  10385. P_DATA[playerid][JailTime] = 0;
  10386. P_DATA[playerid][tLevel] = 0;
  10387. P_DATA[playerid][PMSent] = 0;
  10388. P_DATA[playerid][RepMSG] = EOS;
  10389. P_DATA[playerid][Warns] = 0;
  10390. P_DATA[playerid][aCar] = -1;
  10391. P_DATA[playerid][pAuto] = 0;
  10392. P_DATA[playerid][MutedAll] = 0;
  10393. P_DATA[playerid][Accp_Saved] = 0;
  10394. P_DATA[playerid][A_Color] = 0;
  10395. P_DATA[playerid][A_Component1] = 0;
  10396. P_DATA[playerid][A_Component2] = 0;
  10397. P_DATA[playerid][A_Component3] = 0;
  10398. P_DATA[playerid][A_Component4] = 0;
  10399. P_DATA[playerid][A_Wheels] = 0;
  10400. P_DATA[playerid][Spin] = 0;
  10401. P_DATA[playerid][VIPTag] = 0;
  10402.  
  10403. P_DATA[playerid][Spec_ID] = 0xFFFF;
  10404. P_DATA[playerid][Spec_Type] = ADMIN_SPEC_TYPE_NONE;
  10405. }
  10406.  
  10407. Public:ParseUserID(name[], value[])if(!strcmp(name, "Accounts_Created")) S_DATA[sAccounts] = strval(value);
  10408.  
  10409. Public:LoadServerData(name[], value[])
  10410. {
  10411. if(!strcmp(name, INI_Server_Info[0][isName])) S_DATA[AntiSpam] = strval(value);
  10412. if(!strcmp(name, INI_Server_Info[1][isName])) S_DATA[AntiCSpam] = strval(value);
  10413. if(!strcmp(name, INI_Server_Info[2][isName])) S_DATA[Ping] = strval(value);
  10414. if(!strcmp(name, INI_Server_Info[3][isName])) S_DATA[RCONProt] = strval(value);
  10415. if(!strcmp(name, INI_Server_Info[4][isName])) S_DATA[TellPlayer] = strval(value);
  10416. if(!strcmp(name, INI_Server_Info[5][isName])) S_DATA[Chat] = strval(value);
  10417. if(!strcmp(name, INI_Server_Info[6][isName])) S_DATA[ReadPM] = strval(value);
  10418. if(!strcmp(name, INI_Server_Info[7][isName])) S_DATA[ReadCMD] = strval(value);
  10419. if(!strcmp(name, INI_Server_Info[8][isName])) S_DATA[AKA] = strval(value);
  10420. if(!strcmp(name, INI_Server_Info[9][isName])) S_DATA[ShowFunction] = strval(value);
  10421. if(!strcmp(name, INI_Server_Info[10][isName])) S_DATA[AntiRepeat] = strval(value);
  10422. if(!strcmp(name, INI_Server_Info[11][isName])) S_DATA[AutoLogin] = strval(value);
  10423. if(!strcmp(name, INI_Server_Info[12][isName])) S_DATA[AnnRank] = strval(value);
  10424. if(!strcmp(name, INI_Server_Info[13][isName])) S_DATA[AntiAD] = strval(value);
  10425. if(!strcmp(name, INI_Server_Info[14][isName])) S_DATA[AdminChat] = strval(value);
  10426. if(!strcmp(name, INI_Server_Info[15][isName])) S_DATA[VipChat] = strval(value);
  10427. }
  10428.  
  10429.  
  10430. Public:LoadPlayerData(playerid)
  10431. {
  10432. new Query[750], DBResult:Result;
  10433.  
  10434. format(Query, 750, "SELECT `IP`, `Level`, `VIP`, \
  10435. `Rank`, `Money`, `Score`, \
  10436. `Kills`, `Deaths`, `Cookies`, \
  10437. `Positive`, `Negative`, `Messages`, \
  10438. `Commands`, `fCommands`, `Warns`, \
  10439. `Kicks`, `God`, `Cargod`, \
  10440. `ACCP`, `ACCPSav`, `BlockPM`, \
  10441. `Key`, `Boost`, `bSpeed` `JoinDate`, `Online`, \
  10442. `Spin`, `WearTAG`, `Incred` FROM `Accounts` WHERE `Name` = '%s';", Name(playerid));
  10443. Result = DB::Query(_DB, Query);
  10444.  
  10445. if(Result)
  10446. {
  10447. if(DB::Valid(Result))
  10448. {
  10449. new Field[30];
  10450.  
  10451. _GetField<"Key">Store<AccID>
  10452. _GetField<"Level">Store<Level>
  10453. _GetField<"VIP">Store<Vip>
  10454. _GetField<"Rank">Store<Rank>
  10455. _GetField<"Kills">Store<Kills>
  10456. _GetField<"Deaths">Store<Deaths>
  10457. _GetField<"Cookies">Store<Cookies>
  10458. _GetField<"Positive">Store<Positive>
  10459. _GetField<"Negative">Store<Negative>
  10460. _GetField<"Messages">Store<Msgs>
  10461. _GetField<"Commands">Store<Cmds>
  10462. _GetField<"fCommands">Store<fCmds>
  10463. _GetField<"Warns">Store<Warns>
  10464. _GetField<"Kicks">Store<Kicks>
  10465. _GetField<"God">Store<God>
  10466. _GetField<"Cargod">Store<CarGod>
  10467. _GetField<"ACCPSav">Store<Accp_Saved>
  10468. _GetField<"BlockPM">Store<BAPMs>
  10469. _GetField<"Boost">Store<Boost>
  10470. _GetField<"Spin">Store<Spin>
  10471. _GetField<"WearTAG">Store<VIPTag>
  10472. _GetField<"Incred">Store<Incred>
  10473.  
  10474. DB::GetField(Result, "bSpeed", Field, sizeof(Field));
  10475. P_DATA[playerid][bSpeed] = floatstr(Field);
  10476.  
  10477. DB::GetField(Result, "IP", Field, sizeof(Field));
  10478. PlayerIP[playerid] = Field;
  10479.  
  10480. DB::GetField(Result, "Money", Field, sizeof(Field));
  10481. GivePlayerMoney(playerid, strval(Field));
  10482.  
  10483. DB::GetField(Result, "Score", Field, sizeof(Field));
  10484. SetPlayerScore(playerid, GetPlayerScore(playerid) + strval(Field));
  10485.  
  10486. DB::GetField(Result, "ACCP", Field, sizeof(Field));
  10487. SetPVarString(playerid, "ACCP_DATA", Field);
  10488.  
  10489. DB::GetField(Result, "Online", Field, sizeof(Field));
  10490. SetPVarString(playerid, "Online", Field);
  10491.  
  10492. DB::GetField(Result, "JoinDate", Field, sizeof(Field));
  10493. SetPVarString(playerid, "AccountDate", Field);
  10494.  
  10495. DB::Free(Result);
  10496. }
  10497. }
  10498. }
  10499.  
  10500. Public:UnMutePlayer(playerid)
  10501. {
  10502. --P_DATA[playerid][MutedTime];
  10503.  
  10504. if(!P_DATA[playerid][MutedTime])
  10505. {
  10506. KillTimer(MuteTimer[playerid]);
  10507. UnMutePlayer(playerid);
  10508. P_DATA[playerid][MutedTime] = 0;
  10509. P_DATA[playerid][Muted] = 0;
  10510.  
  10511. SendClientMessage(playerid, -1, ""ORAN"SERVER:"W" You have been unmuted by the system!");
  10512. #if SAVE_MUTE == true
  10513.  
  10514. new
  10515. Query[256];
  10516. format(Query, 256, "DELETE FROM `Muted` WHERE `IP` = '%s'", GetPlayerIPEx(playerid));
  10517. DB::Query(_DB, Query);
  10518.  
  10519. #endif
  10520. }
  10521. else if(P_DATA[playerid][MutedTime] == 1){
  10522. GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~r~~h~MUTE INFO~n~~r~~h~One~w~ minute left", 10000, 3);}
  10523.  
  10524. else if(P_DATA[playerid][MutedTime] > 1)
  10525. {
  10526. new Str[129];
  10527. 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]);
  10528. GameTextForPlayer(playerid, Str, 10000, 3);
  10529. }
  10530. return 1;
  10531. }
  10532. GPVSEx(playerid, zPVSTR[] )
  10533. {
  10534. new zStr[129];
  10535. GetPVarString(playerid, zPVSTR, zStr, 129);
  10536. return zStr;
  10537. }
  10538.  
  10539. BanEx2(playerid, zAdmin[] = "System", zReason[] = "No Reason")
  10540. {
  10541. new
  10542. zStr[256];
  10543. #if SAVE_IN_LOGS == true
  10544. new
  10545. File:zFile;
  10546.  
  10547. format(zStr, sizeof (zStr), "Player: %s[%i] has been banned by \"%s\" with reason \"%s\" on %s\r\n",
  10548. Name(playerid),
  10549. playerid,
  10550. zAdmin,
  10551. zReason,
  10552. zDate());
  10553.  
  10554.  
  10555. zFile = fopen(BAN_LOG, io_append);
  10556. if(zFile)
  10557. {
  10558. fwrite(zFile, zStr);
  10559. fclose(zFile);
  10560. }
  10561. #else
  10562. #pragma unused zAdmin
  10563. #endif
  10564.  
  10565.  
  10566. new Query[129];
  10567. format(Query, 129, "INSERT INTO `Banlist` VALUES('%s', '%s', '%s', '%s', '%s')", GetPlayerIPEx(playerid), Name(playerid), zReason, zAdmin, zDate());
  10568. FormatMSG(playerid, Color:ORAN, "SERVER:"W" You have been banned from this server! "W"["GREY" %s"W"]", zReason);
  10569. KickAfter(playerid);
  10570.  
  10571.  
  10572.  
  10573. return 1;
  10574. }
  10575.  
  10576.  
  10577.  
  10578. Public:KickAfterTimer(playerid) return Kick(playerid);
  10579. KickAfter(playerid, time = 1200 ){ SetTimerEx("KickAfterTimer", time, false, "i", playerid);}
  10580.  
  10581. BadRcon(zIP[], zPassword[], zAdmin[] = "System", zReason[] = "RCON Login Attempt")
  10582. {
  10583. new
  10584. zStr[256];
  10585. #if SAVE_IN_LOGS == true
  10586. new
  10587. File:zFile;
  10588.  
  10589. format(zStr, sizeof (zStr), "IP \"%s\" has been banned by \"%s\" with reason \"%s\" and password \"%s\" on %s\r\n",
  10590. zIP,
  10591. zAdmin,
  10592. zReason,
  10593. zPassword,
  10594. zDate());
  10595.  
  10596.  
  10597. zFile = fopen(RCON_LOG, io_append);
  10598. if(zFile)
  10599. {
  10600. fwrite(zFile, zStr);
  10601. fclose(zFile);
  10602. }
  10603. #else
  10604. #pragma unused zPassword
  10605. #endif
  10606. format(zStr, sizeof (zStr), ""ORAN"Ban Info: "W"IP "ORAN"\"%s\""W" has been IP banned by "ORAN"\"%s\" "W"with reason"ORAN" \"%s\"",
  10607. zIP,
  10608. zAdmin,
  10609. zReason);
  10610.  
  10611. SendMessageToAdmins(.zMessage = zStr);
  10612.  
  10613.  
  10614. format(zStr, sizeof (zStr), "banip %s", zIP);
  10615. SendRconCommand(zStr);
  10616. return 1;
  10617. }
  10618. KickEx(playerid, zAdmin[] = "System", zReason[] = "No Reason", tell = true)
  10619. {
  10620. new zStr[256];
  10621. #if SAVE_IN_LOGS == true
  10622. new
  10623. File:zFile;
  10624.  
  10625. format(zStr, sizeof (zStr), "Player: %s[%i] has been kicked by \"%s\" with reason \"%s\" on %s\r\n",
  10626. Name(playerid),
  10627. playerid,
  10628. zAdmin,
  10629. zReason,
  10630. zDate());
  10631.  
  10632.  
  10633. zFile = fopen(KICK_LOG, io_append);
  10634. if(zFile)
  10635. {
  10636. fwrite(zFile, zStr);
  10637. fclose(zFile);
  10638. }
  10639. #endif
  10640. if(tell)
  10641. {
  10642.  
  10643. format(zStr, sizeof (zStr), ""ORAN"Kick Info: "W"Player "ORAN"%s[%i]"W" has been kicked by "ORAN"\"%s\" "W"with reason"ORAN" \"%s\"",
  10644. Name(playerid),
  10645. playerid,
  10646. zAdmin,
  10647. zReason);
  10648.  
  10649. SendMessageToAdmins(.zMessage = zStr);
  10650.  
  10651. }
  10652.  
  10653. P_DATA[playerid][Kicks] += 1;
  10654.  
  10655. new Query[120];
  10656.  
  10657. if(AccountExist(Name(playerid)))
  10658. {
  10659. format(Query, 120, "UPDATE `Accounts` SET `Kicks` = '%d' WHERE `Name` = '%s'", P_DATA[playerid][Kicks], Name(playerid));
  10660. DB::Query(_DB, Query);
  10661. }
  10662.  
  10663.  
  10664. KickAfter(playerid);
  10665. return 1;
  10666. }
  10667.  
  10668. SendMessageToAdmins(zColor = -1, zMessage[], level = 1)
  10669. {
  10670. foreach(Player, A)
  10671. {
  10672. if(P_DATA[A][Level] >= level)
  10673. {
  10674. SendClientMessage(A, zColor, zMessage);
  10675. }
  10676. }
  10677. return 1;
  10678. }
  10679.  
  10680. zDate(ms = false)
  10681. {
  10682. new zStr[30];
  10683. if(ms)
  10684. {
  10685. new Date[6];
  10686. getdate(Date[0], Date[1], Date[2]);
  10687. gettime(Date[3], Date[4], Date[5]);
  10688. format(zStr, sizeof (zStr), "%d/%d/%d %d:%d:%d", Date[2], Date[1], Date[0], Date[3], Date[4], Date[5]);
  10689. }
  10690. else
  10691. {
  10692. new Date[5];
  10693. getdate(Date[0], Date[1], Date[2]);
  10694. gettime(Date[3], Date[4]);
  10695. format(zStr, sizeof (zStr), "%d/%d/%d %d:%d", Date[2], Date[1], Date[0], Date[3], Date[4]);
  10696. }
  10697. return zStr;
  10698. }
  10699.  
  10700.  
  10701. Name(playerid)
  10702. {
  10703. new zName[MAX_PLAYER_NAME];
  10704. GetPlayerName(playerid, zName, MAX_PLAYER_NAME);
  10705. return zName;
  10706. }
  10707.  
  10708. TotalGameTime(playerid, &h=0, &m=0, &s=0)
  10709. {
  10710. P_DATA[playerid][TotalTime] = ((gettime() - P_DATA[playerid][ConnTime]) + (P_DATA[playerid][Hours]*60*60) + (P_DATA[playerid][Minutes]*60) + (P_DATA[playerid][Seconds]));
  10711.  
  10712. h = floatround(P_DATA[playerid][TotalTime] / 3600, floatround_floor);
  10713. m = floatround(P_DATA[playerid][TotalTime] / 60, floatround_floor) % 60;
  10714. s = floatround(P_DATA[playerid][TotalTime] % 60, floatround_floor);
  10715.  
  10716. return P_DATA[playerid][TotalTime];
  10717. }
  10718.  
  10719.  
  10720. Public:VehicleOccupied(v)
  10721. {
  10722. foreach(Player, i)
  10723. {
  10724. if(IsPlayerInVehicle(i, v)) return 1;
  10725. }
  10726. return 0;
  10727. }
  10728. SendError(playerid, error[])
  10729. {
  10730. new Str[256];
  10731. format(Str, sizeof (Str), "* "GREY"%s", error);
  10732. SendClientMessage(playerid, Color:ORAN, Str);
  10733. return 1;
  10734. }
  10735. SendUsage(playerid, usage[], function[] = "don't send function" )
  10736. {
  10737. new Str[256];
  10738. format(Str, sizeof (Str), "Usage: {FFFFFF} %s", usage);
  10739. SendClientMessage(playerid, Color:GREE, Str);
  10740. if(strcmp(function, "don't send function") && S_DATA[ShowFunction])
  10741. {
  10742. format(Str, sizeof (Str), "Function: {FFFFFF} %s", function);
  10743. SendClientMessage(playerid, Color:FUNC, Str);
  10744. }
  10745.  
  10746. return 1;
  10747. }
  10748. MiniFormat(number, extra[] = ";")
  10749. {
  10750. new fStr[256];
  10751. if(strcmp(extra, ";"))format(fStr, sizeof (fStr), "%d %s", number, extra);
  10752. else format(fStr, sizeof (fStr), "%d", number);
  10753. return fStr;
  10754. }
  10755.  
  10756. EX(ex)
  10757. {
  10758. new ex2[10];
  10759. format(ex2, sizeof (ex2), "Yes | %d", ex);
  10760. return ex2;
  10761. }
  10762. stock IsValidSkin(SkinID)
  10763. {
  10764. switch(SkinID)
  10765. {
  10766. case 0..41: return 1; case 43..64: return 1; case 66..73: return 1;
  10767. case 75..85: return 1; case 87..118: return 1; case 120..148: return 1;
  10768. case 150..207: return 1; case 209..264: return 1; case 274..288: return 1;
  10769. case 290..299: return 1;
  10770. default: return 0;
  10771. }
  10772. return 0;
  10773. }
  10774. IsValidWeapon(weaponid)
  10775. {
  10776. switch(weaponid)
  10777. {
  10778. case 1..18: return 1;
  10779. case 22..46: return 1;
  10780. }
  10781. return 0;
  10782. }
  10783. GetVModelFromName(vName[])
  10784. {
  10785. for (new i = 400; i <= 611; i++)
  10786. if(strfind(vNames[i - 400], vName, true) != -1)
  10787. return i;
  10788.  
  10789. return -1;
  10790. }
  10791. GetWeaponIDFromName(WeaponName[])
  10792. {
  10793. if(strfind("molotov", WeaponName, true) !=-1) return 18;
  10794. for (new i = 0; i <= 46; i++)
  10795. {
  10796. switch(i)
  10797. {
  10798. case 0, 19, 20, 21, 44, 45: continue;
  10799. default:
  10800. {
  10801. new name[32]; GetWeaponName(i, name, 32);
  10802. if(strfind(name, WeaponName, true) != -1)
  10803. return i;
  10804. }
  10805. }
  10806. }
  10807. return -1;
  10808. }
  10809. stock GetServerHostName()
  10810. {
  10811. new gString[128];
  10812. GetServerVarAsString("hostname", gString, sizeof(gString));
  10813. return gString;
  10814. }
  10815. stock IsNumeric(string[])
  10816. {
  10817. for (new i = 0, j = strlen(string);i < j; i++)
  10818. {
  10819. if(string[i] > '9' || string[i] < '0')
  10820. return 0;
  10821. }
  10822. return 1;
  10823. }
  10824. stock
  10825. FormatNumber(
  10826. { _, Float, Text3D, Menu, Text, DB, DBResult, bool, File, hex, bit, bit_byte, Bit }:xVariable, iDecimals = -1, iThousandSeparator = ',', iDecimalPoint = '.', iTag = tagof(xVariable))
  10827. {
  10828. static
  10829. s_szReturn[32],
  10830. s_szThousandSeparator[2] = { ' ', EOS },
  10831. s_iDecimalPos,
  10832. s_iChar,
  10833. s_iSepPos
  10834. ;
  10835.  
  10836. if(iTag == tagof(bool:))
  10837. {
  10838. if(xVariable)
  10839. memcpy(s_szReturn, "true", 0, 5 * (cellbits / 8));
  10840. else
  10841. memcpy(s_szReturn, "false", 0, 6 * (cellbits / 8));
  10842.  
  10843. return s_szReturn;
  10844. }
  10845. else if(iTag == tagof(Float:))
  10846. {
  10847. if(iDecimals == -1)
  10848. iDecimals = 8;
  10849.  
  10850. format(s_szReturn, sizeof(s_szReturn), "%.*f", iDecimals, xVariable);
  10851. }
  10852. else if(iTag == tagof(hex:) || iTag == tagof(Hex:))
  10853. {
  10854. format(s_szReturn, sizeof(s_szReturn), "0x" "%04h%04h", (xVariable & (0xFFFF0000)) >>> 16, xVariable & (0x0000FFFF));
  10855.  
  10856. return s_szReturn;
  10857. }
  10858. else if(iTag == tagof(bit:) || iTag == tagof(Bit:))
  10859. {
  10860. format(s_szReturn, sizeof(s_szReturn), "0b" "%08b%08b%08b%08b", (xVariable & 0xFF000000) >>> 24, (xVariable & 0x00FF0000) >>> 16, (xVariable & 0x0000FF00) >>> 8, (xVariable & 0x000000FF));
  10861.  
  10862. return s_szReturn;
  10863. }
  10864. else if(iTag == tagof(bit_byte:))
  10865. {
  10866. format(s_szReturn, sizeof(s_szReturn), "0b" "%08b", (xVariable & 0x000000FF));
  10867.  
  10868. return s_szReturn;
  10869. }
  10870. else
  10871. {
  10872. format(s_szReturn, sizeof(s_szReturn), "%d", xVariable);
  10873.  
  10874. if(iDecimals > 0)
  10875. {
  10876. strcat(s_szReturn, ".");
  10877.  
  10878. while (iDecimals--)
  10879. strcat(s_szReturn, "0");
  10880. }
  10881. }
  10882.  
  10883. s_iDecimalPos = strfind(s_szReturn, ".");
  10884.  
  10885. if(s_iDecimalPos == -1)
  10886. s_iDecimalPos = strlen(s_szReturn);
  10887. else
  10888. s_szReturn[s_iDecimalPos] = iDecimalPoint;
  10889.  
  10890. if(s_iDecimalPos >= 4 && iThousandSeparator)
  10891. {
  10892. s_szThousandSeparator[0] = iThousandSeparator;
  10893.  
  10894. s_iChar = s_iDecimalPos;
  10895. s_iSepPos = 0;
  10896.  
  10897. while (--s_iChar > 0)
  10898. {
  10899. if(++s_iSepPos == 3)
  10900. {
  10901. strins(s_szReturn, s_szThousandSeparator, s_iChar);
  10902.  
  10903. s_iSepPos = 0;
  10904. }
  10905. }
  10906. }
  10907. return s_szReturn;
  10908. }
  10909.  
  10910. stock AccountExist(name[])
  10911. {
  10912. new Buffer[240], Entry, DBResult:Result;
  10913.  
  10914. format(Buffer, sizeof(Buffer), "SELECT `Key` FROM `Accounts` WHERE `Name` = '%s'",name);
  10915. Result = DB::Query(_DB, Buffer);
  10916.  
  10917. if(Result)
  10918. {
  10919. if(DB::Valid(Result))
  10920. {
  10921. Entry = 1;
  10922. DB::Free(Result);
  10923. }
  10924. else Entry = 0;
  10925. }
  10926. return Entry;
  10927. }
  10928. Public:Display()
  10929. {
  10930. 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");
  10931. 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");
  10932. print("\124\124\t \48\65\100\109\105\110 \118"#Version"\t\t\124\124");
  10933. 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");
  10934. print("\124\124\t\t\t\t\124\124");
  10935. print("\124\124\t\77\97\100\101 \98\121 \90\104\51\114\48\t\t\124\124");
  10936. print("\124\124\t\t\t\t\124\124");
  10937. print("\124\124\t\76\111\97\100\101\100 \83\117\99\99\101\115\102\117\108\108\121\t\124\124");
  10938. print("\124\124\t\t\t\t\124\124");
  10939. printf("\124\124\t%s\t\t\124\124", zDate());
  10940. print("\124\124\t\t\t\t\124\124");
  10941. 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");
  10942. print("\124\124\t\t\t\t\124\124");
  10943. 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");
  10944. print("\124\124 \75\101\101\112 \116\104\101 \99\114\101\100\105\116\115\33 \124\t\124\124");
  10945. 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");
  10946. print("\124\124\t\t\t\t\124\124");
  10947. 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");
  10948. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement