Advertisement
Guest User

Untitled

a guest
May 26th, 2015
272
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 169.87 KB | None | 0 0
  1. //============================================================================//
  2.  
  3. /*
  4.  
  5. ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  6. ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  7. ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  8.  
  9. JaKe's Administration System 3.3 Patch I [NEW ERA] - Scripted from scratch!
  10. Scripted by Jake Hero.
  11. Never been bitter.
  12.  
  13. NOTE: Lots of changes has been made on 3.3, Please remove all the old datas from the scriptfiles of JakAdmin that uses 3.2 and below.
  14. //Ignore the note on the new patch if you have already used JakAdmin3.3.
  15.  
  16. NOTE2: Delete the juser.db, a new row in the .db file has been added.
  17.  
  18. Changelog since JakAdmin3 Patch I:
  19.  
  20. • Security Updates for Patch I.
  21. • Major bug fixes on the script core which isn't discovered in early beta testing.
  22. • A large/huge error on coding the database has been sealed and fixed (IMPORTANT)
  23. • Security Question for the player's account has been implemented back.
  24. • More better and accurate Security Question than JakAdmin 3.2.
  25. • A typo on the print message which displays '2014' instead of '2015', It has been updated.
  26. • Added a check folder script to avoid the server crash.
  27. • Added a Restart Command which wasn't added on the early stages of JakAdmin3.
  28. • Some new commands besides of the Security Patch such as /carpjob.
  29. • A new updated version of OPRL provided by Lordzy.
  30. • Added an option on the command /login to type 'forget'.
  31. • Replaced the login's dialog 2nd option button from 'Quit' to 'Forget'
  32. • An error on inserting a new registered player through /register has been fixed and synced with the code from the dialog.
  33. • Replaces some parts of the script which uses standard loop with the foreach.
  34. • Improved SQL Injection Protection on the Player Database.
  35. • Added a code which prevents from anyone using SQL Injection on the ban database.
  36. • Extended string for /jacmds.
  37.  
  38. Credits goes to: Zeex, SA-MP Team, Y_Less, Lordzy and for everyone who helped me on beta testing.
  39.  
  40. ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  41. ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  42. ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  43.  
  44. */
  45.  
  46. //============================================================================//
  47.  
  48. //JakAdmin Includes
  49.  
  50. #include <a_samp>
  51. //#include <a_whirlpool>
  52. native WP_Hash(buffer[], len, const str[]);
  53. #include <zcmd>
  54. #include <sscanf2>
  55. #include <foreach>
  56. #include <YSI\y_scripting>
  57.  
  58. #pragma dynamic 39470
  59.  
  60. //============================================================================//
  61.  
  62. //Variables, Defnes and other stuffs starts here.
  63.  
  64. stock
  65. st[100]
  66. ;
  67.  
  68. //Public Macro
  69. #define function:%0(%1)\
  70. forward %0(%1);\
  71. public %0(%1)
  72.  
  73. //Level Check Macro
  74. //Level Check Macro
  75. #define LevelCheck(%0,%1); \
  76. if(User[(%0)][accountAdmin] < %1 && !IsPlayerAdmin((%0)))\
  77. return format(st, 100, "Du musst den admin level %d besitzen um diesen Befehl auszuführen.", (%1)),\
  78. SendClientMessage((%0), -1, st);
  79.  
  80.  
  81. //Login Check Macro
  82. #define LoginCheck(%1) if(User[%1][accountLogged] == false) return SendClientMessage(%1, COLOR_RED, "Du musst eingeloggt sein um diesen Befehl auszuführen.")
  83.  
  84. //Do not change the file type to .ini, We uses SQLite.
  85. #define _DB_ "JakAdmin3/Spieler.db"
  86. //The location and folder has been changed on 3.3.
  87.  
  88. #define _LOG_ "JakAdmin3/Logs/"
  89. //The location and folder for the log has been also changed on 3.3.
  90.  
  91. new _God[MAX_PLAYERS];
  92. new reportmsg[4][136];
  93.  
  94. new SpecInt[MAX_PLAYERS][2];
  95. new Float:SpecPos[MAX_PLAYERS][4];
  96.  
  97. new GameTimer[MAX_PLAYERS];
  98.  
  99. new VehicleNames[212][] = {
  100. {"Landstalker"},{"Bravura"},{"Buffalo"},{"Linerunner"},{"Perrenial"},{"Sentinel"},{"Dumper"},
  101. {"Firetruck"},{"Trashmaster"},{"Stretch"},{"Manana"},{"Infernus"},{"Voodoo"},{"Pony"},{"Mule"},
  102. {"Cheetah"},{"Ambulance"},{"Leviathan"},{"Moonbeam"},{"Esperanto"},{"Taxi"},{"Washington"},
  103. {"Bobcat"},{"Mr Whoopee"},{"BF Injection"},{"Hunter"},{"Premier"},{"Enforcer"},{"Securicar"},
  104. {"Banshee"},{"Predator"},{"Bus"},{"Rhino"},{"Barracks"},{"Hotknife"},{"Trailer 1"},{"Previon"},
  105. {"Coach"},{"Cabbie"},{"Stallion"},{"Rumpo"},{"RC Bandit"},{"Romero"},{"Packer"},{"Monster"},
  106. {"Admiral"},{"Squalo"},{"Seasparrow"},{"Pizzaboy"},{"Tram"},{"Trailer 2"},{"Turismo"},
  107. {"Speeder"},{"Reefer"},{"Tropic"},{"Flatbed"},{"Yankee"},{"Caddy"},{"Solair"},{"Berkley's RC Van"},
  108. {"Skimmer"},{"PCJ-600"},{"Faggio"},{"Freeway"},{"RC Baron"},{"RC Raider"},{"Glendale"},{"Oceanic"},
  109. {"Sanchez"},{"Sparrow"},{"Patriot"},{"Quad"},{"Coastguard"},{"Dinghy"},{"Hermes"},{"Sabre"},
  110. {"Rustler"},{"ZR-350"},{"Walton"},{"Regina"},{"Comet"},{"BMX"},{"Burrito"},{"Camper"},{"Marquis"},
  111. {"Baggage"},{"Dozer"},{"Maverick"},{"News Chopper"},{"Rancher"},{"FBI Rancher"},{"Virgo"},{"Greenwood"},
  112. {"Jetmax"},{"Hotring"},{"Sandking"},{"Blista Compact"},{"Police Maverick"},{"Boxville"},{"Benson"},
  113. {"Mesa"},{"RC Goblin"},{"Hotring Racer A"},{"Hotring Racer B"},{"Bloodring Banger"},{"Rancher"},
  114. {"Super GT"},{"Elegant"},{"Journey"},{"Bike"},{"Mountain Bike"},{"Beagle"},{"Cropdust"},{"Stunt"},
  115. {"Tanker"}, {"Roadtrain"},{"Nebula"},{"Majestic"},{"Buccaneer"},{"Shamal"},{"Hydra"},{"FCR-900"},
  116. {"NRG-500"},{"HPV1000"},{"Cement Truck"},{"Tow Truck"},{"Fortune"},{"Cadrona"},{"FBI Truck"},
  117. {"Willard"},{"Forklift"},{"Tractor"},{"Combine"},{"Feltzer"},{"Remington"},{"Slamvan"},
  118. {"Blade"},{"Freight"},{"Streak"},{"Vortex"},{"Vincent"},{"Bullet"},{"Clover"},{"Sadler"},
  119. {"Firetruck LA"},{"Hustler"},{"Intruder"},{"Primo"},{"Cargobob"},{"Tampa"},{"Sunrise"},{"Merit"},
  120. {"Utility"},{"Nevada"},{"Yosemite"},{"Windsor"},{"Monster A"},{"Monster B"},{"Uranus"},{"Jester"},
  121. {"Sultan"},{"Stratum"},{"Elegy"},{"Raindance"},{"RC Tiger"},{"Flash"},{"Tahoma"},{"Savanna"},
  122. {"Bandito"},{"Freight Flat"},{"Streak Carriage"},{"Kart"},{"Mower"},{"Duneride"},{"Sweeper"},
  123. {"Broadway"},{"Tornado"},{"AT-400"},{"DFT-30"},{"Huntley"},{"Stafford"},{"BF-400"},{"Newsvan"},
  124. {"Tug"},{"Trailer 3"},{"Emperor"},{"Wayfarer"},{"Euros"},{"Hotdog"},{"Club"},{"Freight Carriage"},
  125. {"Trailer 3"},{"Andromada"},{"Dodo"},{"RC Cam"},{"Launch"},{"Police Car (LSPD)"},{"Police Car (SFPD)"},
  126. {"Police Car (LVPD)"},{"Police Ranger"},{"Picador"},{"S.W.A.T. Van"},{"Alpha"},{"Phoenix"},{"Glendale"},
  127. {"Sadler"},{"Luggage Trailer A"},{"Luggage Trailer B"},{"Stair Trailer"},{"Boxville"},{"Farm Plow"},
  128. {"Utility Trailer"}
  129. };
  130.  
  131. //Configuration
  132. #define VERSION "3.3 Patch I"
  133.  
  134. #define ADMIN_SPEC_TYPE_NONE 0
  135. #define ADMIN_SPEC_TYPE_PLAYER 1
  136. #define ADMIN_SPEC_TYPE_VEHICLE 2
  137.  
  138. #define STARTING_SCORE 1
  139. //Starting score for registered player.
  140. #define STARTING_CASH 10000
  141. //Starting cash for registered player.
  142. #define MAX_RCON_WARNINGS 3
  143. //Max warnings for attempting to logged in RCON.
  144. //Change the starting score and starting cash.
  145. #define LOG true
  146. //Change to false if you want to disable making logs on the server (Such as saving kicks etc, ban messages).
  147. #define AUTO_LOGIN true
  148. //Change to false if you want to disable the auto-login system.
  149. #define REGISTER_DIALOG true
  150. //Change to false if you want to disable the register/login dialog.
  151. #define READ_COMMANDS true
  152. //Change to false if you want to disable reading all player commands.
  153. #define MAX_PING false
  154. //Change to false if you want to disable this system.
  155. #define ANTI_SWEAR true
  156. //Change to false if you want to disable the AntiSwear.
  157. #define ANTI_NAME true
  158. //Change to false if you want to disable the AntiName.
  159. #define ANTI_SPAWN true
  160. //Change to false if you want to disable.
  161. //Anti Spawn disables player from spawning if they aren't registered or logged in.
  162. #define ANTI_AD true
  163. //Change to false if you want to disable the anti ad.
  164. #define RconProtect true
  165. //Change to false if you want to disable the 2nd Rcon.
  166. #define AntiSpam true
  167. //Change to false if you want to disable the AntiSpam.
  168. #define ReportTD true
  169. //Change to false if you want to disable the textdraw.
  170.  
  171. #if ReportTD == true
  172. new Text:Textdraw0;
  173. #endif
  174.  
  175. enum PlayerInfo
  176. {
  177. accountID,
  178. accountName[24],
  179. accountIP[20],
  180. accountQuestion[129],
  181. accountAnswer[129],
  182. accountPassword[129],
  183. accountAdmin,
  184. accountKills,
  185. accountDeaths,
  186. accountScore,
  187. accountCash,
  188. bool: accountLogged,
  189. WarnLog,
  190. accountDate[150],
  191. accountWarn,
  192. accountMuted,
  193. accountMuteSec,
  194. accountCMuted,
  195. accountCMuteSec,
  196. accountJail,
  197. accountJailSec,
  198. SpecID,
  199. SpecType,
  200. pCar,
  201. accountGame[3],
  202. pDuty,
  203. #if AntiSpam == true
  204. SpamCount,
  205. SpamTime
  206. #endif
  207. };
  208.  
  209. new User[MAX_PLAYERS][PlayerInfo],
  210. DB:Database,
  211. static_Warn[MAX_PLAYERS]
  212. ;
  213.  
  214. #if AntiSpam == true
  215. #define SPAM_MAX_MSGS 5 // Max Spam Messages
  216. #define SPAM_TIMELIMIT 8 // In seconds
  217. #endif
  218.  
  219. #if RconProtect == true
  220. #include <OPRL>
  221. //Includes the OPRL by Lordzy if 2nd_Rcon is set to true.
  222. #define RconPass "changeme"
  223. //Password for the 2nd Rcon, changeme to anything you want.
  224. new bool:_RCON[MAX_PLAYERS];
  225. new _RCONwarn[MAX_PLAYERS];
  226. #endif
  227.  
  228. #if ANTI_NAME == true
  229. new ForbidNames[][] =
  230. {
  231. {"Admin"},
  232. {"AssLicker"},
  233. {"Vip"},
  234. {"Hacker"},
  235. {"Justin_Bieber"},
  236. {"Supporter"},
  237. {"Projektleiter"},
  238. {"High-Admin"}
  239. //Names here, Remember, the last stanza don't have ","
  240. };
  241. #endif
  242.  
  243. #if ANTI_SWEAR == true
  244. new Swears[][] =
  245. {
  246. {"dick"},
  247. {"pussy"},
  248. {"dildo"},
  249. {"adventure time gay"},
  250. {"dik"},
  251. {"penis"},
  252. {"lutschen"},
  253. {"Hurensohn"},
  254. {"nN"},
  255. {"Homo"}
  256. //Bad Words here, Remember, the last stanza don't have ","
  257. };
  258. #endif
  259.  
  260. #if MAX_PING == true
  261. #define PING_EXCEED 1000
  262. //Maximum ping if the MAX_PING is set to true, if player exceeds it, He or SHE gets kicked.
  263. #define MAX_PING_WARN 3
  264. //Max ping warning from Ping Kick, once exceed, player gets kicked.
  265. #endif
  266.  
  267. //JakAdmin3 now makes everything easy.
  268. #define SD ShowPlayerDialog
  269. #define DP DIALOG_STYLE_PASSWORD
  270. #define DI DIALOG_STYLE_INPUT
  271. #define DM DIALOG_STYLE_MSGBOX
  272. #define DL DIALOG_STYLE_LIST
  273.  
  274. //Dialog Begin is null, You can use it as a message displayer since it is not used.
  275. #define DIALOG_BEGIN 905
  276. //Change the dialog id of the DIALOG_BEGIN if it conflicts.
  277. #define DIALOG_REGISTER DIALOG_BEGIN+1
  278. #define DIALOG_LOGIN DIALOG_BEGIN+2
  279. #define DIALOG_COLORS DIALOG_BEGIN+3
  280. #define DIALOG_RCON DIALOG_BEGIN+4
  281. #define DIALOG_QUESTION DIALOG_BEGIN+5
  282. #define DIALOG_ANSWER DIALOG_BEGIN+6
  283. #define DIALOG_FORGET DIALOG_BEGIN+7
  284.  
  285. //Colors
  286.  
  287. #define white "{FFFFFF}"
  288. #define lightblue "{33CCFF}"
  289. #define grey "{AFAFAF}"
  290. #define orange "{FF8000}"
  291. #define black "{2C2727}"
  292. #define red "{FF0000}"
  293. #define yellow "{FFFF00}"
  294. #define green "{33CC33}"
  295. #define blue "{0080FF}"
  296. #define purple "{D526D9}"
  297. #define pink "{FF80FF}"
  298. #define brown "{A52A2A}"
  299.  
  300. #define COLOR_RED 0xFF0000C8
  301. #define COLOR_YELLOW 0xFFFF00AA
  302. #define COLOR_GREEN 0x33CC33C8
  303. #define COLOR_ORANGE 0xFF8000C8
  304. #define COLOR_WHITE 0xFFFFFFFF
  305. #define COLOR_PURPLE 0xD526D9FF
  306. #define COLOR_LIGHTGREEN 0x00FF00FF
  307. #define COLOR_PINK 0xFF80FFFF
  308. #define COLOR_LIGHTBLUE 0x33CCFFAA
  309. #define COLOR_GREY 0xAFAFAFAA
  310. #define COLOR_BLUE 0x0080FFC8
  311. #define COLOR_BROWN 0xA52A2AAA
  312. #define COLOR_BLACK 0x2C2727AA
  313.  
  314. //============================================================================//
  315.  
  316. //Script line starts here
  317.  
  318. public OnFilterScriptInit()
  319. {
  320. new
  321. day,
  322. month,
  323. year,
  324. hour,
  325. sec,
  326. mins,
  327. result = GetTickCount()
  328. ;
  329.  
  330. getdate(year, month, day);
  331. gettime(hour, mins, sec);
  332.  
  333. /*
  334. Checks the JakAdmin3 and logs folder if exist, otherwise sends a print message.
  335. */
  336.  
  337. checkfolder();
  338.  
  339. /*
  340. Just so you know, even if the folders of JakAdmin3 is missing, nothing will happen except
  341. accounts won't save. We have also blocked the SaveLog function from overwriting files
  342. when the Logs folder is missing.
  343. */
  344.  
  345. if(checkfolderEx() == 1)
  346. {
  347. /*
  348. If CheckFolderEX returns 1 instead of 0 (Doesn't exist), proceed the daily route.
  349. */
  350. printf("\nLolbob %s (c), Copyright - 2015", VERSION);
  351. print("Security Updates for SQL Injection, Patch I\n");
  352.  
  353. //Load the .DB file.
  354. loadb();
  355. printf("[Lolbob] Duration: %i ms", (GetTickCount() - result));
  356. printf("[Lolbob] Total Commands: %i", j_CountCmds());
  357. printf("[Lolbob] Date: %02i/%02i/%02i | Time: %02d:%02d:%02d", day, month, year, hour, mins, sec);
  358. Config();
  359. print("\n");
  360.  
  361. //Syncing Timers
  362. SetTimer("SyncStats", 1000, true);
  363. //Ping Timer (if set to true)
  364. #if MAX_PING == true
  365. SetTimer("PingCheck", 1000, true);
  366. #endif
  367. //Punishment Timer Handler
  368. SetTimer("PunishmentHandle", 1000, true);
  369.  
  370. for(new i=0; i<4; i++)
  371. {
  372. format(reportmsg[i], 136, "None");
  373. }
  374.  
  375. #if ReportTD == true
  376. Textdraw0 = TextDrawCreate(400.000000, 386.000000, "~r~New Report! ~w~Check your ~g~chat ~w~or ~y~/reports~w~!");
  377. TextDrawBackgroundColor(Textdraw0, 255);
  378. TextDrawFont(Textdraw0, 1);
  379. TextDrawLetterSize(Textdraw0, 0.320000, 1.100000);
  380. TextDrawColor(Textdraw0, -1);
  381. TextDrawSetOutline(Textdraw0, 1);
  382. TextDrawSetProportional(Textdraw0, 1);
  383. TextDrawSetSelectable(Textdraw0, 0);
  384. #endif
  385.  
  386. foreach(new i : Player)
  387. {
  388. OnPlayerConnect(i);
  389. }
  390. }
  391. return 1;
  392. }
  393.  
  394. public OnFilterScriptExit()
  395. {
  396. //Closing the .DB file.
  397. closedb();
  398.  
  399. #if ReportTD == true
  400. TextDrawDestroy(Textdraw0);
  401. #endif
  402.  
  403. foreach(new i : Player)
  404. {
  405. if(User[i][pCar] != -1)
  406. {
  407. DestroyVehicle(User[i][pCar]);
  408. }
  409. OnPlayerDisconnect(i, 1);
  410. User[i][accountLogged] = false;
  411. }
  412. return 1;
  413. }
  414.  
  415. function:PunishmentHandle()
  416. {
  417. new string[128+50];
  418.  
  419. foreach(new i : Player)
  420. {
  421. if(User[i][accountJail] == 1)
  422. {
  423. if(User[i][accountJailSec] >= 1)
  424. {
  425. User[i][accountJailSec] --;
  426. }
  427. else if(User[i][accountJailSec] == 0)
  428. {
  429. User[i][accountJail] = 0;
  430. format(string, sizeof(string), "** %s(ID:%d) has been unjailed from Admin's Jail.", pName(i), i);
  431. SendClientMessageToAll(COLOR_GREY, string);
  432. SpawnPlayer(i);
  433. }
  434. }
  435. if(User[i][accountMuted] == 1)
  436. {
  437. if(User[i][accountMuteSec] >= 1)
  438. {
  439. User[i][accountMuteSec] --;
  440. }
  441. else if(User[i][accountMuteSec] == 0)
  442. {
  443. User[i][accountMuted] = 0;
  444. format(string, sizeof(string), "** %s(ID:%d) has been unmuted from Admin's Mute.", pName(i), i);
  445. SendClientMessageToAll(COLOR_GREY, string);
  446. }
  447. }
  448. if(User[i][accountCMuted] == 1)
  449. {
  450. if(User[i][accountCMuteSec] >= 1)
  451. {
  452. User[i][accountCMuteSec] --;
  453. }
  454. else if(User[i][accountCMuteSec] == 0)
  455. {
  456. User[i][accountCMuted] = 0;
  457. format(string, sizeof(string), "** %s(ID:%d) has been unmuted from Admin's Command Mute.", pName(i), i);
  458. SendClientMessageToAll(COLOR_GREY, string);
  459. }
  460. }
  461. }
  462. return 1;
  463. }
  464.  
  465. #if MAX_PING == true
  466. function:PingCheck()
  467. {
  468. new
  469. string[130]
  470. ;
  471. foreach(new i : Player)
  472. {
  473. if(GetPlayerPing(i) > PING_EXCEED)
  474. {
  475. if(static_Warn[i] == MAX_PING_WARN)
  476. {
  477. format(string, sizeof(string), "** %s(ID:%d) wurde vom Server gekickt [Reason: Exceeding Maximum Ping Limit] (Ping: %d | Maximum Ping: %d)", pName(i), i, GetPlayerPing(i), PING_EXCEED);
  478. SendClientMessageToAll(COLOR_GREY, string);
  479. KickDelay(i);
  480. return 1;
  481. }
  482. static_Warn[i] ++;
  483. format(string, sizeof(string), "** %s(ID:%d) hat einen Ping Kick Warning erhalten (Ping: %d | Maximum Ping: %d) (Warnings: %d/%d)", pName(i), i, GetPlayerPing(i), PING_EXCEED, static_Warn[i], MAX_PING_WARN);
  484. SendClientMessageToAll(COLOR_YELLOW, string);
  485. }
  486. }
  487. return 1;
  488. }
  489. #endif
  490.  
  491. function:SyncStats()
  492. {
  493. foreach(new i : Player)
  494. {
  495. if(User[i][accountLogged] == true)
  496. {
  497. User[i][accountCash] = GetPlayerMoney(i);
  498. User[i][accountScore] = GetPlayerScore(i);
  499. }
  500.  
  501. //Will be using for god too. (Improving it on the next version)
  502. if(_God[i] == 1)
  503. {
  504. SetPlayerHealth(i, 100000);
  505. }
  506. }
  507. return 1;
  508. }
  509.  
  510. function:GamePlay(playerid)
  511. {
  512. if(User[playerid][accountLogged] == true)
  513. {
  514. User[playerid][accountGame][0] += 1;
  515. if(User[playerid][accountGame][0] == 60)
  516. {
  517. User[playerid][accountGame][0] = 0;
  518. User[playerid][accountGame][1] += 1;
  519. if(User[playerid][accountGame][1] >= 59 && User[playerid][accountGame][0] == 0)
  520. {
  521. User[playerid][accountGame][1] = 0;
  522. User[playerid][accountGame][2] += 1;
  523. }
  524. }
  525. }
  526. return 1;
  527. }
  528.  
  529. public OnPlayerConnect(playerid)
  530. {
  531. #if ANTI_NAME == true
  532. new string[128+40];
  533. for(new x = 0; x < sizeof(ForbidNames); x++)
  534. {
  535. if(!strcmp(pName(playerid), ForbidNames[x], true))
  536. {
  537. format(string, sizeof string, "** Player %s(ID:%d) wurde vom Server gekickt (Forbidden Name)", pName(playerid), playerid);
  538. SendClientMessageToAll(COLOR_GREY, string);
  539. printf(string);
  540. #if LOG == true
  541. SaveLog("kicklog.txt", string);
  542. #endif
  543. KickDelay(playerid);
  544. return 1;
  545. }
  546. }
  547. #endif
  548.  
  549. for(new x; x < _: PlayerInfo; ++x ) User[playerid][PlayerInfo: x] = 0;
  550. User[playerid][SpecID] = INVALID_PLAYER_ID;
  551.  
  552. #if RconProtect == true
  553. _RCON[playerid] = false;
  554. _RCONwarn[playerid] = 0;
  555. #endif
  556.  
  557. User[playerid][pDuty] = 0;
  558. User[playerid][pCar] = -1;
  559. #if AntiSpam == true
  560. User[playerid][SpamCount] = 0;
  561. User[playerid][SpamTime] = 0;
  562. #endif
  563.  
  564. _God[playerid] = 0;
  565.  
  566. GetPlayerName(playerid, User[playerid][accountName], MAX_PLAYER_NAME);
  567. GetPlayerIp(playerid, User[playerid][accountIP], 20);
  568.  
  569. static_Warn[playerid] = 0;
  570.  
  571. new
  572. bQuery[128+90],
  573. reason[128],
  574. admin[128],
  575. when[128],
  576. DBResult:jResult
  577. ;
  578. format(bQuery, 600, "SELECT * FROM `bans` WHERE `username` = '%s'", pName(playerid));
  579. jResult = db_query(Database, bQuery);
  580.  
  581. if(db_num_rows(jResult))
  582. {
  583. db_get_field_assoc(jResult, "banby", admin, 128);
  584. db_get_field_assoc(jResult, "banreason", reason, 128);
  585. db_get_field_assoc(jResult, "banwhen", when, 128);
  586.  
  587. ShowBan(playerid, admin, reason, when);
  588.  
  589. KickDelay(playerid);
  590. return 1;
  591. }
  592. db_free_result(jResult);
  593.  
  594. new
  595. Query[128+71],
  596. DBResult: Result
  597. ;
  598.  
  599. #if AUTO_LOGIN == true
  600. new fIP[20];
  601. #endif
  602.  
  603. #if ReportTD == true
  604. TextDrawHideForPlayer(playerid, Textdraw0);
  605. #endif
  606.  
  607. GameTimer[playerid] = SetTimerEx("GamePlay", 1000, true, "d", playerid);
  608.  
  609. #if AUTO_LOGIN == true
  610. format(Query, sizeof(Query), "SELECT `password`, `question`, `answer`, `IP` FROM `users` WHERE `username` = '%s'", DB_Escape(User[playerid][accountName]));
  611. Result = db_query(Database, Query);
  612. #else
  613. format(Query, sizeof(Query), "SELECT `password`, `question`, `answer` FROM `users` WHERE `username` = '%s'", DB_Escape(User[playerid][accountName]));
  614. Result = db_query(Database, Query);
  615. #endif
  616. if(db_num_rows(Result))
  617. {
  618. SendClientMessage(playerid, -1, "Dein Account wurde in der Datenbank gefunden");
  619.  
  620. db_get_field_assoc(Result, "password", User[playerid][accountPassword], 129);
  621. db_get_field_assoc(Result, "question", User[playerid][accountQuestion], 129);
  622. db_get_field_assoc(Result, "answer", User[playerid][accountAnswer], 129);
  623. #if AUTO_LOGIN == true
  624. db_get_field_assoc(Result, "IP", fIP, 20);
  625. if(strcmp(fIP, User[playerid][accountIP], true) == 0)
  626. {
  627. SendClientMessage(playerid, -1, "Du wirst nun automatisch eingeloggt.");
  628. LoginPlayer(playerid);
  629. }
  630. else
  631. {
  632. #if REGISTER_DIALOG == true
  633. SD(playerid, DIALOG_LOGIN, DP, ""lightblue"Real-Shit City", ""grey"Willkommen auf Real-Shit City!\nDein Account wurde in der Datenbank gefunden\ngib dein Passwort niemals weiter, auch nicht an Admins oder Supporter! \n\nTIPS: Du kannst dich nun einloggen. Bitte gib dein Passwort ein.", "Login", "Forget");
  634. #else
  635. SendClientMessage(playerid, COLOR_ORANGE, "Real-Shit City: /login [password] um dich einzuloggen.");
  636. #endif
  637. }
  638. #else
  639. #if REGISTER_DIALOG == true
  640. SD(playerid, DIALOG_LOGIN, DP, ""lightblue"JakAdmin3 - Login", ""grey"Willkommen auf Real-Shit City!\nDein Account wurde in der Datenbank gefunden\ngib dein Passwort niemals weiter, auch nicht an Admins oder Supporter! \n\nTIPS: Du kannst dich nun einloggen. Bitte gib dein Passwort ein.", "Login", "Forget");
  641. #else
  642. SendClientMessage(playerid, COLOR_ORANGE, "LOGIN: /login [password] um dich einzuloggen.");
  643. #endif
  644. #endif
  645. }
  646. else
  647. {
  648. SendClientMessage(playerid, -1, "Dein Account wurde nicht in der Datenbank gefunden");
  649. #if REGISTER_DIALOG == true
  650. SD(playerid, DIALOG_REGISTER, DP, ""lightblue"Herzlich Willkommen auf Real-Shit City", ""grey"nIch sehe du bist neu auf diesem Server, bitte trage dein gewünschtes passwort ein.", "Register", "Quit");
  651. #else
  652. SendClientMessage(playerid, COLOR_ORANGE, "Real-Shit City: /register [password] um dir ein Account zu erstellen.");
  653. #endif
  654. }
  655. db_free_result(Result);
  656. return 1;
  657. }
  658.  
  659. public OnPlayerDisconnect(playerid, reason)
  660. {
  661. #if ReportTD == true
  662. TextDrawHideForPlayer(playerid, Textdraw0);
  663. #endif
  664.  
  665. for(new x=0; x<MAX_PLAYERS; x++)
  666. if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && User[x][SpecID] == playerid)
  667. AdvanceSpectate(x);
  668.  
  669. if(User[playerid][pCar] != -1) EraseVeh(User[playerid][pCar]);
  670.  
  671. KillTimer(GameTimer[playerid]);
  672.  
  673. if(User[playerid][accountLogged] == true)
  674. {
  675. //Saves the statistics to the .db.
  676. SaveData(playerid);
  677. }
  678. return 1;
  679. }
  680.  
  681. public OnPlayerSpawn(playerid)
  682. {
  683. if(User[playerid][accountJail] == 1)
  684. {
  685. SetTimerEx("JailPlayer", 3000, 0, "d", playerid);
  686. SendClientMessage(playerid, COLOR_RED, "Strafe: Du kannst deiner Strafe nicht entgehen. Du bist immer noch im Prison, Haha!");
  687.  
  688. return 1;
  689. }
  690. return 1;
  691. }
  692.  
  693. function:JailPlayer(playerid)
  694. {
  695. new string[128];
  696.  
  697. SetPlayerPos(playerid, 197.6661, 173.8179, 1003.0234);
  698. SetPlayerInterior(playerid, 3);
  699. SetCameraBehindPlayer(playerid);
  700.  
  701. format(string, 200, "Du wurdest für %d sekunden ins Prison gesteckt.", User[playerid][accountJailSec]);
  702. SendClientMessage(playerid, COLOR_RED, string);
  703. return 1;
  704. }
  705.  
  706. public OnPlayerDeath(playerid, killerid, reason)
  707. {
  708. for(new x=0; x<MAX_PLAYERS; x++)
  709. if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && User[x][SpecID] == playerid)
  710. AdvanceSpectate(x);
  711.  
  712. User[playerid][accountDeaths] ++;
  713. if(killerid != INVALID_PLAYER_ID)
  714. {
  715. User[killerid][accountKills] ++;
  716. }
  717. return 1;
  718. }
  719.  
  720. public OnVehicleSpawn(vehicleid)
  721. {
  722. foreach(new i : Player)
  723. {
  724. if(vehicleid == User[i][pCar])
  725. {
  726. EraseVeh(vehicleid);
  727. User[i][pCar] = -1;
  728. }
  729. }
  730. return 1;
  731. }
  732.  
  733. public OnVehicleDeath(vehicleid, killerid)
  734. {
  735. return 1;
  736. }
  737.  
  738. public OnPlayerText(playerid, text[])
  739. {
  740. new string[128+50];
  741.  
  742. #if ANTI_AD == true
  743. if(strfind(text, ":", true) != -1)
  744. {
  745. new
  746. i_numcount,
  747. i_period,
  748. i_pos;
  749.  
  750. while(text[i_pos]) {
  751. if('0' <= text[i_pos] <= '9') i_numcount++;
  752. else if(text[i_pos] == '.') i_period++;
  753. i_pos++;
  754. }
  755. if(i_numcount >= 8 && i_period >= 3)
  756. {
  757. format(string, sizeof(string), "Werbung: Spieler %s(ID: %d) vielleicht Server Werbung: '%s'.", pName(playerid), playerid, text);
  758. foreach(new i : Player)
  759. {
  760. if(User[i][accountLogged] == true)
  761. {
  762. if(User[i][accountAdmin] >= 1)
  763. {
  764. SendClientMessage(i, COLOR_RED, string);
  765. }
  766. }
  767. }
  768. SendClientMessage(playerid, -1, "Dein Chat wurde gesendet.");
  769. return 0;
  770. }
  771. }
  772. #endif
  773.  
  774. if(User[playerid][accountMuted] == 1)
  775. {
  776. format(string, sizeof(string), "Du bist immernoch gemuted, Du kannst nach %d sekunden wieder reden.", User[playerid][accountMuteSec]);
  777. SendClientMessage(playerid, COLOR_ORANGE, string);
  778. return 0;
  779. }
  780.  
  781. #if AntiSpam == true
  782. if((User[playerid][accountAdmin] == 0 && !IsPlayerAdmin(playerid)))
  783. {
  784. if(User[playerid][SpamCount] == 0) User[playerid][SpamTime] = TimeStamp();
  785.  
  786. User[playerid][SpamCount]++;
  787. if(TimeStamp() - User[playerid][SpamTime] > SPAM_TIMELIMIT)
  788. {
  789. User[playerid][SpamCount] = 0;
  790. User[playerid][SpamTime] = TimeStamp();
  791. }
  792. else if(User[playerid][SpamCount] == SPAM_MAX_MSGS)
  793. {
  794. format(string, sizeof(string), "** Spieler %s (ID:%d) wurde vom Server gekickt Grund (Spam Schutz)", pName(playerid), playerid);
  795. SendClientMessageToAll(COLOR_GREY, string);
  796. print(string);
  797. #if LOG == true
  798. SaveLog("kicklog.txt", string);
  799. #endif
  800. KickDelay(playerid);
  801. }
  802. else if(User[playerid][SpamCount] == SPAM_MAX_MSGS-1)
  803. {
  804. SendClientMessage(playerid, COLOR_RED, "WARNUNG: Anti Spam Warnung! Nochmal und du bekommst ein Kick!");
  805. return 0;
  806. }
  807. }
  808. #endif
  809.  
  810. #if ANTI_SWEAR == true
  811. for(new i = 0; i < sizeof(Swears); i++)
  812. {
  813. Cenzura(text, Swears[i]);
  814. }
  815. #endif
  816. return 1;
  817. }
  818.  
  819. //============================================================================//
  820. // ZCMD //
  821.  
  822. public OnPlayerCommandReceived(playerid, cmdtext[])
  823. {
  824. new string[128+50];
  825.  
  826. #if ANTI_AD == true
  827. if(strfind(cmdtext, ":", true) != -1)
  828. {
  829.  
  830. new
  831. i_numcount,
  832. i_period,
  833. i_pos;
  834.  
  835. while(cmdtext[i_pos]) {
  836. if('0' <= cmdtext[i_pos] <= '9') i_numcount++;
  837. else if(cmdtext[i_pos] == '.') i_period++;
  838. i_pos++;
  839. }
  840. if(i_numcount >= 8 && i_period >= 3)
  841. {
  842. format(string, sizeof(string), "Werbung: Spieler %s(ID: %d) vielleicht Server Werbung: '%s'.", pName(playerid), playerid, cmdtext);
  843. foreach(new i : Player)
  844. {
  845. if(User[i][accountLogged] == true)
  846. {
  847. if(User[i][accountAdmin] >= 1)
  848. {
  849. SendClientMessage(i, COLOR_RED, string);
  850. }
  851. }
  852. }
  853. SendClientMessage(playerid, -1, "Dein Befehl wurde erfolgreich gesendet.");
  854. return 0;
  855. }
  856. }
  857. #endif
  858.  
  859. if(User[playerid][accountCMuted] == 1)
  860. {
  861. format(string, sizeof(string), "Du bist immer noch gemuted, Du kannst alle Befehle nach %d sekunden wieder benutzen.", User[playerid][accountCMuteSec]);
  862. SendClientMessage(playerid, COLOR_ORANGE, string);
  863. return 0;
  864. }
  865.  
  866. #if READ_COMMANDS == true
  867. format(string, sizeof(string), "*** %s(ID:%d) : '%s'", pName(playerid), playerid, cmdtext);
  868. foreach(new i : Player)
  869. {
  870. if(User[i][accountAdmin] >= 1 && User[i][accountAdmin] > User[playerid][accountAdmin] && i != playerid)
  871. {
  872. SendClientMessage(i, COLOR_GREY, string);
  873. }
  874. }
  875. #endif
  876. return 1;
  877. }
  878.  
  879. //============================================================================//
  880. // Administrative Level 1-5 //
  881. //============================================================================//
  882.  
  883. CMD:jacmds(playerid, params[])
  884. {
  885. new string[1246+200];
  886.  
  887. LoginCheck(playerid);
  888. LevelCheck(playerid, 1);
  889.  
  890. strcat(string, ""orange"");
  891. strcat(string, "Auflistung aller benutzbaren Befehle für dein Admin-Rang.\n\n");
  892.  
  893. if(User[playerid][accountAdmin] >= 1)
  894. {
  895. strcat(string, ""lightblue">>> Supporter <<<\n");
  896. strcat(string, ""grey"");
  897. strcat(string, "/announce /kick /asay /a(Admin Chat) /settime /setweather /goto /ip /spawn /gotoco /flip /warn\n");
  898. strcat(string, "/remwarn /addnos /repair /reports /aduty /weaps\n\n");
  899. }
  900. if(User[playerid][accountAdmin] >= 2)
  901. {
  902. strcat(string, ""lightblue">>> Moderator <<<\n");
  903. strcat(string, ""grey"");
  904. strcat(string, "/disarm /explode /setinterior /setworld /heal /armour /clearchat /setskin /mute /unmute /(un)jail\n");
  905. strcat(string, "/akill /spec(off) /car /carcolor /eject /setvhealth /givecar /muted /jailed (/un)jail /show\n");
  906. strcat(string, "/aweapons /jetpack /carpjob\n\n");
  907. }
  908. if(User[playerid][accountAdmin] >= 3)
  909. {
  910. strcat(string, ""lightblue">>> Admin <<<\n");
  911. strcat(string, ""grey"");
  912. strcat(string, "/setmoney /setscore /setcolor /slap /cname /(un)ban /giveweapon (/un)freeze /getall /bankrupt\n");
  913. strcat(string, "/armourall /god /teleplayer /destroycar /sethealth /setfstyle /healall /armourall /force\n");
  914. strcat(string, "/write /get /oban\n\n");
  915. }
  916. if(User[playerid][accountAdmin] >= 4)
  917. {
  918. strcat(string, ""lightblue">>> Stellvertretender <<<\n");
  919. strcat(string, ""grey"");
  920. strcat(string, "/saveallstats /cleardwindow /respawncars /setallweather /setalltime /giveallweapon\n");
  921. strcat(string, "/giveallcash /giveallscore /setallworld /setallinterior /kickall /disarmall /ejectall\n");
  922. strcat(string, "/mutecmd /unmutecmd /setallskin /fakedeath /cmdmuted /killall /slapall /explodeall\n");
  923. strcat(string, "/gmx\n\n");
  924. }
  925. if(User[playerid][accountAdmin] >= 5 || IsPlayerAdmin(playerid))
  926. {
  927. strcat(string, ""lightblue">>> Projektleiter <<<\n");
  928. strcat(string, ""grey"");
  929. strcat(string, "/setlevel /fakechat /fakecmd /removeacc /makemegodadmin");
  930. }
  931.  
  932. SD(playerid, DIALOG_BEGIN, DM, ""orange"Administrative Befehle", string, "Verlassen", "");
  933. return 1;
  934. }
  935.  
  936. //============================================================================//
  937. // Administrative Level One //
  938. //============================================================================//
  939.  
  940. CMD:weaps(playerid, params[])
  941. {
  942. LoginCheck(playerid);
  943. LevelCheck(playerid, 1);
  944.  
  945. new
  946. id,
  947. Count,
  948. x,
  949. string[128],
  950. string2[64],
  951. WeapName[24],
  952. slot,
  953. weap,
  954. ammo
  955. ;
  956. if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: /weaps [playerid]");
  957. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  958. format(string2, sizeof(string2), "_______ [ %s(ID:%d) Weapons ] _______", pName(id), id);
  959. SendClientMessage(playerid, COLOR_WHITE, string2);
  960. for(slot = 0; slot < 14; slot++)
  961. {
  962. GetPlayerWeaponData(id, slot, weap, ammo);
  963. if(ammo != 0 && weap != 0)
  964. Count++;
  965. }
  966. if(Count < 1) return SendClientMessage(playerid, COLOR_RED, "Players has no equipped weapons!");
  967. if(Count >= 1)
  968. {
  969. for (slot = 0; slot < 14; slot++)
  970. {
  971. GetPlayerWeaponData(id, slot, weap, ammo);
  972. if(ammo != 0 && weap != 0)
  973. {
  974. GetWeaponName(weap, WeapName, sizeof(WeapName));
  975. if(ammo == 65535 || ammo == 1)
  976. format(string, sizeof(string), "%s%s (1)",string, WeapName);
  977. else format(string, sizeof(string), "%s%s (%d)", string, WeapName, ammo);
  978. x++;
  979. if(x >= 5)
  980. {
  981. SendClientMessage(playerid, COLOR_YELLOW, string);
  982. x = 0;
  983. format(string, sizeof(string), "");
  984. }
  985. else format(string, sizeof(string), "%s, ", string);
  986. }
  987. }
  988. if(x <= 4 && x > 0)
  989. {
  990. string[strlen(string)-3] = '.';
  991. SendClientMessage(playerid, COLOR_YELLOW, string);
  992. }
  993. }
  994. return 1;
  995. }
  996.  
  997. CMD:aduty(playerid, params[])
  998. {
  999. LoginCheck(playerid);
  1000. LevelCheck(playerid, 1);
  1001.  
  1002. new
  1003. string[128]
  1004. ;
  1005.  
  1006. switch(User[playerid][pDuty])
  1007. {
  1008. case 0:
  1009. {
  1010. User[playerid][pDuty] = 1;
  1011. format(string, 128, "Admin %s(ID:%d) goes on \" Admin Mode \"", pName(playerid), playerid);
  1012. SendClientMessageToAll(COLOR_GREEN, string);
  1013. }
  1014. case 1:
  1015. {
  1016. User[playerid][pDuty] = 0;
  1017. format(string, 128, "Admin %s(ID:%d) goes back on \" Playing Mode \"", pName(playerid), playerid);
  1018. SendClientMessageToAll(COLOR_YELLOW, string);
  1019. }
  1020. }
  1021. return 1;
  1022. }
  1023.  
  1024. CMD:reports(playerid, params[])
  1025. {
  1026. LoginCheck(playerid);
  1027. LevelCheck(playerid, 1);
  1028.  
  1029. new string[1400], string2[136];
  1030. strcat(string, ""red"*** Report Send by the Players ***\n\n");
  1031. strcat(string, ""grey"");
  1032. for(new i=0; i<4; i++)
  1033. {
  1034. format(string2, sizeof string2, "(%d) %s\n", i, reportmsg[i]);
  1035. strcat(string, string2);
  1036. }
  1037.  
  1038. SD(playerid, DIALOG_BEGIN, DM, ""red"Reports", string, "Close", "");
  1039. return 1;
  1040. }
  1041.  
  1042. CMD:repair(playerid, params[])
  1043. {
  1044. LoginCheck(playerid);
  1045. LevelCheck(playerid, 1);
  1046.  
  1047. if(IsPlayerInAnyVehicle(playerid))
  1048. {
  1049. new VehicleID = GetPlayerVehicleID(playerid);
  1050. RepairVehicle(VehicleID);
  1051. GameTextForPlayer(playerid, "~w~~n~~n~~n~~n~~n~~n~Vehicle ~g~Repaired!", 3000, 3);
  1052. SetVehicleHealth(VehicleID, 1000.0);
  1053. }
  1054. else
  1055. SendClientMessage(playerid, COLOR_RED, "Syntax Error: You must be inside of the vehicle to use this command.");
  1056. return 1;
  1057. }
  1058.  
  1059. CMD:addnos(playerid, params[])
  1060. {
  1061. LoginCheck(playerid);
  1062. LevelCheck(playerid, 1);
  1063.  
  1064. if(IsPlayerInAnyVehicle(playerid))
  1065. {
  1066. switch(GetVehicleModel(GetPlayerVehicleID(playerid)))
  1067. {
  1068. case 448,461,462,463,468,471,509,510,521,522,523,581,586,449: SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot add nos to this vehicle.");
  1069. }
  1070. AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
  1071. PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
  1072. }
  1073. else
  1074. SendClientMessage(playerid, COLOR_RED, "Syntax Error: You must be inside of the vehicle to use this command.");
  1075. return 1;
  1076. }
  1077.  
  1078. CMD:warn(playerid, params[])
  1079. {
  1080. LoginCheck(playerid);
  1081. LevelCheck(playerid, 1);
  1082.  
  1083. new
  1084. string[128],
  1085. id,
  1086. reason[128]
  1087. ;
  1088.  
  1089. if(sscanf(params, "uS(No Reason)[128]", id, reason)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /warn [playerid] [reason]");
  1090. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  1091. if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot warn yourself.");
  1092. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  1093.  
  1094. User[id][accountWarn] += 1;
  1095.  
  1096. format(string, sizeof(string), "Administrator %s(%d) warned %s(%d) for %s (Warnings: %d)", pName(playerid), playerid, pName(id), id, reason, User[id][accountWarn]);
  1097. SendClientMessageToAll(COLOR_YELLOW, string);
  1098. return 1;
  1099. }
  1100.  
  1101. CMD:remwarn(playerid, params[])
  1102. {
  1103. LoginCheck(playerid);
  1104. LevelCheck(playerid, 1);
  1105.  
  1106. new
  1107. string[130],
  1108. id
  1109. ;
  1110.  
  1111. if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /remwarn [playerid]");
  1112. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  1113. if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot remove warn yourself.");
  1114. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  1115. if(User[id][accountWarn] == 0) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player has no warnings.");
  1116. User[id][accountWarn] -= 1;
  1117.  
  1118. format(string, sizeof(string), "Administrator %s(%d) has removed %s(%d) warnings (Warnings Left: %i)", pName(playerid), playerid, pName(id), id, User[id][accountWarn]);
  1119. SendClientMessageToAll(COLOR_YELLOW, string);
  1120. return 1;
  1121. }
  1122.  
  1123. CMD:flip(playerid, params[])
  1124. {
  1125. LoginCheck(playerid);
  1126. LevelCheck(playerid, 1);
  1127.  
  1128. new id,
  1129. string[128],
  1130. Float:angle
  1131. ;
  1132.  
  1133. if(!sscanf(params, "u", id))
  1134. {
  1135. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  1136. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  1137. if(!IsPlayerInAnyVehicle(id)) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not in a vehicle.");
  1138. GetVehicleZAngle(GetPlayerVehicleID(id), angle);
  1139. SetVehicleZAngle(GetPlayerVehicleID(id), angle);
  1140. format(string, sizeof(string), "You have flipped Player %s's vehicle.", pName(id));
  1141. SendClientMessage(playerid, COLOR_GREEN, string);
  1142. format(string, sizeof(string), "Administrator %s has flipped your vehicle.", pName(playerid));
  1143. SendClientMessage(id, COLOR_GREEN, string);
  1144. }
  1145. else
  1146. {
  1147. if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You must be in a vehicle to use /flip.");
  1148. GetVehicleZAngle(GetPlayerVehicleID(playerid), angle);
  1149. SetVehicleZAngle(GetPlayerVehicleID(playerid), angle);
  1150. SendClientMessage(playerid, COLOR_YELLOW, "Vehicle Flipped!");
  1151. SendClientMessage(playerid, -1, "Want to flip player's vehicle? Just do "orange"/flip [playerid]");
  1152. }
  1153. return 1;
  1154. }
  1155.  
  1156. CMD:gotoco(playerid, params[])
  1157. {
  1158. LoginCheck(playerid);
  1159. LevelCheck(playerid, 1);
  1160.  
  1161. new
  1162. Float: Pos[3],
  1163. string[128]
  1164. ;
  1165. if(sscanf(params, "fff", Pos[0], Pos[1], Pos[2])) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /gotoco [x] [y] [z]");
  1166. if(IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid), Pos[0], Pos[1], Pos[2]);
  1167. else SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  1168.  
  1169. format(string, sizeof string, "You have teleported to Coordinates %.1f %.1f %.1f", Pos[0], Pos[1], Pos[2]);
  1170. SendClientMessage(playerid, COLOR_YELLOW, string);
  1171. return 1;
  1172. }
  1173.  
  1174. CMD:ip(playerid, params[])
  1175. {
  1176. LoginCheck(playerid);
  1177. LevelCheck(playerid, 1);
  1178.  
  1179. new
  1180. id,
  1181. string[120]
  1182. ;
  1183. if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /ip [playerid]");
  1184. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  1185. format(string, 120, "> %s's IP: %s <", pName(id), getIP(id));
  1186. SendClientMessage(playerid, GetPlayerColor(id), string);
  1187. return 1;
  1188. }
  1189.  
  1190. CMD:spawn(playerid, params[])
  1191. {
  1192. LoginCheck(playerid);
  1193. LevelCheck(playerid, 1);
  1194.  
  1195. new
  1196. string[128],
  1197. id
  1198. ;
  1199.  
  1200. if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /spawn [playerid]");
  1201. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  1202. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  1203. SetPlayerPos(id, 0.0, 0.0, 0.0);
  1204. SpawnPlayer(id);
  1205. format(string, sizeof(string), "You have respawned Player %s.", pName(id));
  1206. SendClientMessage(playerid, -1, string);
  1207. format(string, sizeof(string), "Administrator %s has respawned you.", pName(playerid));
  1208. SendClientMessage(id, COLOR_YELLOW, string);
  1209. return 1;
  1210. }
  1211.  
  1212. CMD:goto(playerid, params[])
  1213. {
  1214. LoginCheck(playerid);
  1215. LevelCheck(playerid, 1);
  1216.  
  1217. new
  1218. id,
  1219. string[130],
  1220. Float:x,
  1221. Float:y,
  1222. Float:z
  1223. ;
  1224. if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /goto [playerid]");
  1225. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  1226. GetPlayerPos(id, x, y, z);
  1227. SetPlayerInterior(playerid, GetPlayerInterior(id));
  1228. SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id));
  1229. if(GetPlayerState(playerid) == 2)
  1230. {
  1231. SetVehiclePos(GetPlayerVehicleID(playerid), x+3, y, z);
  1232. LinkVehicleToInterior(GetPlayerVehicleID(playerid), GetPlayerInterior(id));
  1233. SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), GetPlayerVirtualWorld(id));
  1234. }
  1235. else SetPlayerPos(playerid, x+2, y, z);
  1236. format(string, sizeof(string), "You have been teleported to Player %s.", pName(id));
  1237. SendClientMessage(playerid, COLOR_GREEN, string);
  1238. format(string, sizeof(string), "Administrator %s has teleported to your location.", pName(playerid));
  1239. SendClientMessage(id, COLOR_GREEN, string);
  1240. return 1;
  1241. }
  1242.  
  1243. CMD:setweather(playerid, params[])
  1244. {
  1245. LoginCheck(playerid);
  1246. LevelCheck(playerid, 1);
  1247.  
  1248. new
  1249. string[130],
  1250. id,
  1251. weather
  1252. ;
  1253.  
  1254. if(sscanf(params, "ui", id, weather)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /setweather [playerid] [0/45]");
  1255. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  1256. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  1257. if(weather < 0 || weather > 45) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Invalid Weather ID. (0/45)");
  1258. SetPlayerWeather(id, weather);
  1259. format(string, sizeof(string), "You have set %s's weather to weatherID %d", pName(id), weather);
  1260. SendClientMessage(playerid, COLOR_YELLOW, string);
  1261. format(string, sizeof(string), "Administrator %s has your weather to weatherID %d", pName(playerid), weather);
  1262. SendClientMessage(id, COLOR_YELLOW, string);
  1263. return 1;
  1264. }
  1265.  
  1266. CMD:settime(playerid, params[])
  1267. {
  1268. LoginCheck(playerid);
  1269. LevelCheck(playerid, 1);
  1270.  
  1271. new
  1272. string[130],
  1273. id,
  1274. time
  1275. ;
  1276.  
  1277. if(sscanf(params, "ui", id, time)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /settime [playerid] [0/23]");
  1278. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  1279. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  1280. if(time < 0 || time > 23) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Invalid Time. (0/23)");
  1281. SetPlayerTime(id, time, 0);
  1282. format(string, sizeof(string), "You have set %s's screen time to %d:00", pName(id), time);
  1283. SendClientMessage(id, COLOR_YELLOW, string);
  1284. format(string, sizeof(string), "Administrator %s has set your screen time to %d:00", pName(playerid), time);
  1285. SendClientMessage(id, COLOR_YELLOW, string);
  1286. return 1;
  1287. }
  1288.  
  1289. CMD:announce(playerid, params[])
  1290. {
  1291. LoginCheck(playerid);
  1292. LevelCheck(playerid, 1);
  1293. if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /announce [message to all]");
  1294. GameTextForAll(params, 4000, 3);
  1295. return 1;
  1296. }
  1297.  
  1298. CMD:kick(playerid, params[])
  1299. {
  1300. LoginCheck(playerid);
  1301. LevelCheck(playerid, 1);
  1302.  
  1303. new
  1304. string[128],
  1305. id,
  1306. reason[128]
  1307. ;
  1308. if(sscanf(params, "uS(N/A)[128]", id, reason)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /kick [playerid] [reason(Default: N/A)]");
  1309. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  1310. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  1311. format(string, sizeof(string), "** %s has been kicked by Adminstrator %s [Reason: %s]", pName(id), pName(playerid), reason);
  1312. SendClientMessageToAll(COLOR_GREY, string);
  1313.  
  1314. #if LOG == true
  1315. SaveLog("kicklog.txt", string);
  1316. #endif
  1317.  
  1318. KickDelay(id);
  1319. return 1;
  1320. }
  1321.  
  1322. CMD:asay(playerid, params[])
  1323. {
  1324. LoginCheck(playerid);
  1325. LevelCheck(playerid, 1);
  1326.  
  1327. new
  1328. string[128]
  1329. ;
  1330.  
  1331. if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /asay [message as asay]");
  1332.  
  1333. format(string, sizeof(string), "** Admin %s: %s", pName(playerid), params);
  1334. SendClientMessageToAll(COLOR_GREEN, string);
  1335. return 1;
  1336. }
  1337.  
  1338. CMD:a(playerid, params[])
  1339. {
  1340. new
  1341. string[140]
  1342. ;
  1343.  
  1344. LoginCheck(playerid);
  1345. LevelCheck(playerid, 1);
  1346.  
  1347. if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: /a [admin chat]");
  1348.  
  1349. format(string, sizeof( string ), "<!> Admin Chat %s: %s", pName(playerid), params);
  1350.  
  1351. #if LOG == true
  1352. SaveLog("adminchat.txt", string);
  1353. #endif
  1354.  
  1355. foreach(new i : Player)
  1356. {
  1357. if(User[i][accountLogged] == true)
  1358. {
  1359. if(User[i][accountAdmin] >= 1)
  1360. {
  1361. SendClientMessage(i, COLOR_YELLOW, string);
  1362. }
  1363. }
  1364. }
  1365. return 1;
  1366. }
  1367.  
  1368. //============================================================================//
  1369. // Administrative Level Two //
  1370. //============================================================================//
  1371.  
  1372. CMD:jetpack(playerid, params[])
  1373. {
  1374. LoginCheck(playerid);
  1375. LevelCheck(playerid, 2);
  1376.  
  1377. new
  1378. id,
  1379. string[130]
  1380. ;
  1381.  
  1382. if(!sscanf(params, "u", id))
  1383. {
  1384. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  1385. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  1386. SetPlayerSpecialAction(id, SPECIAL_ACTION_USEJETPACK);
  1387. format(string, sizeof(string), "You have given Player %s(ID:%d) a jetpack.", pName(id), id);
  1388. SendClientMessage(playerid, COLOR_YELLOW, string);
  1389. format(string, sizeof(string), "Administrator %s(ID:%d) has given you a jetpack.", pName(playerid), playerid);
  1390. SendClientMessage(id, COLOR_YELLOW, string);
  1391. }
  1392. else
  1393. {
  1394. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK);
  1395. SendClientMessage(playerid, COLOR_YELLOW, "Jetpack Spawned!");
  1396. SendClientMessage(playerid, -1, "Want to give player a jetpack? Just do "orange"/jetpack [playerid]");
  1397. }
  1398. return 1;
  1399. }
  1400.  
  1401. CMD:aweapons(playerid, params[])
  1402. {
  1403. LoginCheck(playerid);
  1404. LevelCheck(playerid, 2);
  1405.  
  1406. GivePlayerWeapon(playerid, 24, 99999);
  1407. GivePlayerWeapon(playerid, 26, 99999);
  1408. GivePlayerWeapon(playerid, 29, 99999);
  1409. GivePlayerWeapon(playerid, 31, 99999);
  1410. GivePlayerWeapon(playerid, 33, 99999);
  1411. GivePlayerWeapon(playerid, 38, 99999);
  1412. GivePlayerWeapon(playerid, 9, 1);
  1413.  
  1414. SendClientMessage(playerid, COLOR_YELLOW, "Admin weapons received!");
  1415. return 1;
  1416. }
  1417.  
  1418. CMD:show(playerid, params[])
  1419. {
  1420. LoginCheck(playerid);
  1421. LevelCheck(playerid, 2);
  1422.  
  1423. new Player, Show[129];
  1424. if(sscanf(params, "us[129]", Player, Show)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /show [playerid] [text]");
  1425. if(Player == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  1426. if(User[playerid][accountAdmin] < User[Player][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  1427.  
  1428. GameTextForPlayer(Player, Show, 6000, 3);
  1429.  
  1430. new string[120];
  1431. format(string, sizeof(string), "Screen text sent to %s(ID:%d).", pName(Player), Player);
  1432. SendClientMessage(playerid, COLOR_YELLOW, string);
  1433. format(string, sizeof(string), "Administrator %s(ID:%d) has screen text you.", pName(playerid), playerid);
  1434. SendClientMessage(Player, COLOR_YELLOW, string);
  1435. return 1;
  1436. }
  1437.  
  1438. CMD:muted(playerid, params[])
  1439. {
  1440. new string[128], count = 0;
  1441.  
  1442. SendClientMessage(playerid, -1, "** "orange"Muted Players "white"**");
  1443. foreach(new i : Player)
  1444. {
  1445. if(User[i][accountLogged] == true)
  1446. {
  1447. if(User[i][accountMuted] == 1)
  1448. {
  1449. format(string, sizeof(string), "(%d) %s - Seconds left %d", i, pName(i), User[i][accountMuteSec]);
  1450. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  1451. count++;
  1452. }
  1453. }
  1454. }
  1455. if(count == 0) return SendClientMessage(playerid, -1, "No muted players at the server.");
  1456. return 1;
  1457. }
  1458.  
  1459. CMD:jailed(playerid, params[])
  1460. {
  1461. new string[128], count = 0;
  1462.  
  1463. SendClientMessage(playerid, -1, "** "orange"Jailed Players "white"**");
  1464. foreach(new i : Player)
  1465. {
  1466. if(User[i][accountLogged] == true)
  1467. {
  1468. if(User[i][accountJail] == 1)
  1469. {
  1470. format(string, sizeof(string), "(%d) %s - Seconds left %d", i, pName(i), User[i][accountJailSec]);
  1471. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  1472. count++;
  1473. }
  1474. }
  1475. }
  1476. if(count == 0) return SendClientMessage(playerid, -1, "No jailed players at the server.");
  1477. return 1;
  1478. }
  1479.  
  1480. CMD:setvhealth(playerid, params[])
  1481. {
  1482. LoginCheck(playerid);
  1483. LevelCheck(playerid, 2);
  1484.  
  1485. new
  1486. string[130],
  1487. id,
  1488. hp
  1489. ;
  1490.  
  1491. if(sscanf(params, "ud", id, hp)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /setvhealth [playerid] [health]");
  1492. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  1493. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  1494. new Float:hp2 = float(hp);
  1495.  
  1496. if(!IsPlayerInAnyVehicle(id)) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player must be inside of a vehicle!");
  1497. SetVehicleHealth(GetPlayerVehicleID(id), hp2);
  1498.  
  1499. format(string, sizeof(string), "You have set Player's %s(ID:%d) vehicle health to %d", pName(id), id, floatround(hp2));
  1500. SendClientMessage(playerid, COLOR_YELLOW, string);
  1501. format(string, sizeof(string), "Admin %s(ID:%d) has set your vehicle health to %d", pName(playerid), playerid, floatround(hp2));
  1502. SendClientMessage(id, COLOR_YELLOW, string);
  1503. return 1;
  1504. }
  1505.  
  1506. CMD:eject(playerid, params[])
  1507. {
  1508. LoginCheck(playerid);
  1509. LevelCheck(playerid, 2);
  1510.  
  1511. new
  1512. string[130],
  1513. id
  1514. ;
  1515.  
  1516. if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /eject [playerid]");
  1517. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  1518. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  1519. if(!IsPlayerInAnyVehicle(id)) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player must be inside of the vehicle.");
  1520. RemovePlayerFromVehicle(id);
  1521. format(string, sizeof(string), "You have ejected %s(ID:%d) from his/HER vehicle", pName(id), id);
  1522. SendClientMessage(playerid, COLOR_YELLOW, string);
  1523. format(string, sizeof(string), "Admin %s(ID:%d) has ejected you from your vehicle.", pName(playerid), playerid);
  1524. SendClientMessage(id, COLOR_YELLOW, string);
  1525. return 1;
  1526. }
  1527.  
  1528. CMD:carpjob(playerid, params[])
  1529. {
  1530. LoginCheck(playerid);
  1531. LevelCheck(playerid, 2);
  1532.  
  1533. new
  1534. string[130],
  1535. id,
  1536. pjob
  1537. ;
  1538. if(sscanf(params, "ui", id, pjob)) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: /carpjob [playerid] [paintjob(0-3)]");
  1539. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  1540. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  1541. if(!IsPlayerInAnyVehicle(id)) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player must be inside of a vehicle.");
  1542. if(pjob < 0 || pjob > 3) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Invalid Paintjob ID.");
  1543.  
  1544. format(string, sizeof(string), "You have changed the paintjob of %s(ID:%d)'s %s to '%d'", pName(id), id, VehicleNames[GetVehicleModel(GetPlayerVehicleID(id))-400], pjob);
  1545. SendClientMessage(playerid, COLOR_GREEN, string);
  1546. format(string, sizeof(string), "Admin %s(ID:%d) has changed the paintjob of your %s to '%d'", pName(playerid), playerid, VehicleNames[GetVehicleModel(GetPlayerVehicleID(id))-400], pjob);
  1547. SendClientMessage(id, COLOR_YELLOW, string);
  1548. ChangeVehiclePaintjob(GetPlayerVehicleID(id), pjob);
  1549. return 1;
  1550. }
  1551.  
  1552. CMD:carcolor(playerid, params[])
  1553. {
  1554. LoginCheck(playerid);
  1555. LevelCheck(playerid, 2);
  1556.  
  1557. new
  1558. string[130],
  1559. id,
  1560. col1,
  1561. col2
  1562. ;
  1563. if(sscanf(params, "uiI(255)", id, col1, col2)) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: /carcolor [playerid] [colour1] [colour2(optional)]");
  1564. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  1565. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  1566. if(!IsPlayerInAnyVehicle(id)) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player must be inside of a vehicle.");
  1567.  
  1568. if(col2==255) col2=random(256);
  1569.  
  1570. format(string, sizeof(string), "You have changed the color of %s(ID:%d)'s %s to '%d,%d'", pName(id), id, VehicleNames[GetVehicleModel(GetPlayerVehicleID(id))-400], col1, col2);
  1571. SendClientMessage(playerid, COLOR_GREEN, string);
  1572. format(string, sizeof(string), "Admin %s(ID:%d) has changed the color of your %s to '%d,%d'", pName(playerid), playerid, VehicleNames[GetVehicleModel(GetPlayerVehicleID(id))-400], col1, col2);
  1573. SendClientMessage(id, COLOR_YELLOW, string);
  1574. ChangeVehicleColor(GetPlayerVehicleID(id), col1, col2);
  1575. return 1;
  1576. }
  1577.  
  1578. CMD:givecar(playerid, params[])
  1579. {
  1580. LoginCheck(playerid);
  1581. LevelCheck(playerid, 2);
  1582.  
  1583. new string[130],
  1584. vID[32],
  1585. id,
  1586. vVW,
  1587. vINT,
  1588. vid,
  1589. Float:x,
  1590. Float:y,
  1591. Float:z,
  1592. Float:ang,
  1593. vehicle,
  1594. col1,
  1595. col2
  1596. ;
  1597. if(sscanf(params, "us[32]I(255)I(255)", id, vID, col1, col2)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /givecar [playerid] [vehicleid(or name)] [color1(optional)] [color2(optional)]");
  1598. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  1599. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  1600. if(isnumeric(vID)) vid = strval(vID);
  1601. else vid = GetVehicleModelIDFromName(vID);
  1602. GetPlayerPos(id, x, y, z);
  1603. GetPlayerFacingAngle(id, ang);
  1604. if(vid < 400 || vid > 611) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Invalid Vehicle Model ID!");
  1605. if(IsPlayerInAnyVehicle(id)) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player already have a vehicle.");
  1606.  
  1607. if(col1==255) col1=random(256);
  1608. if(col2==255) col2=random(256);
  1609.  
  1610. if(User[id][pCar] != -1 && !IsPlayerAdmin(id))
  1611. EraseVeh(User[id][pCar]);
  1612.  
  1613. vehicle = CreateVehicle(vid, x, y, z, 0, -1, -1, 0);
  1614. vVW = GetPlayerVirtualWorld(id);
  1615. vINT = GetPlayerInterior(id);
  1616. SetVehicleVirtualWorld(vehicle, vVW);
  1617. LinkVehicleToInterior(vehicle, vINT);
  1618. PutPlayerInVehicle(id, vehicle, 0);
  1619. User[id][pCar] = vehicle;
  1620. format(string, sizeof(string), "Admin %s(%d) has given you a \"%s\"(%i)", pName(playerid), playerid, VehicleNames[vid - 400], vid);
  1621. SendClientMessage(id, COLOR_YELLOW, string);
  1622. format(string, sizeof(string), "You have given %s(%d) a \"%s\"(%i)", pName(id), id, VehicleNames[vid - 400], vid);
  1623. SendClientMessage(playerid, COLOR_YELLOW, string);
  1624. return 1;
  1625. }
  1626.  
  1627. CMD:car(playerid, params[])
  1628. {
  1629. LoginCheck(playerid);
  1630. LevelCheck(playerid, 2);
  1631.  
  1632. new carID[50], car, colour1, colour2, string[128];
  1633. if(sscanf(params, "s[50]I(255)I(255)", carID, colour1, colour2)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /car [VehicleID(Name)] [Color1(Optional)] [Color2(Optional)]");
  1634. if(!isnumeric(carID)) car = GetVehicleModelIDFromName(carID);
  1635. else car = strval(carID);
  1636. if(car < 400 || car > 611) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Invalid Vehicle Model ID!");
  1637.  
  1638. if(colour1==255) colour1=random(256);
  1639. if(colour2==255) colour2=random(256);
  1640.  
  1641. if(User[playerid][pCar] != -1 && !IsPlayerAdmin(playerid))
  1642. EraseVeh(User[playerid][pCar]);
  1643. new VehicleID;
  1644. new Float:X, Float:Y, Float:Z;
  1645. new Float:Angle, int1;
  1646. GetPlayerPos(playerid, X, Y, Z);
  1647. GetPlayerFacingAngle(playerid, Angle);
  1648. int1 = GetPlayerInterior(playerid);
  1649. VehicleID = CreateVehicle(car, X+3,Y,Z, Angle, colour1, colour2, -1);
  1650. LinkVehicleToInterior(VehicleID, int1);
  1651. SetVehicleVirtualWorld(VehicleID, GetPlayerVirtualWorld(playerid));
  1652. User[playerid][pCar] = VehicleID;
  1653. format(string, sizeof(string), "You have spawned a \"%s\" (Model: %d) with color %d,%d", VehicleNames[car-400], car, colour1, colour2);
  1654. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  1655. return 1;
  1656. }
  1657.  
  1658. CMD:spec(playerid, params[])
  1659. {
  1660. LoginCheck(playerid);
  1661. LevelCheck(playerid, 2);
  1662.  
  1663. new string[150], specplayerid;
  1664.  
  1665. if(sscanf(params, "u", specplayerid)) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: /spec [playerid]");
  1666. if(specplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  1667. if(User[playerid][accountAdmin] < User[specplayerid][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  1668. if(specplayerid == playerid) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot spectate yourself.");
  1669. if(GetPlayerState(specplayerid) == PLAYER_STATE_SPECTATING && User[specplayerid][SpecID] != INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player is spectating someone.");
  1670. if(GetPlayerState(specplayerid) != 1 && GetPlayerState(specplayerid) != 2 && GetPlayerState(specplayerid) != 3) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not spawned.");
  1671. GetPlayerPos(playerid, SpecPos[playerid][0], SpecPos[playerid][1], SpecPos[playerid][2]);
  1672. GetPlayerFacingAngle(playerid, SpecPos[playerid][3]);
  1673. SpecInt[playerid][0] = GetPlayerInterior(playerid);
  1674. SpecInt[playerid][1] = GetPlayerVirtualWorld(playerid);
  1675. StartSpectate(playerid, specplayerid);
  1676. format(string, sizeof(string), "Now Spectating: %s (ID: %d)", pName(specplayerid), specplayerid);
  1677. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  1678. SendClientMessage(playerid, -1, "Press SHIFT for Advance Spectating and SPACE for backward spectating.");
  1679. return 1;
  1680. }
  1681.  
  1682. CMD:specoff(playerid, params[])
  1683. {
  1684. LoginCheck(playerid);
  1685. LevelCheck(playerid, 2);
  1686.  
  1687. if(User[playerid][SpecType] != ADMIN_SPEC_TYPE_NONE)
  1688. {
  1689. StopSpectate(playerid);
  1690. SetTimerEx("PosAfterSpec", 3000, 0, "d", playerid);
  1691. SendClientMessage(playerid, COLOR_LIGHTBLUE, "No longer spectating.");
  1692. }
  1693. else return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You are not spectating anyone.");
  1694. return 1;
  1695. }
  1696.  
  1697. CMD:akill(playerid, params[])
  1698. {
  1699. LoginCheck(playerid);
  1700. LevelCheck(playerid, 2);
  1701.  
  1702. new
  1703. string[150],
  1704. reason[128],
  1705. id
  1706. ;
  1707.  
  1708. if(sscanf(params, "uS(No Reason)[128]", id, reason)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /akill [playerid] [reason(Default: None)]");
  1709. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  1710. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  1711.  
  1712. if(_God[id] == 1)
  1713. {
  1714. _God[id] = 0;
  1715. }
  1716.  
  1717. SetPlayerHealth(id, 0.0);
  1718. format(string, sizeof(string), "** %s(%d) has been killed by Administrator %s(%d) (Reason: %s)", pName(id), id, pName(playerid), playerid, reason);
  1719. SendClientMessageToAll(COLOR_GREY, string);
  1720. return 1;
  1721. }
  1722.  
  1723. CMD:jail(playerid, params[])
  1724. {
  1725. LoginCheck(playerid);
  1726. LevelCheck(playerid, 2);
  1727.  
  1728. new id, sec, reason[128], string[250];
  1729. if(sscanf(params, "uiS(None)[128]", id, sec, reason)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /jail [playerid] [seconds] [reason]");
  1730. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  1731. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  1732. if(sec < 30) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot jail lower than 30 seconds.");
  1733. if(User[id][accountJail] == 1) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player already jailed.");
  1734. if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on yourself.");
  1735.  
  1736. SetCameraBehindPlayer(id);
  1737. SetPlayerPos(id, 197.6661, 173.8179, 1003.0234);
  1738. SetPlayerInterior(id, 3);
  1739.  
  1740. format(string, sizeof(string), "** %s(%d) has been jailed by Administrator %s(%d) for %d seconds [%s]", pName(id), id, pName(playerid), playerid, sec, reason);
  1741. SendClientMessageToAll(COLOR_GREY, string);
  1742. SendClientMessage(id, COLOR_ORANGE, "You have been jailed by an Admin, Press a screenshot (F8) and make a complaint on the forums, if you want to.");
  1743.  
  1744. #if LOG == true
  1745. format(string, sizeof(string), "%s has been jailed by %s (%d seconds, reason %s)", pName(id), pName(playerid), sec, reason);
  1746. SaveLog("jail.txt", string);
  1747. #endif
  1748.  
  1749. User[id][accountJail] = 1, User[id][accountJailSec] = sec;
  1750. return 1;
  1751. }
  1752.  
  1753. CMD:unjail(playerid, params[])
  1754. {
  1755. LoginCheck(playerid);
  1756. LevelCheck(playerid, 2);
  1757.  
  1758. new id, reason[128], string[250];
  1759. if(sscanf(params, "uS(None)[128]", id, reason)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /unjail [playerid] [reason]");
  1760. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  1761. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  1762. if(User[id][accountJail] == 0) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not in jailed.");
  1763. if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on yourself.");
  1764.  
  1765. format(string, sizeof(string), "** %s(%d) has been unjailed by Administrator %s(%d) for %s", pName(id), id, pName(playerid), playerid, reason);
  1766. SendClientMessageToAll(COLOR_GREY, string);
  1767. SendClientMessage(id, COLOR_ORANGE, "You have been released from jail by an Admin.");
  1768.  
  1769. #if LOG == true
  1770. format(string, sizeof(string), "%s has been unjailed by %s for %s", pName(id), pName(playerid), reason);
  1771. SaveLog("jail.txt", string);
  1772. #endif
  1773.  
  1774. User[id][accountJail] = 0, User[id][accountJailSec] = 0;
  1775. SpawnPlayer(id);
  1776. return 1;
  1777. }
  1778.  
  1779. CMD:mute(playerid, params[])
  1780. {
  1781. LoginCheck(playerid);
  1782. LevelCheck(playerid, 2);
  1783.  
  1784. new id, sec, reason[128], string[128+50];
  1785. if(sscanf(params, "uiS(None)[128]", id, sec, reason)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /mute [playerid] [seconds] [reason]");
  1786. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  1787. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  1788. if(sec < 30) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot mute lower than 30 seconds.");
  1789. if(User[id][accountMuted] == 1) return SendClientMessage(playerid,COLOR_RED, "Syntax Error: Player already muted.");
  1790. if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on yourself.");
  1791.  
  1792. format(string, sizeof(string), "** %s(%d) has been muted by Administrator %s(%d) for %d seconds [%s]", pName(id), id, pName(playerid), playerid, sec, reason);
  1793. SendClientMessageToAll(COLOR_GREY, string);
  1794. SendClientMessage(id, COLOR_ORANGE, "You have been muted by an Admin, Press a screenshot (F8) and make a complaint on the forums, if you want to.");
  1795.  
  1796. #if LOG == true
  1797. format(string, sizeof(string), "%s has been muted by %s (%d seconds, reason %s)", pName(id), pName(playerid), sec, reason);
  1798. SaveLog("mute.txt", string);
  1799. #endif
  1800.  
  1801. User[id][accountMuted] = 1, User[id][accountMuteSec] = sec;
  1802. return 1;
  1803. }
  1804.  
  1805. CMD:unmute(playerid, params[])
  1806. {
  1807. LoginCheck(playerid);
  1808. LevelCheck(playerid, 2);
  1809.  
  1810. new id, reason[128], string[250];
  1811. if(sscanf(params, "uS(None)[128]", id, reason)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /unmute [playerid] [reason]");
  1812. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  1813. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  1814. if(User[id][accountMuted] == 0) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not muted.");
  1815. if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on yourself.");
  1816.  
  1817. format(string, sizeof(string), "* %s(%d) has been unmuted by Administrator %s(%d) for %s", pName(id), id, pName(playerid), playerid, reason);
  1818. SendClientMessageToAll(COLOR_GREY, string);
  1819. SendClientMessage(id, COLOR_ORANGE, "You have been unmuted by an Admin.");
  1820.  
  1821. #if LOG == true
  1822. format(string, sizeof(string), "%s has been unmuted by %s", pName(id), pName(playerid));
  1823. SaveLog("mute.txt", string);
  1824. #endif
  1825.  
  1826. User[id][accountMuted] = 0, User[id][accountMuteSec] = 0;
  1827. return 1;
  1828. }
  1829.  
  1830. CMD:setskin(playerid, params[])
  1831. {
  1832. new
  1833. string[128+40],
  1834. id,
  1835. skin
  1836. ;
  1837.  
  1838. LoginCheck(playerid);
  1839. LevelCheck(playerid, 2);
  1840.  
  1841. if(sscanf(params, "ui", id, skin)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /setskin [playerid] [skin(0-299)]");
  1842. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  1843. if(skin < 0 || skin == 74 || skin > 299) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Invalid skinID.");
  1844.  
  1845. format(string, 128, "You have set Player "orange"%s "white"skinID to "grey"%d", pName(id), skin);
  1846. SendClientMessage(playerid, -1, string);
  1847.  
  1848. format(string, 128, "Administrator "orange"%s "white"has set your skinID to "grey"%d", pName(playerid), skin);
  1849. SendClientMessage(id, -1, string);
  1850.  
  1851. SetPlayerSkin(id, skin);
  1852. return 1;
  1853. }
  1854.  
  1855. CMD:clearchat(playerid, params[])
  1856. {
  1857. LoginCheck(playerid);
  1858. LevelCheck(playerid, 2);
  1859.  
  1860. new
  1861. string[128]
  1862. ;
  1863.  
  1864. for(new i=0; i<100; i++)
  1865. {
  1866. SendClientMessageToAll(-1, " ");
  1867. }
  1868.  
  1869. format(string, sizeof string, "Administrator "orange"%s "white"has cleared the chat.", pName(playerid));
  1870. SendClientMessageToAll(-1, string);
  1871. return 1;
  1872. }
  1873.  
  1874. CMD:heal(playerid, params[])
  1875. {
  1876. LoginCheck(playerid);
  1877. LevelCheck(playerid, 2);
  1878.  
  1879. new
  1880. id,
  1881. string[130]
  1882. ;
  1883.  
  1884. if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /heal [playerid]");
  1885. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  1886.  
  1887. SetPlayerHealth(id, 100.0);
  1888. format(string, sizeof(string), "You have given Player %s a full pack of health.", pName(id));
  1889. SendClientMessage(playerid, COLOR_YELLOW, string);
  1890. format(string, sizeof(string), "Administrator %s has given you a full pack of health.", pName(playerid));
  1891. SendClientMessage(id, COLOR_YELLOW, string);
  1892. return 1;
  1893. }
  1894.  
  1895. CMD:armour(playerid, params[])
  1896. {
  1897. LoginCheck(playerid);
  1898. LevelCheck(playerid, 2);
  1899.  
  1900. new
  1901. id,
  1902. string[130]
  1903. ;
  1904.  
  1905. if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /armour [playerid]");
  1906. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  1907.  
  1908. SetPlayerArmour(id, 100.0);
  1909. format(string, sizeof(string), "You have given %s an armour.", pName(id));
  1910. SendClientMessage(playerid, COLOR_YELLOW, string);
  1911. format(string, sizeof(string), "Administrator %s has given you a full armour.", pName(playerid));
  1912. SendClientMessage(id, COLOR_YELLOW, string);
  1913. return 1;
  1914. }
  1915.  
  1916. CMD:setinterior(playerid, params[])
  1917. {
  1918. LoginCheck(playerid);
  1919. LevelCheck(playerid, 2);
  1920.  
  1921. new
  1922. string[130],
  1923. id,
  1924. interior
  1925. ;
  1926.  
  1927. if(sscanf(params, "ui", id, interior)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /setinterior [playerid] [interior]");
  1928. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  1929. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  1930. SetPlayerInterior(id, interior);
  1931. format(string, sizeof(string), "Administrator %s has set your interior to %d.", pName(playerid), interior);
  1932. SendClientMessage(id, COLOR_ORANGE, string);
  1933. format(string, sizeof(string), "You have set Player %s's interior to %d.", pName(id), interior);
  1934. SendClientMessage(playerid, COLOR_ORANGE, string);
  1935. return 1;
  1936. }
  1937.  
  1938. CMD:setworld(playerid, params[])
  1939. {
  1940. LoginCheck(playerid);
  1941. LevelCheck(playerid, 2);
  1942.  
  1943. new
  1944. string[130],
  1945. id,
  1946. vw
  1947. ;
  1948.  
  1949. if(sscanf(params, "ui", id, vw)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax error: /setworld [playerid] [virtual world]");
  1950. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  1951. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  1952. SetPlayerVirtualWorld(id, vw);
  1953. format(string, sizeof(string), "Administrator %s has set your virtual world to %d.", pName(playerid), vw);
  1954. SendClientMessage(id, COLOR_ORANGE, string);
  1955. format(string, sizeof(string), "You have set Player %s's virtual world to %d.", pName(id), vw);
  1956. SendClientMessage(playerid, COLOR_ORANGE, string);
  1957. return 1;
  1958. }
  1959.  
  1960. CMD:explode(playerid, params[])
  1961. {
  1962. LoginCheck(playerid);
  1963. LevelCheck(playerid, 2);
  1964.  
  1965. new string[128],
  1966. id,
  1967. Float:x,
  1968. Float:y,
  1969. Float:z,
  1970. reason[128]
  1971. ;
  1972.  
  1973. if(sscanf(params, "uS(N/A)[128]", id, reason)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /explode [playerid] [reason(Default: N/A)]");
  1974. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  1975. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  1976.  
  1977. GetPlayerPos(id, x, y, z);
  1978. format(string, sizeof(string), "** %s(%d) has been exploded by Administrator %s [Reason: %s]", pName(id), id, pName(playerid), reason);
  1979. SendClientMessageToAll(COLOR_GREY, string);
  1980.  
  1981. #if LOG == true
  1982. SaveLog("explode.txt", string);
  1983. #endif
  1984.  
  1985. CreateExplosion(x, y, z, 7, 1.00);
  1986. return 1;
  1987. }
  1988.  
  1989. CMD:disarm(playerid, params[])
  1990. {
  1991. LoginCheck(playerid);
  1992. LevelCheck(playerid, 2);
  1993.  
  1994. new
  1995. string[130],
  1996. id
  1997. ;
  1998.  
  1999. if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /disarm [playerid]");
  2000. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  2001. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  2002. ResetPlayerWeapons(id);
  2003. format(string, sizeof(string), "You have removed Player %s's guns.", pName(id));
  2004. SendClientMessage(playerid, COLOR_YELLOW, string);
  2005. format(string, sizeof(string), "Administrator %s has removed your guns.", pName(playerid));
  2006. SendClientMessage(id, COLOR_YELLOW, string);
  2007. return 1;
  2008. }
  2009.  
  2010. //============================================================================//
  2011. // Administrative Level Three //
  2012. //============================================================================//
  2013.  
  2014. CMD:get(playerid, params[])
  2015. {
  2016. LoginCheck(playerid);
  2017. LevelCheck(playerid, 3);
  2018.  
  2019. new
  2020. id,
  2021. string[130],
  2022. Float:x,
  2023. Float:y,
  2024. Float:z
  2025. ;
  2026. if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /get [playerid]");
  2027.  
  2028. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  2029. if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot teleport yourself to yourself.");
  2030. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  2031.  
  2032. GetPlayerPos(playerid, x, y, z);
  2033. SetPlayerInterior(id, GetPlayerInterior(playerid));
  2034. SetPlayerVirtualWorld(id, GetPlayerVirtualWorld(playerid));
  2035.  
  2036. if(GetPlayerState(id) == 2)
  2037. {
  2038. new VehicleID = GetPlayerVehicleID(id);
  2039. SetVehiclePos(VehicleID, x+3, y, z);
  2040. LinkVehicleToInterior(VehicleID, GetPlayerInterior(playerid));
  2041. SetVehicleVirtualWorld(GetPlayerVehicleID(id), GetPlayerVirtualWorld(playerid));
  2042. }
  2043. else SetPlayerPos(id, x+2, y, z);
  2044.  
  2045. format(string, sizeof(string), "You have been teleported to Admin %s(ID:%d) location.", pName(playerid), playerid);
  2046. SendClientMessage(id, COLOR_YELLOW, string);
  2047. format(string, sizeof(string), "You have teleported %s(ID:%d) to your location.", pName(id), id);
  2048. SendClientMessage(playerid, COLOR_YELLOW, string);
  2049. return 1;
  2050. }
  2051.  
  2052. CMD:write(playerid, params[])
  2053. {
  2054. LoginCheck(playerid);
  2055. LevelCheck(playerid, 3);
  2056.  
  2057. new
  2058. Colour,
  2059. string[130]
  2060. ;
  2061. if(sscanf(params, "is[128]", Colour, params))
  2062. return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /write [color] [text]") &&
  2063. SendClientMessage(playerid, COLOR_GREY, "Colors: [0]Black, [1]White, [2]Red, [3]Orange, [4]Yellow, [5]Green, [6]Blue, [7]Purple, [8]Brown, [9]Pink");
  2064. if(Colour > 9) return SendClientMessage(playerid, COLOR_GREY, "Colors: [0]Black, [1]White, [2]Red, [3]Orange, [4]Yellow, [5]Green, [6]Blue, [7]Purple, [8]Brown, [9]Pink");
  2065.  
  2066. if(Colour == 0) { format(string,sizeof(string),"%s",params); SendClientMessageToAll(COLOR_BLACK,string);return 1;}
  2067. else if(Colour == 1) {
  2068. format(string,sizeof(string),"%s",params);SendClientMessageToAll(COLOR_WHITE,string); return 1;}
  2069. else if(Colour == 2) {
  2070. format(string,sizeof(string),"%s",params);SendClientMessageToAll(COLOR_RED,string); return 1;}
  2071. else if(Colour == 3) {
  2072. format(string,sizeof(string),"%s",params);SendClientMessageToAll(COLOR_ORANGE,string); return 1;}
  2073. else if(Colour == 4) {
  2074. format(string,sizeof(string),"%s",params);SendClientMessageToAll(COLOR_YELLOW,string); return 1;}
  2075. else if(Colour == 5) {
  2076. format(string,sizeof(string),"%s",params);SendClientMessageToAll(COLOR_GREEN,string); return 1;}
  2077. else if(Colour == 6) {
  2078. format(string,sizeof(string),"%s",params);SendClientMessageToAll(COLOR_BLUE,string); return 1;}
  2079. else if(Colour == 7) {
  2080. format(string,sizeof(string),"%s",params);SendClientMessageToAll(COLOR_PURPLE,string); return 1;}
  2081. else if(Colour == 8) {
  2082. format(string,sizeof(string),"%s",params);SendClientMessageToAll(COLOR_BROWN,string); return 1;}
  2083. else if(Colour == 9) {
  2084. format(string,sizeof(string),"%s",params);SendClientMessageToAll(COLOR_PINK,string); return 1;}
  2085. return 1;
  2086. }
  2087.  
  2088. CMD:force(playerid, params[])
  2089. {
  2090. LoginCheck(playerid);
  2091. LevelCheck(playerid, 3);
  2092.  
  2093. new
  2094. string[130],
  2095. id
  2096. ;
  2097.  
  2098. if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /force [playerid]");
  2099. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  2100. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  2101.  
  2102. format(string, sizeof(string), "You have force Player %s(ID:%d) to goto class selection.", pName(id), id);
  2103. SendClientMessage(playerid, COLOR_YELLOW, string);
  2104.  
  2105. format(string, sizeof(string), "Admin %s(ID:%d) force you to goto class selection.", pName(playerid), playerid);
  2106. SendClientMessage(id, COLOR_YELLOW, string);
  2107.  
  2108. SetPlayerHealth(id, 0.0);
  2109. ForceClassSelection(id);
  2110. return 1;
  2111. }
  2112.  
  2113. CMD:healall(playerid, params[])
  2114. {
  2115. LoginCheck(playerid);
  2116. LevelCheck(playerid, 3);
  2117.  
  2118. new
  2119. string[130]
  2120. ;
  2121.  
  2122. foreach(new i : Player)
  2123. {
  2124. if(i != playerid)
  2125. {
  2126. SetPlayerHealth(i, 100.0);
  2127. }
  2128. }
  2129. format(string, sizeof(string), "Admin %s(ID:%d) has heal all players.", pName(playerid), playerid);
  2130. SendClientMessageToAll(COLOR_YELLOW, string);
  2131. return 1;
  2132. }
  2133.  
  2134. CMD:setfstyle(playerid, params[])
  2135. {
  2136. LoginCheck(playerid);
  2137. LevelCheck(playerid, 3);
  2138.  
  2139. new
  2140. string[128],
  2141. id,
  2142. fstyle,
  2143. style[50]
  2144. ;
  2145.  
  2146. if(sscanf(params, "ui", id, fstyle)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /setfstyle [playerid] [styles]") &&
  2147. SendClientMessage(playerid, COLOR_GREY, "Styles: [0]Normal, [1]Boxing, [2]Kungfu, [3]Kneehead, [4]Grabkick, [5]Elbow");
  2148. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  2149. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  2150. if(fstyle > 5) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Inavlid Fighting Style.");
  2151.  
  2152. switch(fstyle)
  2153. {
  2154. case 0:
  2155. {
  2156. SetPlayerFightingStyle(id, 4);
  2157. style = "Normal";
  2158. }
  2159. case 1:
  2160. {
  2161. SetPlayerFightingStyle(id, 5);
  2162. style = "Boxing";
  2163. }
  2164. case 2:
  2165. {
  2166. SetPlayerFightingStyle(id, 6);
  2167. style = "Kung Fu";
  2168. }
  2169. case 3:
  2170. {
  2171. SetPlayerFightingStyle(id, 7);
  2172. style = "Kneehead";
  2173. }
  2174. case 4:
  2175. {
  2176. SetPlayerFightingStyle(id, 15);
  2177. style = "Grabkick";
  2178. }
  2179. case 5:
  2180. {
  2181. SetPlayerFightingStyle(id, 16);
  2182. style = "Elbow";
  2183. }
  2184. }
  2185. format(string, sizeof(string), "You have set %s(ID:%d) fighting style to '%s'", pName(id), id, style);
  2186. SendClientMessage(playerid, COLOR_YELLOW, string);
  2187. format(string, sizeof(string), "Admin %s(ID:%d) has set your fighting style to '%s'", pName(playerid), playerid, style);
  2188. SendClientMessage(id, COLOR_YELLOW, string);
  2189. return 1;
  2190. }
  2191.  
  2192. CMD:sethealth(playerid, params[])
  2193. {
  2194. LoginCheck(playerid);
  2195. LevelCheck(playerid, 3);
  2196.  
  2197. new
  2198. string[130],
  2199. id,
  2200. hp
  2201. ;
  2202.  
  2203. if(sscanf(params, "ud", id, hp)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /sethealth [playerid] [heatlh]");
  2204. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  2205. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  2206.  
  2207. new Float:hp2 = float(hp);
  2208.  
  2209. SetPlayerHealth(id, hp2);
  2210.  
  2211. format(string, sizeof(string), "You have set Player %s(ID:%d) health to %d", pName(id), id, floatround(hp2));
  2212. SendClientMessage(playerid, COLOR_YELLOW, string);
  2213. format(string, sizeof(string), "Admin %s(ID:%d) has set your health to %d", pName(playerid), playerid, floatround(hp2));
  2214. SendClientMessage(id, COLOR_YELLOW, string);
  2215. return 1;
  2216. }
  2217.  
  2218. CMD:setarmour(playerid, params[])
  2219. {
  2220. LoginCheck(playerid);
  2221. LevelCheck(playerid, 3);
  2222.  
  2223. new
  2224. string[130],
  2225. id,
  2226. armour
  2227. ;
  2228.  
  2229. if(sscanf(params, "ud", id, armour)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /setarmour [playerid] [armour]");
  2230. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  2231. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  2232.  
  2233. new Float:ar = float(armour);
  2234. SetPlayerArmour(id, ar);
  2235.  
  2236. format(string, sizeof(string), "You have set Player %s(ID:%d) armour to %d", pName(id), id, floatround(ar));
  2237. SendClientMessage(playerid, COLOR_YELLOW, string);
  2238. format(string, sizeof(string), "Admin %s(ID:%d) has set your armour to %d", pName(playerid), playerid, floatround(ar));
  2239. SendClientMessage(id, COLOR_YELLOW, string);
  2240. return 1;
  2241. }
  2242.  
  2243. CMD:destroycar(playerid, params[])
  2244. {
  2245. LoginCheck(playerid);
  2246. LevelCheck(playerid, 3);
  2247. DelVehicle(GetPlayerVehicleID(playerid));
  2248. return 1;
  2249. }
  2250.  
  2251. CMD:teleplayer(playerid, params[])
  2252. {
  2253. LoginCheck(playerid);
  2254. LevelCheck(playerid, 3);
  2255.  
  2256. new
  2257. string[128],
  2258. id,
  2259. id2,
  2260. Float:x,
  2261. Float:y,
  2262. Float:z
  2263. ;
  2264. if(sscanf(params, "uu", id, id2)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /teleplayer [playerid] to [playerid2]");
  2265. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  2266. if(User[playerid][accountAdmin] < User[id2][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  2267. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  2268. if(id2 == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  2269. if(id == playerid && id2 == playerid) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot teleport yourself to yourself!");
  2270. GetPlayerPos(id2, x, y, z);
  2271. format(string, sizeof(string), "You have teleported Player %s(%d) to Player %s(%d)", pName(id), id, pName(id2), id2);
  2272. SendClientMessage(playerid, COLOR_YELLOW, string);
  2273. format(string, sizeof(string), "You have been teleported to Player %s(%d) by Admin %s(%d)", pName(id2), id2, pName(playerid), playerid);
  2274. SendClientMessage(id, COLOR_YELLOW, string);
  2275. format(string, sizeof(string), "Admin %s(%d) has port %s(%d) to you", pName(playerid), playerid, pName(id), id);
  2276. SendClientMessage(id2, COLOR_YELLOW, string);
  2277. SetPlayerInterior(id, GetPlayerInterior(id2));
  2278. SetPlayerVirtualWorld(id, GetPlayerVirtualWorld(id2));
  2279. if(GetPlayerState(id) == 2)
  2280. {
  2281. SetVehiclePos(GetPlayerVehicleID(id), x+3, y, z);
  2282. LinkVehicleToInterior(GetPlayerVehicleID(id), GetPlayerInterior(id2));
  2283. SetVehicleVirtualWorld(GetPlayerVehicleID(id), GetPlayerVirtualWorld(id2));
  2284. }
  2285. else SetPlayerPos(id, x+2, y, z);
  2286. return 1;
  2287. }
  2288.  
  2289. CMD:god(playerid, params[])
  2290. {
  2291. LoginCheck(playerid);
  2292. LevelCheck(playerid, 3);
  2293.  
  2294. if(_God[playerid] == 0)
  2295. {
  2296. //Removal of the weapons has been made.
  2297. SendClientMessage(playerid, COLOR_GREEN, "God Mode On!");
  2298. _God[playerid] = 1;
  2299. }
  2300. else if(_God[playerid] == 1)
  2301. {
  2302. _God[playerid] = 0;
  2303. SendClientMessage(playerid, COLOR_RED, "God Mode Off!");
  2304. SetPlayerHealth(playerid, 100.0);
  2305. }
  2306. return 1;
  2307. }
  2308.  
  2309. CMD:armourall(playerid, params[])
  2310. {
  2311. LoginCheck(playerid);
  2312. LevelCheck(playerid, 3);
  2313.  
  2314. new
  2315. string[130]
  2316. ;
  2317. foreach(new i : Player)
  2318. {
  2319. if(i != playerid)
  2320. {
  2321. SetPlayerArmour(i, 100.0);
  2322. }
  2323. }
  2324. format(string, sizeof(string), "Admin %s(ID:%d) has given everyone an armour.", pName(playerid), playerid);
  2325. SendClientMessageToAll(COLOR_YELLOW, string);
  2326. return 1;
  2327. }
  2328.  
  2329. CMD:bankrupt(playerid, params[])
  2330. {
  2331. LoginCheck(playerid);
  2332. LevelCheck(playerid, 3);
  2333.  
  2334. new
  2335. id,
  2336. string[130]
  2337. ;
  2338.  
  2339. if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /bankrupt [playerid]");
  2340. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  2341. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  2342.  
  2343. ResetPlayerMoney(id);
  2344.  
  2345. format(string, sizeof(string), "Admin %s(ID:%d) has taken all your cash in-hand.", pName(playerid), playerid);
  2346. SendClientMessage(id, COLOR_YELLOW, string);
  2347. format(string, sizeof(string), "You have taken all the money in hand of Player %s(%d).", pName(id), id);
  2348. SendClientMessage(playerid, COLOR_YELLOW, string);
  2349. return 1;
  2350. }
  2351.  
  2352. CMD:getall(playerid, params[])
  2353. {
  2354. LoginCheck(playerid);
  2355. LevelCheck(playerid, 3);
  2356.  
  2357. new Float:x,
  2358. Float:y,
  2359. Float:z,
  2360. string[130],
  2361. interior = GetPlayerInterior(playerid)
  2362. ;
  2363.  
  2364. GetPlayerPos(playerid, x, y, z);
  2365. foreach(new i : Player)
  2366. {
  2367. if(i != playerid)
  2368. {
  2369. PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
  2370. SetPlayerPos(i, x+(playerid/4)+1, y+(playerid/4), z);
  2371. SetPlayerInterior(i, interior);
  2372. SetPlayerVirtualWorld(i, GetPlayerVirtualWorld(playerid));
  2373. }
  2374. }
  2375.  
  2376. format(string, sizeof(string), "Admin %s(ID:%d) has teleported all players to his or HER position!", pName(playerid), playerid);
  2377. SendClientMessageToAll(COLOR_YELLOW, string);
  2378. return 1;
  2379. }
  2380.  
  2381. CMD:freeze(playerid, params[])
  2382. {
  2383. LoginCheck(playerid);
  2384. LevelCheck(playerid, 3);
  2385.  
  2386. new
  2387. string[130],
  2388. id,
  2389. reason[128]
  2390. ;
  2391. if(sscanf(params, "uS(No Reason)[128]", id, reason)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /freeze [playerid] [reason]");
  2392. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  2393. if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot freeze yourself.");
  2394. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  2395.  
  2396. TogglePlayerControllable(id, false);
  2397.  
  2398. format(string, sizeof(string), "You have frozen Player %s(%d) (Reason: %s)", pName(id), id, reason);
  2399. SendClientMessage(playerid, COLOR_YELLOW, string);
  2400. format(string, sizeof(string), "Administrator %s(ID:%d) has frozen you (Reason: %s)", pName(playerid), playerid, reason);
  2401. SendClientMessage(id, COLOR_YELLOW, string);
  2402. return 1;
  2403. }
  2404.  
  2405. CMD:unfreeze(playerid, params[])
  2406. {
  2407. LoginCheck(playerid);
  2408. LevelCheck(playerid, 3);
  2409.  
  2410. new
  2411. string[128],
  2412. id
  2413. ;
  2414.  
  2415. if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /unfreeze [playerid]");
  2416. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  2417. if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot unfreeze yourself.");
  2418. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  2419.  
  2420. TogglePlayerControllable(id, true);
  2421.  
  2422. format(string, sizeof(string), "You have unfrozen Player %s(%d)", pName(id), id);
  2423. SendClientMessage(playerid, COLOR_YELLOW, string);
  2424. format(string, sizeof(string), "Admin %s(%d) has unfrozen you.", pName(playerid), playerid);
  2425. SendClientMessage(id, COLOR_YELLOW, string);
  2426. return 1;
  2427. }
  2428.  
  2429. CMD:giveweapon(playerid, params[])
  2430. {
  2431. LoginCheck(playerid);
  2432. LevelCheck(playerid, 3);
  2433.  
  2434. new
  2435. id,
  2436. ammo,
  2437. wID[32],
  2438. weap,
  2439. WeapName[32],
  2440. string[130]
  2441. ;
  2442.  
  2443. if(sscanf(params, "us[32]i", id, wID, ammo)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /giveweapon [playerid] [weaponid(or weapon name)] [ammo]");
  2444. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  2445. if(ammo <= 0 || ammo > 99999) ammo = 500;
  2446. if(!isnumeric(wID)) weap = GetWeaponIDFromName(wID);
  2447. else weap = strval(wID);
  2448. if(!IsValidWeapon(weap)) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Invalid Weapon ID.");
  2449. GetWeaponName(weap, WeapName, 32);
  2450.  
  2451. format(string, sizeof(string), "You gave a %s(%d) with %d rounds of ammunation to %s.", WeapName, weap, ammo, pName(id));
  2452. SendClientMessage(playerid, COLOR_YELLOW, string);
  2453. format(string,sizeof(string),"Administrator %s has given you a %s(%d) with %d rounds of ammunation.", pName(playerid), WeapName, weap, ammo);
  2454. SendClientMessage(id, COLOR_YELLOW, string);
  2455. GivePlayerWeapon(id, weap, ammo);
  2456. return 1;
  2457. }
  2458.  
  2459. CMD:unban(playerid, params[])
  2460. {
  2461. LoginCheck(playerid);
  2462. LevelCheck(playerid, 3);
  2463.  
  2464. new
  2465. string[150],
  2466. Account[24],
  2467. DBResult:Result,
  2468. Query[129],
  2469. fIP[30]
  2470. ;
  2471. if(sscanf(params, "s[24]", Account)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /unban [account name]");
  2472. format(Query, 129, "SELECT * FROM `bans` WHERE `username` = '%s'", Account);
  2473. Result = db_query(Database, Query);
  2474.  
  2475. if(db_num_rows(Result))
  2476. {
  2477. db_get_field_assoc(Result, "ip", fIP, 30);
  2478.  
  2479. format(Query, 129, "DELETE FROM `bans` WHERE `username` = '%s'", Account);
  2480. Result = db_query(Database, Query);
  2481. db_free_result(Result);
  2482.  
  2483. format(string, sizeof string, "Administrator %s has unbanned %s.", pName(playerid), Account);
  2484. SendClientMessageToAll(COLOR_YELLOW, string);
  2485. print(string);
  2486.  
  2487. #if LOG == true
  2488. SaveLog("banlog.txt", string);
  2489. #endif
  2490. }
  2491. else
  2492. {
  2493. db_free_result(Result);
  2494. SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player is not in the banned database.");
  2495. return 1;
  2496. }
  2497. return 1;
  2498. }
  2499.  
  2500. CMD:ban(playerid, params[])
  2501. {
  2502. LoginCheck(playerid);
  2503. LevelCheck(playerid, 3);
  2504.  
  2505. new
  2506. string[128],
  2507. id,
  2508. reason[128],
  2509. when[128],
  2510. ban_hr, ban_min, ban_sec, ban_month, ban_days, ban_years
  2511. ;
  2512.  
  2513. gettime(ban_hr, ban_min, ban_sec);
  2514. getdate(ban_years, ban_month, ban_days);
  2515.  
  2516. if(sscanf(params, "uS(No Reason)[128]", id, reason)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /ban [playerid] [reason(Default: No Reason)]");
  2517. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  2518. if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command to yourself.");
  2519. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  2520.  
  2521. format(when, 128, "%02d/%02d/%d %02d:%02d:%02d", ban_month, ban_days, ban_years, ban_hr, ban_min, ban_sec);
  2522.  
  2523. format(string, sizeof(string), "** %s(ID:%d) has been banned by Administrator %s(%d) (Reason: %s)", pName(id), id, pName(playerid), playerid, reason);
  2524. SendClientMessageToAll(COLOR_GREY, string);
  2525. printf(string);
  2526. #if LOG == true
  2527. SaveLog("banlog.txt", string);
  2528. #endif
  2529. format(string, sizeof(string), "You have banned %s(%d) for %s.", pName(id), id, reason);
  2530. SendClientMessage(playerid, COLOR_YELLOW, string);
  2531. format(string, sizeof(string), "You have been banned by Administrator %s(%d) (Reason: %s)", pName(playerid), playerid, reason);
  2532. SendClientMessage(id, COLOR_YELLOW, string);
  2533. BanAccount(id, pName(playerid), reason);
  2534. ShowBan(id, pName(playerid), reason, when);
  2535. KickDelay(id);
  2536. return 1;
  2537. }
  2538.  
  2539. CMD:oban(playerid, params[])
  2540. {
  2541. LoginCheck(playerid);
  2542. LevelCheck(playerid, 3);
  2543.  
  2544. new
  2545. string[150],
  2546. name[24],
  2547. reason[128],
  2548. Query[256],
  2549. admin,
  2550. ip[20],
  2551. DBResult:Result,
  2552. ban_hr, ban_min, ban_sec, ban_month, ban_days, ban_years
  2553. ;
  2554.  
  2555. gettime(ban_hr, ban_min, ban_sec);
  2556. getdate(ban_years, ban_month, ban_days);
  2557.  
  2558. if(sscanf(params, "s[24]s[128]", name, reason)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /oban [name in the data] [reason]");
  2559. foreach(new i : Player)
  2560. {
  2561. if(strcmp(pName(i), name, true) == 0)
  2562. {
  2563. SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player that you are trying to banned is online, /ban instead.");
  2564. return 1;
  2565. }
  2566. }
  2567. format(Query, sizeof(Query), "SELECT * FROM `users` WHERE `username` = '%s'", DB_Escape(name));
  2568. Result = db_query(Database, Query);
  2569. if(db_num_rows(Result))
  2570. {
  2571. db_get_field_assoc(Result, "admin", Query, 6);
  2572. admin = strval(Query);
  2573. db_get_field_assoc(Result, "IP", ip, 20);
  2574.  
  2575. if(User[playerid][accountAdmin] < admin)
  2576. {
  2577. SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on high ranking admin.");
  2578.  
  2579. #if LOG == true
  2580. format(string, sizeof(string), "%s has attempted to offline banned %s but failed for %s", pName(playerid), name, reason);
  2581. SaveLog("admin.txt", string);
  2582. #endif
  2583. return 1;
  2584. }
  2585.  
  2586. BanAccountEx(name, ip, pName(playerid), reason);
  2587.  
  2588. format(string, sizeof(string), "** %s has been offine banned by Administrator %s(%d) (Reason: %s)", name, pName(playerid), playerid, reason);
  2589. SendClientMessageToAll(COLOR_GREY, string);
  2590. printf(string);
  2591. #if LOG == true
  2592. SaveLog("banlog.txt", string);
  2593. #endif
  2594. }
  2595. else
  2596. {
  2597. SendClientMessage(playerid, COLOR_RED, "Syntax Error: There is no such thing players in the server database.");
  2598. }
  2599. db_free_result(Result);
  2600. return 1;
  2601. }
  2602.  
  2603. CMD:cname(playerid, params[])
  2604. {
  2605. LoginCheck(playerid);
  2606. LevelCheck(playerid, 3);
  2607.  
  2608. new
  2609. string[128],
  2610. id,
  2611. newname[24]
  2612. ;
  2613.  
  2614. if(sscanf(params, "us[24]", id, newname)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /cname [playerid] [new name]");
  2615. if(strlen(newname) < 3 || strlen(newname) > MAX_PLAYER_NAME) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Invalid Name Length.");
  2616. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  2617. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  2618.  
  2619. /*
  2620. DO NOT PLACE THESE CODES BELOW SETPLAYERNAME OR IT WILL BUGGED OUT.
  2621. */
  2622. //Saves the datas you current have on that account.
  2623. SaveData(id);
  2624. //Logs you out.
  2625. User[id][accountLogged] = false;
  2626.  
  2627. #if LOG == true
  2628. format(string, sizeof string, "Administrator %s has set %s's name to %s", pName(playerid), pName(id), newname);
  2629. SaveLog("account.txt", string);
  2630. #endif
  2631.  
  2632. format(string, sizeof(string), "You have set \"%s's\" name to \"%s\".", pName(id), newname); SendClientMessage(playerid, COLOR_YELLOW, string);
  2633. format(string, sizeof(string), "Administrator \"%s\" has set your name to \"%s\".", pName(playerid), newname); SendClientMessage(id, COLOR_YELLOW, string);
  2634. SetPlayerName(id, newname);
  2635.  
  2636. SendClientMessage(id, -1, "You have been logged out from your current account, Reconnecting to the server...");
  2637.  
  2638. //Reads all the codes from the callback OnPlayerConnect.
  2639. SetPlayerScore(id, 0);
  2640. ResetPlayerMoney(id);
  2641. OnPlayerConnect(id);
  2642. return 1;
  2643. }
  2644.  
  2645. CMD:slap(playerid, params[])
  2646. {
  2647. LoginCheck(playerid);
  2648. LevelCheck(playerid, 3);
  2649.  
  2650. new
  2651. Float:x,
  2652. Float:y,
  2653. Float:z,
  2654. Float:health,
  2655. string[128],
  2656. id,
  2657. reason[128]
  2658. ;
  2659.  
  2660. if(sscanf(params, "uS(N/A)[128]", id, reason)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /slap [playerid] [reason(Default: N/A)]");
  2661. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  2662. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  2663. GetPlayerPos(id, x, y, z);
  2664. GetPlayerHealth(id, health);
  2665. SetPlayerHealth(id, health-25);
  2666. SetPlayerPos(id, x, y, z+5);
  2667. PlayerPlaySound(playerid, 1190, 0.0, 0.0, 0.0);
  2668. PlayerPlaySound(id, 1190, 0.0, 0.0, 0.0);
  2669. format(string, sizeof(string), "** %s(%d) has been slapped by Administrator %s [Reason: %s]", pName(id), id, pName(playerid), reason);
  2670. SendClientMessageToAll(COLOR_GREY, string);
  2671. return 1;
  2672. }
  2673.  
  2674. CMD:setcolor(playerid, params[])
  2675. {
  2676. LoginCheck(playerid);
  2677. LevelCheck(playerid, 3);
  2678.  
  2679. new id;
  2680. if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /setcolor [playerid]");
  2681. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  2682. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  2683.  
  2684. SetPVarInt(playerid, "_Colors_", id);
  2685.  
  2686. SD(playerid, DIALOG_COLORS, DL, ""orange"Colors", ""black"Black\n"white"White\n"red"Red\n"orange"Orange\n"yellow"Yellow\n"green"Green\n"blue"Blue\n"purple"Purple\n"brown"Brown\n"pink"Pink", "Set", "Cancel");
  2687. return 1;
  2688. }
  2689.  
  2690. CMD:setmoney(playerid, params[])
  2691. {
  2692. LoginCheck(playerid);
  2693. LevelCheck(playerid, 3);
  2694.  
  2695. new
  2696. id,
  2697. string[128],
  2698. amount
  2699. ;
  2700.  
  2701. if(sscanf(params, "ui", id, amount)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /setmoney [playerid] [cash]");
  2702. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  2703. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  2704.  
  2705. ResetPlayerMoney(id);
  2706. GivePlayerMoney(id, amount);
  2707. format(string, sizeof(string), "You have set %s's cash to $%i.", pName(id), amount);
  2708. SendClientMessage(playerid, COLOR_YELLOW, string);
  2709. format(string, sizeof(string), "Administrator %s has set your cash to $%i.", pName(playerid), amount);
  2710. SendClientMessage(id, COLOR_YELLOW, string);
  2711.  
  2712. #if LOG == true
  2713. format(string, sizeof string, "Administrator %s has set %s's cash to $%i", pName(playerid), pName(id), amount);
  2714. SaveLog("set.txt", string);
  2715. #endif
  2716. return 1;
  2717. }
  2718.  
  2719. CMD:setscore(playerid, params[])
  2720. {
  2721. LoginCheck(playerid);
  2722. LevelCheck(playerid, 3);
  2723.  
  2724. new
  2725. id,
  2726. string[128],
  2727. amount
  2728. ;
  2729.  
  2730. if(sscanf(params, "ui", id, amount)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /setscore [playerid] [score]");
  2731. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  2732. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  2733.  
  2734. SetPlayerScore(id, amount);
  2735. format(string, sizeof(string), "You have set %s's score to %i.", pName(id), amount);
  2736. SendClientMessage(playerid, COLOR_YELLOW, string);
  2737. format(string, sizeof(string), "Administrator %s has set your score to %i.", pName(playerid), amount);
  2738. SendClientMessage(id, COLOR_YELLOW, string);
  2739.  
  2740. #if LOG == true
  2741. format(string, sizeof string, "Administrator %s has set %s's score to %i", pName(playerid), pName(id), amount);
  2742. SaveLog("set.txt", string);
  2743. #endif
  2744. return 1;
  2745. }
  2746.  
  2747. //============================================================================//
  2748. // Administrative Level Four //
  2749. //============================================================================//
  2750.  
  2751. CMD:gmx(playerid, params[])
  2752. {
  2753. new
  2754. string[128],
  2755. time
  2756. ;
  2757.  
  2758. LoginCheck(playerid);
  2759. LevelCheck(playerid, 4);
  2760.  
  2761. if(sscanf(params, "I(0)", time)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /gmx [Restart Timer(optional)") &&
  2762. SendClientMessage(playerid, -1, "Note: You can leave the parameter for a fast restart, no timers.");
  2763.  
  2764. if(time < 10 && time !=0) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Restart Time shouldn't go below ten.");
  2765.  
  2766. if(time >= 10)
  2767. {
  2768. format(string, sizeof(string), "Admin %s(ID:%d) has announced a server restart which will end in %d seconds.", pName(playerid), playerid, time);
  2769. SendClientMessageToAll(COLOR_YELLOW, string);
  2770.  
  2771. SetTimer("RestartTimer", 1000*time, false);
  2772. }
  2773. else
  2774. {
  2775. format(string, sizeof(string), "Admin %s(ID:%d) has restarted the server.", pName(playerid), playerid);
  2776. SendClientMessageToAll(COLOR_YELLOW, string);
  2777.  
  2778. SendRconCommand("gmx");
  2779. }
  2780. return 1;
  2781. }
  2782.  
  2783. function:RestartTimer()
  2784. {
  2785. SendClientMessageToAll(COLOR_YELLOW, "Restart Time has been reached, Restarting the server now.");
  2786. return SendRconCommand("gmx");
  2787. }
  2788.  
  2789. CMD:fakedeath(playerid, params[])
  2790. {
  2791. new
  2792. string[128],
  2793. id,
  2794. killerid,
  2795. weapid
  2796. ;
  2797.  
  2798. LoginCheck(playerid);
  2799. LevelCheck(playerid, 4);
  2800.  
  2801. if(sscanf(params, "uui", killerid, id, weapid)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /fakedeath [killer] [victim] [weapon]");
  2802. if(killerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: KillerID not connected.");
  2803. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: VictimID not connected.");
  2804. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  2805. if(User[playerid][accountAdmin] < User[killerid][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  2806. if(id == playerid && killerid == playerid) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You can't be KillerID and VictimID at the same time.");
  2807. if(!IsValidWeapon(weapid)) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Invalid Weapon ID.");
  2808.  
  2809. SendDeathMessage(killerid, id, weapid);
  2810.  
  2811. format(string, sizeof(string), "Fake Death Sent. [ Victim: %s(%d) | Suspect: %s(%d) | WeaponID: %i ]", pName(id), id, pName(killerid), killerid, weapid);
  2812. SendClientMessage(playerid, COLOR_YELLOW, string);
  2813. return 1;
  2814. }
  2815.  
  2816. CMD:setallskin(playerid, params[])
  2817. {
  2818. new string[128+40], skin;
  2819.  
  2820. LoginCheck(playerid);
  2821. LevelCheck(playerid, 4);
  2822.  
  2823. if(sscanf(params, "i", skin)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /setallskin [skin(0-299)]");
  2824. if(skin < 0 || skin == 74 || skin > 299) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Invalid skinID.");
  2825.  
  2826. foreach(new i : Player)
  2827. {
  2828. SetPlayerSkin(i, skin);
  2829. }
  2830.  
  2831. format(string, sizeof(string), "Admin %s(ID:%d) has set everyones skin to %d.", pName(playerid), playerid, skin);
  2832. SendClientMessageToAll(COLOR_YELLOW, string);
  2833. return 1;
  2834. }
  2835.  
  2836. CMD:cmdmuted(playerid, params[])
  2837. {
  2838. new string[128], count = 0;
  2839.  
  2840. SendClientMessage(playerid, -1, "** "orange"Command Muted Players "white"**");
  2841. foreach(new i : Player)
  2842. {
  2843. if(User[i][accountLogged] == true)
  2844. {
  2845. if(User[i][accountCMuted] == 1)
  2846. {
  2847. format(string, sizeof(string), "(%d) %s - Seconds left %d", i, pName(i), User[i][accountCMuteSec]);
  2848. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  2849. count++;
  2850. }
  2851. }
  2852. }
  2853. if(count == 0) return SendClientMessage(playerid, -1, "No command muted players at the server.");
  2854. return 1;
  2855. }
  2856.  
  2857. CMD:mutecmd(playerid, params[])
  2858. {
  2859. LoginCheck(playerid);
  2860. LevelCheck(playerid, 4);
  2861.  
  2862. new id, sec, reason[128], string[250];
  2863. if(sscanf(params, "uiS(None)[128]", id, sec, reason)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /mutecmd [playerid] [seconds] [reason]");
  2864. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  2865. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  2866. if(sec < 30) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot mute lower than 30 seconds.");
  2867. if(User[id][accountCMuted] == 1) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player already muted from using the commands.");
  2868. if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on yourself.");
  2869.  
  2870. format(string, sizeof(string), "** %s(%d) has been muted from using commands by Administrator %s(%d) for %d seconds [%s]", pName(id), id, pName(playerid), playerid, sec, reason);
  2871. SendClientMessageToAll(COLOR_GREY, string);
  2872. SendClientMessage(id, COLOR_ORANGE, "You have been muted from using commands by an Admin, Press a screenshot (F8) and make a complaint on the forums, if you want to.");
  2873.  
  2874. #if LOG == true
  2875. format(string, sizeof(string), "%s has been muted from using commands by %s (%d seconds, reason %s)", pName(id), pName(playerid), sec, reason);
  2876. SaveLog("mute.txt", string);
  2877. #endif
  2878.  
  2879. User[id][accountCMuted] = 1, User[id][accountCMuteSec] = sec;
  2880. return 1;
  2881. }
  2882.  
  2883. CMD:unmutecmd(playerid, params[])
  2884. {
  2885. LoginCheck(playerid);
  2886. LevelCheck(playerid, 4);
  2887.  
  2888. new id, reason[128], string[250];
  2889. if(sscanf(params, "uS(None)[128]", id, reason)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /unmutecmd [playerid] [reason]");
  2890. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  2891. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  2892. if(User[id][accountCMuted] == 0) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not muted from using the commands.");
  2893. if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on yourself.");
  2894.  
  2895. format(string, sizeof(string), "* %s(%d) has been unmuted from using commands by Administrator %s(%d) for %s", pName(id), id, pName(playerid), playerid, reason);
  2896. SendClientMessageToAll(COLOR_GREY, string);
  2897. SendClientMessage(id, COLOR_ORANGE, "You have been unmuted from using commands by an Admin.");
  2898.  
  2899. #if LOG == true
  2900. format(string, sizeof(string), "%s has been unmuted from using commands by %s", pName(id), pName(playerid));
  2901. SaveLog("mute.txt", string);
  2902. #endif
  2903.  
  2904. User[id][accountCMuted] = 0, User[id][accountCMuteSec] = 0;
  2905. return 1;
  2906. }
  2907.  
  2908. CMD:setallinterior(playerid, params[])
  2909. {
  2910. LoginCheck(playerid);
  2911. LevelCheck(playerid, 4);
  2912.  
  2913. new
  2914. id,
  2915. string[130]
  2916. ;
  2917. if(sscanf(params, "i", id)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /setallinterior [interior]");
  2918. foreach(new i : Player)
  2919. {
  2920. PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
  2921. SetPlayerInterior(i, id);
  2922. }
  2923. format(string, sizeof(string), "Admin %s(ID:%d) has set all players interior to \"%d\"", pName(playerid), playerid, id);
  2924. SendClientMessageToAll(COLOR_YELLOW, string);
  2925. return 1;
  2926. }
  2927.  
  2928. CMD:explodeall(playerid, params[])
  2929. {
  2930. LoginCheck(playerid);
  2931. LevelCheck(playerid, 4);
  2932.  
  2933. new
  2934. string[130],
  2935. Float:x,
  2936. Float:y,
  2937. Float:z
  2938. ;
  2939.  
  2940. foreach(new i : Player)
  2941. {
  2942. if(i != playerid)
  2943. {
  2944. GetPlayerPos(i, x, y, z);
  2945. CreateExplosion(x, y, z, 7, 1.00);
  2946. }
  2947. }
  2948.  
  2949. format(string, sizeof(string), "Admin %s(ID:%d) has exploded all players.", pName(playerid), playerid);
  2950. SendClientMessageToAll(COLOR_YELLOW, string);
  2951. printf(string);
  2952. return 1;
  2953. }
  2954.  
  2955. CMD:killall(playerid, params[])
  2956. {
  2957. LoginCheck(playerid);
  2958. LevelCheck(playerid, 4);
  2959.  
  2960. new
  2961. string[130]
  2962. ;
  2963.  
  2964. foreach(new i : Player)
  2965. {
  2966. if(i != playerid)
  2967. {
  2968. if(_God[i] == 1)
  2969. {
  2970. _God[i] = 0;
  2971. }
  2972. SetPlayerHealth(i, 0.0);
  2973. }
  2974. }
  2975.  
  2976. format(string, sizeof(string), "Admin %s(ID:%d) has killed all players.", pName(playerid), playerid);
  2977. SendClientMessageToAll(COLOR_YELLOW, string);
  2978. printf(string);
  2979. return 1;
  2980. }
  2981.  
  2982. CMD:slapall(playerid, params[])
  2983. {
  2984. LoginCheck(playerid);
  2985. LevelCheck(playerid, 4);
  2986.  
  2987. new
  2988. string[130],
  2989. Float:x,
  2990. Float:y,
  2991. Float:z,
  2992. Float:health
  2993. ;
  2994.  
  2995. foreach(new i : Player)
  2996. {
  2997. if(i != playerid)
  2998. {
  2999. GetPlayerPos(i, x, y, z);
  3000. GetPlayerHealth(i, health);
  3001. SetPlayerHealth(i, health-25);
  3002. SetPlayerPos(i, x, y, z+5);
  3003. PlayerPlaySound(playerid, 1190, 0.0, 0.0, 0.0);
  3004. PlayerPlaySound(i, 1190, 0.0, 0.0, 0.0);
  3005. }
  3006. }
  3007.  
  3008. format(string, sizeof(string), "Admin %s(ID:%d) has slapped all players.", pName(playerid), playerid);
  3009. SendClientMessageToAll(COLOR_YELLOW, string);
  3010. printf(string);
  3011. return 1;
  3012. }
  3013.  
  3014. CMD:kickall(playerid, params[])
  3015. {
  3016. LoginCheck(playerid);
  3017. LevelCheck(playerid, 4);
  3018.  
  3019. new
  3020. string[130]
  3021. ;
  3022.  
  3023. foreach(new i : Player)
  3024. {
  3025. if(i != playerid)
  3026. {
  3027. KickDelay(i);
  3028. }
  3029. }
  3030.  
  3031. format(string, sizeof(string), "Admin %s(ID:%d) has kicked all players.", pName(playerid), playerid);
  3032. SendClientMessageToAll(COLOR_YELLOW, string);
  3033. printf(string);
  3034. #if LOG == true
  3035. SaveLog("kicklog.txt", string);
  3036. #endif
  3037. return 1;
  3038. }
  3039.  
  3040. CMD:ejectall(playerid, params[])
  3041. {
  3042. LoginCheck(playerid);
  3043. LevelCheck(playerid, 4);
  3044.  
  3045. new
  3046. string[128]
  3047. ;
  3048.  
  3049. foreach(new i : Player)
  3050. {
  3051. if(IsPlayerInAnyVehicle(i))
  3052. {
  3053. RemovePlayerFromVehicle(i);
  3054. }
  3055. }
  3056. format(string, sizeof(string), "Admin %s(ID:%d) has eject all players from their vehicle.", pName(playerid), playerid);
  3057. SendClientMessageToAll(COLOR_YELLOW, string);
  3058. return 1;
  3059. }
  3060.  
  3061. CMD:disarmall(playerid, params[])
  3062. {
  3063. LoginCheck(playerid);
  3064. LevelCheck(playerid, 4);
  3065.  
  3066. new
  3067. string[128]
  3068. ;
  3069.  
  3070. foreach(new i : Player)
  3071. {
  3072. ResetPlayerWeapons(i);
  3073. }
  3074. format(string, sizeof(string), "Admin %s(ID:%d) has remove all players weapon.", pName(playerid), playerid);
  3075. SendClientMessageToAll(COLOR_YELLOW, string);
  3076. return 1;
  3077. }
  3078.  
  3079. CMD:setallworld(playerid, params[])
  3080. {
  3081. LoginCheck(playerid);
  3082. LevelCheck(playerid, 4);
  3083.  
  3084. new
  3085. id,
  3086. string[130]
  3087. ;
  3088. if(sscanf(params, "i", id)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /setallworld [world]");
  3089. foreach(new i : Player)
  3090. {
  3091. PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
  3092. SetPlayerVirtualWorld(i, id);
  3093. }
  3094. format(string, sizeof(string), "Admin %s(ID:%d) has set all players virtual world to \"%d\"", pName(playerid), playerid, id);
  3095. SendClientMessageToAll(COLOR_YELLOW, string);
  3096. return 1;
  3097. }
  3098.  
  3099. CMD:giveallscore(playerid, params[])
  3100. {
  3101. LoginCheck(playerid);
  3102. LevelCheck(playerid, 4);
  3103.  
  3104. new
  3105. id,
  3106. string[130]
  3107. ;
  3108. if(sscanf(params, "i", id)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /giveallscore [score]");
  3109. foreach(new i : Player)
  3110. {
  3111. if(i != playerid)
  3112. {
  3113. PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
  3114. SetPlayerScore(i, GetPlayerScore(i) + id);
  3115. }
  3116. }
  3117.  
  3118. format(string, sizeof(string), "Admin %s(ID:%d) has given all players score \"%d\"", pName(playerid), playerid, id);
  3119. SendClientMessageToAll(COLOR_YELLOW, string);
  3120. return 1;
  3121. }
  3122.  
  3123. CMD:giveallcash(playerid, params[])
  3124. {
  3125. LoginCheck(playerid);
  3126. LevelCheck(playerid, 4);
  3127.  
  3128. new
  3129. id,
  3130. string[130]
  3131. ;
  3132. if(sscanf(params, "i", id)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /giveallcash [money]");
  3133. foreach(new i : Player)
  3134. {
  3135. if(i != playerid)
  3136. {
  3137. PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
  3138. GivePlayerMoney(i, id);
  3139. }
  3140. }
  3141.  
  3142. format(string, sizeof(string), "Admin %s(ID:%d) has given all players cash \"$%d\"", pName(playerid), playerid, id);
  3143. SendClientMessageToAll(COLOR_YELLOW, string);
  3144. return 1;
  3145. }
  3146.  
  3147. CMD:setalltime(playerid, params[])
  3148. {
  3149. LoginCheck(playerid);
  3150. LevelCheck(playerid, 4);
  3151.  
  3152. new
  3153. id,
  3154. string[128]
  3155. ;
  3156.  
  3157. if(sscanf(params, "i", id)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /setalltime [time(0-23)]");
  3158. if(id < 0 || id > 23) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Invalid Time Hour (0-23).");
  3159. foreach(new i : Player)
  3160. {
  3161. PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
  3162. SetPlayerTime(i, id, 0);
  3163. }
  3164.  
  3165. format(string, sizeof(string), "Admin %s(ID:%d) has set all players time to \"%d:00\"", pName(playerid), playerid, id);
  3166. SendClientMessageToAll(COLOR_YELLOW, string);
  3167. return 1;
  3168. }
  3169.  
  3170. CMD:setallweather(playerid, params[])
  3171. {
  3172. LoginCheck(playerid);
  3173. LevelCheck(playerid, 4);
  3174.  
  3175. new
  3176. id,
  3177. string[128]
  3178. ;
  3179. if(sscanf(params, "i", id)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /setallweather [weather(0-45)]");
  3180. if(id < 0 || id > 45) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Invalid Weather ID! (0-45)");
  3181. foreach(new i : Player)
  3182. {
  3183. PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
  3184. SetPlayerWeather(i, id);
  3185. }
  3186. format(string, sizeof(string), "Admin %s(ID:%d) has set all players weather to \"%d\"", pName(playerid), playerid, id);
  3187. SendClientMessageToAll(COLOR_YELLOW, string);
  3188. return 1;
  3189. }
  3190.  
  3191. CMD:respawncars(playerid, params[])
  3192. {
  3193. LoginCheck(playerid);
  3194. LevelCheck(playerid, 4);
  3195.  
  3196. SendClientMessage(playerid, COLOR_GREEN, "You have successfully Respawned all Vehicles!");
  3197. GameTextForAll("~n~~n~~n~~n~~n~~n~~r~Vehicles ~g~Respawned!", 3000, 3);
  3198. for(new cars=0; cars<MAX_VEHICLES; cars++)
  3199. {
  3200. if(!VehicleOccupied(cars))
  3201. {
  3202. SetVehicleToRespawn(cars);
  3203. }
  3204. }
  3205. return 1;
  3206. }
  3207.  
  3208. CMD:cleardwindow(playerid, params[])
  3209. {
  3210. LoginCheck(playerid);
  3211. LevelCheck(playerid, 4);
  3212.  
  3213. new
  3214. string[128]
  3215. ;
  3216.  
  3217. format(string, sizeof(string), "Administrator "orange"%s "white"has cleared the Death Window!", pName(playerid));
  3218. SendClientMessageToAll(-1, string);
  3219. for(new i = 0; i < 20; i++) SendDeathMessage(6000, 5005, 255);
  3220. return 1;
  3221. }
  3222.  
  3223. CMD:saveallstats(playerid, params[])
  3224. {
  3225. LoginCheck(playerid);
  3226. LevelCheck(playerid, 4);
  3227.  
  3228. new
  3229. string[130]
  3230. ;
  3231.  
  3232. format(string, sizeof string, "Administrator "orange"%s "white"has saved all player's data.", pName(playerid));
  3233. SendClientMessageToAll(-1, string);
  3234. foreach(new i : Player)
  3235. {
  3236. if(User[i][accountLogged] == true)
  3237. {
  3238. SaveData(i);
  3239. }
  3240. }
  3241.  
  3242. #if LOG == true
  3243. format(string, sizeof string, "Administrator %s has saved all player's data.", pName(playerid));
  3244. SaveLog("account.txt", string);
  3245. #endif
  3246. return 1;
  3247. }
  3248.  
  3249. CMD:giveallweapon(playerid, params[])
  3250. {
  3251. LoginCheck(playerid);
  3252. LevelCheck(playerid, 4);
  3253.  
  3254. new
  3255. ammo,
  3256. wID[32],
  3257. weap,
  3258. WeapName[32],
  3259. string[130]
  3260. ;
  3261. if(sscanf(params, "s[32]i", wID, ammo)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /giveallweapon [weaponid(or name)] [ammo]");
  3262. if(ammo <= 0 || ammo > 99999) ammo = 500;
  3263. if(!isnumeric(wID)) weap = GetWeaponIDFromName(wID);
  3264. else weap = strval(wID);
  3265. if(!IsValidWeapon(weap)) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Invalid Weapon ID");
  3266. GetWeaponName(weap, WeapName, 32);
  3267. foreach(new i : Player)
  3268. {
  3269. GivePlayerWeapon(i, weap, ammo);
  3270. format(string, sizeof string, "~g~%s for all!", WeapName);
  3271. GameTextForPlayer(i, string, 2500, 3);
  3272. }
  3273. format(string,sizeof(string), "Admin %s(ID:%d) has given all players a %s(%d) with %d rounds of ammo.", pName(playerid), playerid, WeapName, weap, ammo);
  3274. SendClientMessageToAll(COLOR_YELLOW, string);
  3275. return 1;
  3276. }
  3277.  
  3278. //============================================================================//
  3279. // Administrative Level Five //
  3280. //============================================================================//
  3281.  
  3282. CMD:makemegodadmin(playerid, params[])
  3283. {
  3284. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Only RCON can use this command.");
  3285. else
  3286. {
  3287. User[playerid][accountAdmin] = 5;
  3288. SendClientMessage(playerid, COLOR_GREEN, "You have set your administrative rank to level 5.");
  3289. }
  3290. return 1;
  3291. }
  3292.  
  3293. CMD:removeacc(playerid, params[])
  3294. {
  3295. LoginCheck(playerid);
  3296. LevelCheck(playerid, 5);
  3297.  
  3298. new
  3299. Account[MAX_PLAYER_NAME],
  3300. Reason[100],
  3301. string[128]
  3302. ;
  3303. if(sscanf(params, "s[24]s[100]", Account, Reason)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /removeacc [account name] [reason]");
  3304. if(DataExist(Account))
  3305. {
  3306. if(!strcmp(pName(playerid), Account, false))
  3307. return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot delete your own account!");
  3308.  
  3309. foreach(new i : Player)
  3310. {
  3311. if(strcmp(Account, pName(i), true) == 0)
  3312. {
  3313. SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player is online, fail to delete the account.");
  3314. return 1;
  3315. }
  3316. }
  3317.  
  3318. new Query[128+50];
  3319. format(Query, 100, "DELETE FROM `users` WHERE `username` = '%s'", Account);
  3320. db_query(Database, Query);
  3321. db_free_result(db_query(Database, Query));
  3322.  
  3323. format(string, 128, "Admin %s(ID: %d) has deleted %s's account [Reason: %s]", pName(playerid), playerid, Account, Reason);
  3324. SendClientMessageToAll(COLOR_YELLOW, string);
  3325. SaveLog("account.txt", string);
  3326.  
  3327. format(string, 128, "You have deleted %s's account [Reason: %s]", Account, Reason);
  3328. SendClientMessage(playerid, COLOR_YELLOW, string);
  3329. }
  3330. else
  3331. {
  3332. SendClientMessage(playerid, COLOR_RED, "Syntax Error: Account does not exist in the database!");
  3333. }
  3334. return 1;
  3335. }
  3336.  
  3337. CMD:fakecmd(playerid, params[])
  3338. {
  3339. new
  3340. string[128],
  3341. id,
  3342. cmdtext[128]
  3343. ;
  3344.  
  3345. LoginCheck(playerid);
  3346. LevelCheck(playerid, 5);
  3347.  
  3348. if(sscanf(params, "us[128]", id, cmdtext)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /fakecmd [playerid] [command]");
  3349. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  3350. if(strfind(params, "/", false) != -1)
  3351. {
  3352. CallRemoteFunction("OnPlayerCommandText", "is", id, cmdtext);
  3353. format(string, sizeof(string), "Fake command sent to %s with %s", pName(id), cmdtext);
  3354. SendClientMessage(playerid, COLOR_YELLOW, string);
  3355. }
  3356. else return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Add '/' before putting the command name to avoid the command unknown error.");
  3357. return 1;
  3358. }
  3359.  
  3360. CMD:fakechat(playerid, params[])
  3361. {
  3362. LoginCheck(playerid);
  3363. LevelCheck(playerid, 5);
  3364.  
  3365. new
  3366. string[130],
  3367. id,
  3368. text[128]
  3369. ;
  3370.  
  3371. if(sscanf(params, "us[128]", id, text)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /fakechat [playerid] [text]");
  3372. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  3373. format(string, sizeof(string), "You have faked chat %s with %s", pName(id), text);
  3374. SendClientMessage(playerid, COLOR_YELLOW, string);
  3375. SendPlayerMessageToAll(id, text);
  3376. return 1;
  3377. }
  3378.  
  3379. CMD:setlevel(playerid, params[])
  3380. {
  3381. new
  3382. string[128],
  3383. id,
  3384. level
  3385. ;
  3386.  
  3387. LoginCheck(playerid);
  3388. LevelCheck(playerid, 5);
  3389.  
  3390. if(sscanf(params, "ui", id, level)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /setlevel [playerid] [level(0/5)]");
  3391. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  3392. if(level < 0 || level > 5) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Levels shouldn't go below zero and shouldn't go above five.");
  3393. if(level == User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player is already in that level.");
  3394. if(User[id][accountLogged] == false) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not logged in.");
  3395.  
  3396. if(User[id][accountAdmin] < level)
  3397. {
  3398. format(string, 128, "You have been promoted to level %d administrative rank by %s.", level, pName(playerid));
  3399. SendClientMessage(id, COLOR_YELLOW, string);
  3400. format(string, 128, "You have promoted %s to level %d administrative rank.", pName(id), level);
  3401. SendClientMessage(playerid, COLOR_YELLOW, string);
  3402. }
  3403. else if(User[id][accountAdmin] > level)
  3404. {
  3405. format(string, 128, "You have been demoted to level %d administrative rank by %s.", level, pName(playerid));
  3406. SendClientMessage(id, COLOR_YELLOW, string);
  3407. format(string, 128, "You have demoted %s to level %d administrative rank.", pName(id), level);
  3408. SendClientMessage(playerid, COLOR_YELLOW, string);
  3409. }
  3410.  
  3411. User[id][accountAdmin] = level;
  3412.  
  3413. #if LOG == true
  3414. format(string, sizeof string, "Administrator %s has set %s's administrative level to %d", pName(playerid), pName(id), level);
  3415. SaveLog("account.txt", string);
  3416. #endif
  3417.  
  3418. SaveData(id); //Saving the whole data - Neater version than previously.
  3419. return 1;
  3420. }
  3421.  
  3422. //============================================================================//
  3423. // Administrative Level Zero //
  3424. //============================================================================//
  3425.  
  3426. CMD:admins(playerid, params[])
  3427. {
  3428. new string[128], count = 0;
  3429.  
  3430. SendClientMessage(playerid, -1, "** "orange"Online Administrators "white"**");
  3431. foreach(new i : Player)
  3432. {
  3433. if(User[i][accountLogged] == true)
  3434. {
  3435. if(User[i][accountAdmin] >= 1)
  3436. {
  3437. format(string, sizeof(string), "(%d) %s - Level %d Admin", i, pName(i), User[i][accountAdmin]);
  3438. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  3439. count++;
  3440. }
  3441. }
  3442. }
  3443. if(count == 0) return SendClientMessage(playerid, -1, "No administrators online at the server.");
  3444. return 1;
  3445. }
  3446.  
  3447. CMD:jcredits(playerid, params[])
  3448. {
  3449. SendClientMessage(playerid, COLOR_GREEN, "JaKe's Administration System "VERSION" Credits to:");
  3450. SendClientMessage(playerid, -1, "_Jake_, Y_Less, DracoBlue, Zeex, Zher0, Lordzy");
  3451. SendClientMessage(playerid, COLOR_YELLOW, "Ranveer, Samp_India, Ashirwad, Sonic, Adham, MaxFranky and others who helped us.");
  3452. return 1;
  3453. }
  3454.  
  3455. CMD:savestats(playerid, params[])
  3456. {
  3457. LoginCheck(playerid);
  3458.  
  3459. if(!DataExist(pName(playerid))) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You do not have account.");
  3460.  
  3461. SaveData(playerid);
  3462.  
  3463. SendClientMessage(playerid, COLOR_GREEN, "ACCOUNT: Your account statistics has been saved manually.");
  3464. return 1;
  3465. }
  3466.  
  3467. CMD:jcmds(playerid, params[])
  3468. {
  3469. new string[1246];
  3470.  
  3471. LoginCheck(playerid);
  3472.  
  3473. strcat(string, ""orange"");
  3474. strcat(string, "Jake Administrator System 3 Patch I [NEW ERA] scripted by "white"Jake Hero\n");
  3475. strcat(string, "Listing all available commands of JakAdmin3.\n\n");
  3476.  
  3477. strcat(string, ""grey"");
  3478. strcat(string, "/stats /cpass /register /login /report /admins /jcredits /savestats");
  3479.  
  3480. SD(playerid, DIALOG_BEGIN, DM, ""orange"Player Commands", string, "Close", "");
  3481. return 1;
  3482. }
  3483.  
  3484. CMD:report(playerid, params[])
  3485. {
  3486. new id, reason[128], string[136];
  3487. if(sscanf(params, "us[128]", id, reason)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /report [playerid] [reason]");
  3488. if(strlen(reason) <= 4) return SendClientMessage(playerid, -1, "» "red"Reason length shouldn't go lower than four.");
  3489. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  3490. if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot report yourself.");
  3491. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  3492. new r_hr, r_min, r_sec, r_m, r_d, r_y;
  3493. getdate(r_y, r_m, r_d);
  3494. gettime(r_hr, r_min, r_sec);
  3495.  
  3496. reportmsg[3] = reportmsg[2];
  3497. reportmsg[2] = reportmsg[1];
  3498. reportmsg[1] = reportmsg[0];
  3499.  
  3500. format(string, sizeof(string), "(%02d/%02d/%d - %02d:%02d:%02d) %s(ID:%d) has reported %s(ID:%d) for %s", r_m, r_d, r_y, r_hr, r_min, r_sec, pName(playerid), playerid, pName(id), id, reason);
  3501. reportmsg[0] = string;
  3502.  
  3503. format(string, sizeof(string), "REPORT: %s(ID:%d) has reported %s(ID:%d) for %s", pName(playerid), playerid, pName(id), id, reason);
  3504. SendAdmin(COLOR_RED, string);
  3505.  
  3506. foreach(new i : Player)
  3507. {
  3508. if(User[i][accountLogged] == true)
  3509. {
  3510. if(User[i][accountAdmin] >= 1)
  3511. {
  3512. PlayerPlaySound(i, 1085, 0.0, 0.0, 0.0);
  3513. #if ReportTD == true
  3514. TextDrawShowForPlayer(i, Textdraw0);
  3515. SetTimerEx("HideTD", 3500, false, "d", i);
  3516. #endif
  3517. }
  3518. }
  3519. }
  3520.  
  3521. format(string, sizeof(string), "Your complaint against %s(ID:%d) %s has been sent to Online Admins.", pName(id), id, reason);
  3522. SendClientMessage(playerid, COLOR_YELLOW, string);
  3523. return 1;
  3524. }
  3525.  
  3526. #if ReportTD == true
  3527. function:HideTD(playerid)
  3528. {
  3529. return TextDrawHideForPlayer(playerid, Textdraw0);
  3530. }
  3531. #endif
  3532.  
  3533. CMD:register(playerid, params[])
  3534. {
  3535. if(User[playerid][accountLogged] == true) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You are logged in and registered already.");
  3536.  
  3537. if(!DataExist(pName(playerid)))
  3538. {
  3539. new
  3540. string[128],
  3541. password[24],
  3542. hashpass[129]
  3543. ;
  3544.  
  3545. if(sscanf(params, "s[24]", password)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /register [password]");
  3546. if(!IsValidPassword(password)) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Invalid Password Symbols.");
  3547. if(strlen(password) < 4 || strlen(password) > 20) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Password length shouldn't go below 4 and shouldn't go higher 20.");
  3548.  
  3549. WP_Hash(hashpass, 129, password);
  3550.  
  3551. SetPlayerScore(playerid, STARTING_SCORE);
  3552. GivePlayerMoney(playerid, STARTING_CASH);
  3553.  
  3554. //Time = Hours, Time2 = Minutes, Time3 = Seconds
  3555. new time, time2, time3;
  3556. gettime(time, time2, time3);
  3557. new date, date2, date3;
  3558. //Date = Month, Date2 = Day, Date3 = Year
  3559. getdate(date3, date, date2);
  3560.  
  3561. format(User[playerid][accountDate], 150, "%02d/%02d/%d %02d:%02d:%02d", date, date2, date3, time, time2, time3);
  3562.  
  3563. new
  3564. query[750+1000]
  3565. ;
  3566. format(query, sizeof(query),
  3567. "INSERT INTO `users` (`username`, `IP`, `joindate`, `password`, `admin`, `kills`, `deaths`, `score`, `money`, `warn`, `mute`, `mutesec`, `cmute`, `cmutesec`, `jail`, `jailsec`, `hours`, `minutes`, `seconds`, `question`, `answer`) VALUES ('%s','%s','%s','%s',0,0,0,%d,%d,0,0,0,0,0,0,0,0,0,0,'%s','%s')",\
  3568. DB_Escape(pName(playerid)),
  3569. DB_Escape(User[playerid][accountIP]),
  3570. DB_Escape(User[playerid][accountDate]),
  3571. DB_Escape(hashpass),
  3572. User[playerid][accountScore],
  3573. User[playerid][accountCash],
  3574. DB_Escape(User[playerid][accountQuestion]),
  3575. DB_Escape(User[playerid][accountAnswer])
  3576. );
  3577. db_query(Database, query);
  3578.  
  3579. User[playerid][accountLogged] = true;
  3580.  
  3581. PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  3582.  
  3583. new
  3584. count,
  3585. DBResult: result
  3586. ;
  3587. result = db_query(Database, "SELECT * FROM `users`");
  3588. count = db_num_rows(result);
  3589. db_free_result(result);
  3590.  
  3591. User[playerid][accountID] = count;
  3592. SendClientMessage(playerid, -1, "You have successfully registered from the database.");
  3593. format(string, sizeof(string), "You are now handling accountID %i from the JakAdmin3 system.", count);
  3594. SendClientMessage(playerid, COLOR_ORANGE, string);
  3595.  
  3596. SendClientMessage(playerid, COLOR_YELLOW, "Proceeding to the Security Question.");
  3597.  
  3598. SD(playerid, DIALOG_QUESTION, DI, ""lightblue"Security Question", ""grey"Welcome to JakAdmin3's security question, Where you'll setup your account's security question.\nYou can use the Security Question incase you forgot your password, you can rely on it 100 percent.\n\nPut your question below:", "Setup", "");
  3599. }
  3600. else
  3601. {
  3602. SendClientMessage(playerid, COLOR_RED, "Syntax Error: You already have an account, /login instead.");
  3603. }
  3604. return 1;
  3605. }
  3606.  
  3607. CMD:login(playerid, params[])
  3608. {
  3609. if(User[playerid][accountLogged] == true) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You are logged in already.");
  3610.  
  3611. if(DataExist(pName(playerid)))
  3612. {
  3613. new
  3614. hashp[129],
  3615. string[900],
  3616. password[24]
  3617. ;
  3618.  
  3619. if(sscanf(params, "s[24]", password)) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: /login [password]");
  3620.  
  3621. if(strcmp(password, "forget", true) == 0)
  3622. {
  3623. format(string, sizeof(string), ""grey"You have forgotten your password? If that's the case, answer the question you set on your account and you'll access your account.\n\n%s\n\nAnswer?\nPress Quit if you are willing to quit.", User[playerid][accountQuestion]);
  3624. SD(playerid, DIALOG_FORGET, DI, ""lightblue"Security Question", string, "Answer", "Quit");
  3625. return 1;
  3626. }
  3627.  
  3628. WP_Hash(hashp, 129, password);
  3629. if(!strcmp(hashp, User[playerid][accountPassword], false))
  3630. {
  3631. LoginPlayer(playerid);
  3632. }
  3633. else
  3634. {
  3635. User[playerid][WarnLog]++;
  3636.  
  3637. if(User[playerid][WarnLog] == 3)
  3638. {
  3639. SD(playerid, DIALOG_BEGIN, DM, ""lightblue"Kicked", ""grey"You have been kicked from the server having too much wrong passwords!\nTry again, Reconnect (/q then join to the server again.)", "Close", "");
  3640. KickDelay(playerid);
  3641. return 1;
  3642. }
  3643.  
  3644. format(string, sizeof(string), "Invalid password! - %d out of 3 Warning Log Tires.", User[playerid][WarnLog]);
  3645. SendClientMessage(playerid, COLOR_RED, string);
  3646.  
  3647. SendClientMessage(playerid, -1, "LOGIN: Try again, /login [password].");
  3648. }
  3649. }
  3650. else
  3651. {
  3652. SendClientMessage(playerid, COLOR_RED, "Syntax Error: You do not have an account, /register first.");
  3653. }
  3654. return 1;
  3655. }
  3656.  
  3657. CMD:cpass(playerid, params[])
  3658. {
  3659. LoginCheck(playerid);
  3660.  
  3661. new OldPass[129], NewPass[129], string[128];
  3662. if(sscanf(params, "s[24]s[24]", OldPass, NewPass)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /cpass [old pass] [new pass]");
  3663. if(strlen(NewPass) < 4 || strlen(NewPass) > 20)
  3664. return SendClientMessage(playerid, COLOR_RED, "Syntax Error: New password length shouldn't go below four and shouldn't go below twenty.");
  3665.  
  3666. new Query[300], DBResult:Result, Buf[129];
  3667. WP_Hash(Buf, 129, OldPass);
  3668. format(Query, 300, "SELECT `userid` FROM `users` WHERE `username` = '%s' AND `password` = '%s'", User[playerid][accountName], Buf);
  3669. Result = db_query(Database, Query);
  3670.  
  3671. format(string, sizeof string, "Player %s has changed his/her password.", pName(playerid));
  3672. SaveLog("account.txt", string);
  3673.  
  3674. if(Result)
  3675. {
  3676. if(db_num_rows(Result))
  3677. {
  3678. db_free_result(Result);
  3679. WP_Hash(Buf, 129, NewPass);
  3680. format(Query, 300, "UPDATE `users` SET `password` = '%s' WHERE `username` = '%s'", DB_Escape(Buf), DB_Escape(User[playerid][accountName]));
  3681. db_query(Database, Query);
  3682.  
  3683. format(string, 128, "Your password has been changed to '"orange"%s"white"'", NewPass);
  3684. SendClientMessage(playerid, -1, string);
  3685. }
  3686. else
  3687. {
  3688. db_free_result(Result);
  3689. return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Old Password doesn't match on the current password!");
  3690. }
  3691. }
  3692. return 1;
  3693. }
  3694.  
  3695. CMD:stats(playerid, params[])
  3696. {
  3697. LoginCheck(playerid);
  3698.  
  3699. new id;
  3700. if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /stats [playerid]");
  3701. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  3702. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  3703.  
  3704. ShowStatistics(playerid, id); //Show the statistics to yourself.
  3705. return 1;
  3706. }
  3707.  
  3708. // //
  3709. //============================================================================//
  3710.  
  3711. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  3712. {
  3713. return 1;
  3714. }
  3715.  
  3716. public OnPlayerExitVehicle(playerid, vehicleid)
  3717. {
  3718. return 1;
  3719. }
  3720.  
  3721. public OnPlayerStateChange(playerid, newstate, oldstate)
  3722. {
  3723. new vehicleid = GetPlayerVehicleID(playerid);
  3724.  
  3725. if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
  3726. {
  3727. foreach(new x : Player)
  3728. {
  3729. if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && User[x][SpecID] == playerid && User[x][SpecType] == ADMIN_SPEC_TYPE_VEHICLE)
  3730. {
  3731. TogglePlayerSpectating(x, 1);
  3732. PlayerSpectatePlayer(x, playerid);
  3733. User[x][SpecType] = ADMIN_SPEC_TYPE_PLAYER;
  3734. }
  3735. }
  3736. }
  3737.  
  3738. if(newstate == PLAYER_STATE_PASSENGER)
  3739. {
  3740. foreach(new x : Player)
  3741. {
  3742. if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && User[x][SpecID] == playerid)
  3743. {
  3744. TogglePlayerSpectating(x, 1);
  3745. PlayerSpectateVehicle(x, vehicleid);
  3746. User[x][SpecType] = ADMIN_SPEC_TYPE_VEHICLE;
  3747. }
  3748. }
  3749. }
  3750.  
  3751. if(newstate == PLAYER_STATE_DRIVER)
  3752. {
  3753. foreach(new x : Player)
  3754. {
  3755. if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && User[x][SpecID] == playerid)
  3756. {
  3757. TogglePlayerSpectating(x, 1);
  3758. PlayerSpectateVehicle(x, vehicleid);
  3759. User[x][SpecType] = ADMIN_SPEC_TYPE_VEHICLE;
  3760. }
  3761. }
  3762. }
  3763. return 1;
  3764. }
  3765.  
  3766. public OnPlayerRequestSpawn(playerid)
  3767. {
  3768. #if ANTI_SPAWN == true
  3769. if(User[playerid][accountLogged] == false)
  3770. {
  3771. SendClientMessage(playerid, COLOR_RED, "Syntax Error: You need to login or register to spawn.");
  3772. return 0;
  3773. }
  3774. #endif
  3775. return 1;
  3776. }
  3777.  
  3778. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  3779. {
  3780. foreach(new x : Player)
  3781. {
  3782. if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && User[x][SpecID] == playerid && User[x][SpecType] == ADMIN_SPEC_TYPE_PLAYER)
  3783. {
  3784. SetPlayerInterior(x,newinteriorid);
  3785. }
  3786. }
  3787. return 1;
  3788. }
  3789.  
  3790. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  3791. {
  3792. if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING && User[playerid][SpecID] != INVALID_PLAYER_ID)
  3793. {
  3794. if(newkeys == KEY_JUMP) AdvanceSpectate(playerid);
  3795. else if(newkeys == KEY_SPRINT) ReverseSpectate(playerid);
  3796. }
  3797. return 1;
  3798. }
  3799.  
  3800. #if RconProtect == true
  3801. public OnPlayerRconLogin(playerid)
  3802. {
  3803. if(_RCON[playerid] == false)
  3804. {
  3805. SendClientMessage(playerid, COLOR_YELLOW, "The server has 2nd Rcon, Protected by JakAdmin");
  3806. SD(playerid, DIALOG_RCON, DP, ""green"2nd RCON Password", ""grey"The RCON password is protected by JakAdmin3\nPlease type the 2nd RCON Password to access the RCON.", "Access", "Kick");
  3807. }
  3808. return 1;
  3809. }
  3810. #endif
  3811.  
  3812. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  3813. {
  3814. switch( dialogid )
  3815. {
  3816. #if RconProtect == true
  3817. case DIALOG_RCON:
  3818. {
  3819. new
  3820. string[130]
  3821. ;
  3822. if(!response)
  3823. {
  3824. format(string, sizeof(string), "** Player %s(ID:%d) has been automatically kicked by the Server (Attempting to logged in RCON)", pName(playerid), playerid);
  3825. SendClientMessageToAll(COLOR_GREY, string);
  3826. print(string);
  3827. #if LOG == true
  3828. SaveLog("rcon.txt", string);
  3829. #endif
  3830. return KickDelay(playerid);
  3831. }
  3832. if(response)
  3833. {
  3834. if(!strcmp(RconPass, inputtext) && !(!strlen(inputtext)))
  3835. {
  3836. format(string, sizeof(string), "** Player %s(ID:%d) has accessed the RCON Protection successfully!", pName(playerid), playerid);
  3837. SendAdmin(COLOR_GREY, string);
  3838. print(string);
  3839. #if LOG == true
  3840. SaveLog("rcon.txt", string);
  3841. #endif
  3842.  
  3843. _RCON[playerid] = true;
  3844.  
  3845. GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~g~Authorized ~w~Access!~n~~y~Welcome Administrator!", 3000, 3);
  3846. }
  3847. else
  3848. {
  3849. if(_RCONwarn[playerid] == MAX_RCON_WARNINGS+1)
  3850. {
  3851. format(string, sizeof(string), "** Player %s(ID:%d) has been kicked by the Server (Attempting to logged in RCON)", pName(playerid), playerid);
  3852. SendClientMessageToAll(COLOR_GREY, string);
  3853. print(string);
  3854. #if LOG == true
  3855. SaveLog("kicklog.txt", string);
  3856. #endif
  3857. KickDelay(playerid);
  3858. return 1;
  3859. }
  3860. _RCONwarn[playerid] ++;
  3861. format(string, sizeof(string), "You have been warned for incorrect 2nd RCON Password (Warnings: %i/%i)", _RCONwarn[playerid], MAX_RCON_WARNINGS);
  3862. SendClientMessage(playerid, COLOR_GREY, string);
  3863. SD(playerid, DIALOG_RCON, DP, ""green"2nd RCON Password", ""grey"The RCON password is protected by JakAdmin3\nPlease type the 2nd RCON Password to access the RCON.", "Access", "Kick");
  3864. }
  3865. }
  3866. }
  3867. #endif
  3868.  
  3869. case DIALOG_QUESTION:
  3870. {
  3871. if(!response)
  3872. {
  3873. SD(playerid, DIALOG_QUESTION, DI, ""lightblue"Security Question", ""grey"Welcome to JakAdmin3's security question, Where you'll setup your account's security question.\nYou can use the Security Question incase you forgot your password, you can rely on it 100 percent.\n\nPut your question below:", "Setup", "");
  3874. }
  3875. else
  3876. {
  3877. if(strlen(inputtext) < 6 || strlen(inputtext) > 90)
  3878. {
  3879. SD(playerid, DIALOG_QUESTION, DI, ""lightblue"Security Question", ""grey"Welcome to JakAdmin3's security question, Where you'll setup your account's security question.\nYou can use the Security Question incase you forgot your password, you can rely on it 100 percent.\nERROR: Your question shouldn't go below six length and shouldn't go above ninety.\n\nPut your question below:", "Setup", "");
  3880. return 1;
  3881. }
  3882.  
  3883. format(User[playerid][accountQuestion], 129, "%s", inputtext);
  3884.  
  3885. SendClientMessage(playerid, -1, "Security Question has been set up, Proceeding to Security Answer.");
  3886.  
  3887. SaveData(playerid);
  3888.  
  3889. SD(playerid, DIALOG_ANSWER, DI, ""lightblue"Security Answer", ""grey"You have setup the Security Question, Now setup your security answer.\n\nPut your security answer below:", "Setup", "");
  3890. }
  3891. }
  3892.  
  3893. case DIALOG_ANSWER:
  3894. {
  3895. if(!response)
  3896. {
  3897. SD(playerid, DIALOG_ANSWER, DI, ""lightblue"Security Answer", ""grey"You have setup the Security Question, Now setup your security answer.\n\nPut your security answer below:", "Setup", "");
  3898. }
  3899. else
  3900. {
  3901. if(strlen(inputtext) < 2 || strlen(inputtext) > 90)
  3902. {
  3903. SD(playerid, DIALOG_ANSWER, DI, ""lightblue"Security Answer", ""grey"You have setup the Security Question, Now setup your security answer.\nERROR: Your security answer length shouldn't go below two and shouldn't go above ninety.\n\nPut your security answer below:", "Setup", "");
  3904. return 1;
  3905. }
  3906.  
  3907. new hashanswer[129];
  3908. WP_Hash(hashanswer, 129, inputtext);
  3909. format(User[playerid][accountAnswer], 129, "%s", hashanswer);
  3910.  
  3911. SendClientMessage(playerid, COLOR_GREEN, "Security Question setting up is done, Once you've forgotten your account's password on login, Press forgot.");
  3912.  
  3913. SaveData(playerid);
  3914. }
  3915. }
  3916.  
  3917. case DIALOG_REGISTER:
  3918. {
  3919. new
  3920. string[128],
  3921. hashpass[129]
  3922. ;
  3923. if(response)
  3924. {
  3925. if(!IsValidPassword(inputtext))
  3926. {
  3927. SD(playerid, DIALOG_REGISTER, DP, ""lightblue"JakAdmin3 - Register", ""grey"Welcome to the Server!\nYour account doesn't exist on our database, Please insert your password below.\n\nTIPS: Make the password long so no one can hack it.\nERROR: Invalid Password Symbols.", "Register", "Quit");
  3928. return 0;
  3929. }
  3930. if (strlen(inputtext) < 4 || strlen(inputtext) > 20)
  3931. {
  3932. SD(playerid, DIALOG_REGISTER, DP, ""lightblue"JakAdmin3 - Register", ""grey"Welcome to the Server!\nYour account doesn't exist on our database, Please insert your password below.\n\nTIPS: Make the password long so no one can hack it.\nERROR: Password length shouldn't go below 4 and shouldn't go higher 20.", "Register", "Quit");
  3933. return 0;
  3934. }
  3935.  
  3936. WP_Hash(hashpass, 129, inputtext);
  3937.  
  3938. SetPlayerScore(playerid, STARTING_SCORE);
  3939. GivePlayerMoney(playerid, STARTING_CASH);
  3940.  
  3941. //Time = Hours, Time2 = Minutes, Time3 = Seconds
  3942. new time, time2, time3;
  3943. gettime(time, time2, time3);
  3944. new date, date2, date3;
  3945. //Date = Month, Date2 = Day, Date3 = Year
  3946. getdate(date3, date, date2);
  3947.  
  3948. format(User[playerid][accountDate], 150, "%02d/%02d/%d %02d:%02d:%02d", date, date2, date3, time, time2, time3);
  3949.  
  3950. format(User[playerid][accountQuestion], 129, "What?");
  3951. format(User[playerid][accountAnswer], 129, "Yes");
  3952.  
  3953. new
  3954. query[750+1000]
  3955. ;
  3956. format(query, sizeof(query),
  3957. "INSERT INTO `users` (`username`, `IP`, `joindate`, `password`, `admin`, `kills`, `deaths`, `score`, `money`, `warn`, `mute`, `mutesec`, `cmute`, `cmutesec`, `jail`, `jailsec`, `hours`, `minutes`, `seconds`, `question`, `answer`) VALUES ('%s','%s','%s','%s',0,0,0,%d,%d,0,0,0,0,0,0,0,0,0,0,'%s','%s')",\
  3958. DB_Escape(pName(playerid)),
  3959. DB_Escape(User[playerid][accountIP]),
  3960. DB_Escape(User[playerid][accountDate]),
  3961. DB_Escape(hashpass),
  3962. User[playerid][accountScore],
  3963. User[playerid][accountCash],
  3964. DB_Escape(User[playerid][accountQuestion]),
  3965. DB_Escape(User[playerid][accountAnswer])
  3966. );
  3967. db_query(Database, query);
  3968.  
  3969. User[playerid][accountLogged] = true;
  3970.  
  3971. PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  3972.  
  3973. new
  3974. count,
  3975. DBResult: result
  3976. ;
  3977. result = db_query(Database, "SELECT * FROM `users`");
  3978. count = db_num_rows(result);
  3979. db_free_result(result);
  3980.  
  3981. User[playerid][accountID] = count;
  3982. SendClientMessage(playerid, -1, "You have successfully registered from the database.");
  3983. format(string, sizeof(string), "You are now handling accountID %i from the JakAdmin3 system.", count);
  3984. SendClientMessage(playerid, COLOR_ORANGE, string);
  3985. SendClientMessage(playerid, COLOR_YELLOW, "Proceeding to the Security Question.");
  3986.  
  3987. SD(playerid, DIALOG_QUESTION, DI, ""lightblue"Security Question", ""grey"Welcome to JakAdmin3's security question, Where you'll setup your account's security question.\nYou can use the Security Question incase you forgot your password, you can rely on it 100 percent.\n\nPut your question below:", "Setup", "");
  3988. }
  3989. else
  3990. {
  3991. KickDelay(playerid);
  3992. }
  3993. }
  3994. case DIALOG_LOGIN:
  3995. {
  3996. new
  3997. hashp[129],
  3998. string[900]
  3999. ;
  4000. if(response)
  4001. {
  4002. WP_Hash(hashp, 129, inputtext);
  4003. if(!strcmp(hashp, User[playerid][accountPassword], false))
  4004. {
  4005. LoginPlayer(playerid);
  4006. }
  4007. else
  4008. {
  4009. User[playerid][WarnLog]++;
  4010.  
  4011. if(User[playerid][WarnLog] == 3)
  4012. {
  4013. SD(playerid, DIALOG_BEGIN, DM, ""lightblue"Kicked", ""grey"You have been kicked from the server having too much wrong passwords!\nTry again, Reconnect (/q then join to the server again.)", "Close", "");
  4014. KickDelay(playerid);
  4015. return 0;
  4016. }
  4017.  
  4018. format(string, sizeof(string), "Invalid password! - %d out of 3 Warning Log Tires.", User[playerid][WarnLog]);
  4019. SendClientMessage(playerid, COLOR_RED, string);
  4020.  
  4021. format(string, sizeof(string), ""grey"Welcome back to the server!\nYour account exists on our database, Please insert your account's password below.\n\nTIPS: If you do not own the account, Please /q and find another username.\nERROR: Wrong password (%d/3 Warnings Log)", User[playerid][WarnLog]);
  4022.  
  4023. SD(playerid, DIALOG_LOGIN, DP, ""lightblue"JakAdmin3 - Login", string, "Login", "Forget");
  4024. }
  4025. }
  4026. else
  4027. {
  4028. format(string, sizeof(string), ""grey"You have forgotten your password? If that's the case, answer the question you set on your account and you'll access your account.\n\n%s\n\nAnswer?\nPress Quit if you are willing to quit.", User[playerid][accountQuestion]);
  4029. SD(playerid, DIALOG_FORGET, DI, ""lightblue"Security Question", string, "Answer", "Quit");
  4030. }
  4031. }
  4032.  
  4033. case DIALOG_FORGET:
  4034. {
  4035. if(!response)
  4036. {
  4037. KickDelay(playerid);
  4038. }
  4039. else
  4040. {
  4041. new hashanswer[129];
  4042. WP_Hash(hashanswer, 129, inputtext);
  4043.  
  4044. if(strcmp(User[playerid][accountAnswer], hashanswer, true) == 0)
  4045. {
  4046. LoginPlayer(playerid);
  4047. SendClientMessage(playerid, -1, "Access granted.");
  4048. }
  4049. else
  4050. {
  4051. new string[900];
  4052. format(string, sizeof(string), ""grey"You have forgotten your password? If that's the case, answer the question you set on your account and you'll access your account.\n\n%s\n\nAnswer?\nPress Quit if you are willing to quit.\n\nERROR: Wrong Answer on the question.", User[playerid][accountQuestion]);
  4053. SD(playerid, DIALOG_FORGET, DI, ""lightblue"Security Question", string, "Answer", "Quit");
  4054. }
  4055. }
  4056. }
  4057.  
  4058. case DIALOG_COLORS:
  4059. {
  4060. new string[120], id = GetPVarInt(playerid, "_Colors_");
  4061.  
  4062. switch( response )
  4063. {
  4064. case 0:
  4065. {
  4066. DeletePVar(playerid, "_Colors_");
  4067. SendClientMessage(playerid, -1, "Colour setting has been cancelled.");
  4068. }
  4069. case 1:
  4070. {
  4071. switch( listitem )
  4072. {
  4073. case 0:
  4074. {
  4075. format(string, sizeof(string), ""red"Administrator %s "white"has set your name color to "black"Black", pName(playerid));
  4076. SendClientMessage(id, -1, string);
  4077. format(string, sizeof(string), "Color Name for Player %s has been set.", pName(id));
  4078. SendClientMessage(playerid, COLOR_YELLOW, string);
  4079. SetPlayerColor(id, COLOR_BLACK);
  4080. DeletePVar(playerid, "_Colors_");
  4081. }
  4082. case 1:
  4083. {
  4084. format(string, sizeof(string), ""red"Administrator %s "white"has set your name color to "white"White", pName(playerid));
  4085. SendClientMessage(id, -1, string);
  4086. format(string, sizeof(string), "Color Name for Player %s has been set.", pName(id));
  4087. SendClientMessage(playerid, COLOR_YELLOW, string);
  4088. SetPlayerColor(id, COLOR_WHITE);
  4089. DeletePVar(playerid, "_Colors_");
  4090. }
  4091. case 2:
  4092. {
  4093. format(string, sizeof(string), ""red"Administrator %s "white"has set your name color to "red"Red", pName(playerid));
  4094. SendClientMessage(id, -1, string);
  4095. format(string, sizeof(string), "Color Name for Player %s has been set.", pName(id));
  4096. SendClientMessage(playerid, COLOR_YELLOW, string);
  4097. SetPlayerColor(id, COLOR_RED);
  4098. DeletePVar(playerid, "_Colors_");
  4099. }
  4100. case 3:
  4101. {
  4102. format(string, sizeof(string), ""red"Administrator %s "white"has set your name color to "orange"Orange", pName(playerid));
  4103. SendClientMessage(id, -1, string);
  4104. format(string, sizeof(string), "Color Name for Player %s has been set.", pName(id));
  4105. SendClientMessage(playerid, COLOR_YELLOW, string);
  4106. SetPlayerColor(id, COLOR_ORANGE);
  4107. DeletePVar(playerid, "_Colors_");
  4108. }
  4109. case 4:
  4110. {
  4111. format(string, sizeof(string), ""red"Administrator %s "white"has set your name color to "yellow"Yellow", pName(playerid));
  4112. SendClientMessage(id, -1, string);
  4113. format(string, sizeof(string), "Color Name for Player %s has been set.", pName(id));
  4114. SendClientMessage(playerid, COLOR_YELLOW, string);
  4115. SetPlayerColor(id, COLOR_YELLOW);
  4116. DeletePVar(playerid, "_Colors_");
  4117. }
  4118. case 5:
  4119. {
  4120. format(string, sizeof(string), ""red"Administrator %s "white"has set your name color to "green"Green", pName(playerid));
  4121. SendClientMessage(id, -1, string);
  4122. format(string, sizeof(string), "Color Name for Player %s has been set.", pName(id));
  4123. SendClientMessage(playerid, COLOR_YELLOW, string);
  4124. SetPlayerColor(id, COLOR_GREEN);
  4125. DeletePVar(playerid, "_Colors_");
  4126. }
  4127. case 6:
  4128. {
  4129. format(string, sizeof(string), ""red"Administrator %s "white"has set your name color to "blue"Blue", pName(playerid));
  4130. SendClientMessage(id, -1, string);
  4131. format(string, sizeof(string), "Color Name for Player %s has been set.", pName(id));
  4132. SendClientMessage(playerid, COLOR_YELLOW, string);
  4133. SetPlayerColor(id, COLOR_BLUE);
  4134. DeletePVar(playerid, "_Colors_");
  4135. }
  4136. case 7:
  4137. {
  4138. format(string, sizeof(string), ""red"Administrator %s "white"has set your name color to "purple"Purple", pName(playerid));
  4139. SendClientMessage(id, -1, string);
  4140. format(string, sizeof(string), "Color Name for Player %s has been set.", pName(id));
  4141. SendClientMessage(playerid, COLOR_YELLOW, string);
  4142. SetPlayerColor(id, COLOR_PURPLE);
  4143. DeletePVar(playerid, "_Colors_");
  4144. }
  4145. case 8:
  4146. {
  4147. format(string, sizeof(string), ""red"Administrator %s "white"has set your name color to "brown"Brown", pName(playerid));
  4148. SendClientMessage(id, -1, string);
  4149. format(string, sizeof(string), "Color Name for Player %s has been set.", pName(id));
  4150. SendClientMessage(playerid, COLOR_YELLOW, string);
  4151. SetPlayerColor(id, COLOR_BROWN);
  4152. DeletePVar(playerid, "_Colors_");
  4153. }
  4154. case 9:
  4155. {
  4156. format(string, sizeof(string), ""red"Administrator %s "white"has set your name color to "pink"Pink", pName(playerid));
  4157. SendClientMessage(id, -1, string);
  4158. format(string, sizeof(string), "Color Name for Player %s has been set.", pName(id));
  4159. SendClientMessage(playerid, COLOR_YELLOW, string);
  4160. SetPlayerColor(id, COLOR_PINK);
  4161. DeletePVar(playerid, "_Colors_");
  4162. }
  4163. }
  4164. }
  4165. }
  4166. }
  4167. }
  4168. return 1;
  4169. }
  4170.  
  4171. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  4172. {
  4173. new string[128+50];
  4174.  
  4175. format(string, sizeof(string), "You are now viewing '{%06x}%s"white"' statistics.", GetPlayerColor(clickedplayerid) >>> 8, pName(clickedplayerid));
  4176. SendClientMessage(playerid, -1, string);
  4177.  
  4178. ShowStatistics(playerid, clickedplayerid);
  4179. return 1;
  4180. }
  4181.  
  4182. //============================================================================//
  4183.  
  4184. //Stock and functions starts here.
  4185.  
  4186. stock pName(playerid)
  4187. {
  4188. new GetName[24];
  4189. GetPlayerName(playerid, GetName, 24);
  4190. return GetName;
  4191. }
  4192.  
  4193. function:ShowStatistics(playerid, playerid2)
  4194. {
  4195. if(playerid2 == INVALID_PLAYER_ID) return 1; //Do not proceed.
  4196.  
  4197. new string[1000], string2[556];
  4198.  
  4199. format(string2, 556, "{%06x}%s (PlayerID: %d) Statistics "white"- "orange"JakAdmin3\n\n", (GetPlayerColor(playerid2) >>> 8), pName(playerid2), playerid2);
  4200. strcat(string, string2);
  4201. strcat(string, ""grey"");
  4202. format(string2, 556, "UserID: %d\n", User[playerid2][accountID]); strcat(string, string2);
  4203. format(string2, 556, "Join Date: %s\n", User[playerid2][accountDate]); strcat(string, string2);
  4204. format(string2, 556, "Online Time: %02d:%02d:%02d\n", User[playerid2][accountGame][2], User[playerid2][accountGame][1], User[playerid2][accountGame][0]); strcat(string, string2);
  4205. format(string2, 556, "Administrative Level: %d\n", User[playerid2][accountAdmin]); strcat(string, string2);
  4206. format(string2, 556, "Score: %d\n", User[playerid2][accountScore]); strcat(string, string2);
  4207. format(string2, 556, "Cash: $%d\n", User[playerid2][accountCash]); strcat(string, string2);
  4208. format(string2, 556, "Kills: %d\n", User[playerid2][accountKills]); strcat(string, string2);
  4209. format(string2, 556, "Deaths: %d\n", User[playerid2][accountDeaths]); strcat(string, string2);
  4210. new Float:ratio = (float(User[playerid2][accountKills])/float(User[playerid2][accountDeaths]));
  4211. format(string2, 556, "Ratio (K/D): %.3f\n", ratio); strcat(string, string2);
  4212.  
  4213. format(string2, 556, "{%06x}%s's Statistics", GetPlayerColor(playerid2) >>> 8, pName(playerid2));
  4214. SD(playerid, DIALOG_BEGIN, DM, string2, string, "Close", "");
  4215. return 1;
  4216. }
  4217.  
  4218. function:KickMe(playerid)
  4219. {
  4220. return Kick(playerid);
  4221. }
  4222.  
  4223. stock KickDelay(playerid)
  4224. {
  4225. SetTimerEx("KickMe", 2000, false, "d", playerid);
  4226. return 1;
  4227. }
  4228.  
  4229. stock loadb()
  4230. {
  4231. Database = db_open(_DB_);
  4232. db_query(Database,
  4233. "CREATE TABLE IF NOT EXISTS `users`\
  4234. (`userid` INTEGER PRIMARY KEY AUTOINCREMENT, `username` TEXT, `IP` TEXT, `joindate` TEXT, `password` TEXT, `admin` NUMERIC, `kills` NUMERIC, `deaths` NUMERIC, `score` NUMERIC, `money` NUMERIC, `warn` NUMERIC, `mute` NUMERIC, `mutesec` NUMERIC, `cmute` NUMERIC, `cmutesec` NUMERIC, `jail` NUMERIC, `jailsec` NUMERIC, `hours` NUMERIC, `minutes` NUMERIC, `seconds` NUMERIC, `question` TEXT, `answer` TEXT)");
  4235.  
  4236. db_query(Database,
  4237. "CREATE TABLE IF NOT EXISTS `bans` (`username` TEXT, `ip` TEXT, `banby` TEXT, `banreason` TEXT, `banwhen` TEXT)");
  4238.  
  4239. print("[JakAdmin3] "_DB_" loading...");
  4240. return 1;
  4241. }
  4242. stock closedb()
  4243. {
  4244. print("[JakAdmin3] "_DB_" closing...");
  4245. return db_close(Database);
  4246. }
  4247.  
  4248. stock SaveData(playerid)
  4249. {
  4250. new
  4251. Query[700+1000]
  4252. ;
  4253.  
  4254. format(Query, sizeof(Query), "UPDATE `users` SET `IP` = '%s', `admin` = %d, `kills` = %d, `deaths` = %d, `score` = %d, `money` = %d, `warn` = %d, `mute` = %d, `mutesec` = %d, `cmute` = %d, `cmutesec` = %d, `jail` = %d, `jailsec` = %d, `hours` = %d, `minutes` = %d, `seconds` = %d, `question` = '%s', `answer` = '%s' WHERE `username` = '%s'",
  4255. DB_Escape(User[playerid][accountIP]),
  4256. User[playerid][accountAdmin],
  4257. User[playerid][accountKills],
  4258. User[playerid][accountDeaths],
  4259. User[playerid][accountScore],
  4260. User[playerid][accountCash],
  4261. User[playerid][accountWarn],
  4262. User[playerid][accountMuted],
  4263. User[playerid][accountMuteSec],
  4264. User[playerid][accountCMuted],
  4265. User[playerid][accountCMuteSec],
  4266. User[playerid][accountJail],
  4267. User[playerid][accountJailSec],
  4268. User[playerid][accountGame][2],
  4269. User[playerid][accountGame][1],
  4270. User[playerid][accountGame][0],
  4271. DB_Escape(User[playerid][accountQuestion]),
  4272. DB_Escape(User[playerid][accountAnswer]),
  4273. DB_Escape(User[playerid][accountName])
  4274. );
  4275. db_query(Database, Query);
  4276. db_free_result(db_query(Database, Query));
  4277. return 1;
  4278. }
  4279.  
  4280. stock getIP(playerid)
  4281. {
  4282. new twerp[20];
  4283. GetPlayerIp(playerid, twerp, 20);
  4284. return twerp;
  4285. }
  4286.  
  4287. stock isnumeric(const string[])
  4288. {
  4289. for (new i = 0, j = strlen(string); i < j; i++)
  4290. {
  4291. if (string[i] > '9' || string[i] < '0') return 0;
  4292. }
  4293. return 1;
  4294. }
  4295.  
  4296. stock GetWeaponIDFromName(WeaponName[])
  4297. {
  4298. if(strfind("molotov", WeaponName, true) != -1) return 18;
  4299. for(new i = 0; i <= 46; i++)
  4300. {
  4301. switch(i)
  4302. {
  4303. case 0,19,20,21,44,45: continue;
  4304. default:
  4305. {
  4306. new name[32]; GetWeaponName(i,name,32);
  4307. if(strfind(name,WeaponName,true) != -1) return i;
  4308. }
  4309. }
  4310. }
  4311. return -1;
  4312. }
  4313.  
  4314. function:LoginPlayer(playerid)
  4315. {
  4316. new
  4317. Query[900],
  4318. DBResult:Result,
  4319. string[128+40]
  4320. ;
  4321. format(Query, sizeof(Query), "SELECT * FROM `users` WHERE `username` = '%s'", DB_Escape(pName(playerid)));
  4322. Result = db_query(Database, Query);
  4323. if(db_num_rows(Result))
  4324. {
  4325. db_get_field_assoc(Result, "userid", Query, 7);
  4326. User[playerid][accountID] = strval(Query);
  4327.  
  4328. db_get_field_assoc(Result, "score", Query, 20);
  4329. User[playerid][accountScore] = strval(Query);
  4330. SetPlayerScore(playerid, User[playerid][accountScore]);
  4331.  
  4332. db_get_field_assoc(Result, "money", Query, 20);
  4333. User[playerid][accountCash] = strval(Query);
  4334. GivePlayerMoney(playerid, User[playerid][accountCash]);
  4335.  
  4336. db_get_field_assoc(Result, "kills", Query, 20);
  4337. User[playerid][accountKills] = strval(Query);
  4338.  
  4339. db_get_field_assoc(Result, "deaths", Query, 20);
  4340. User[playerid][accountDeaths] = strval(Query);
  4341.  
  4342. db_get_field_assoc(Result, "admin", Query, 7);
  4343. User[playerid][accountAdmin] = strval(Query);
  4344.  
  4345. db_get_field_assoc(Result, "joindate", Query, 150);
  4346. format(User[playerid][accountDate], 150, "%s", Query);
  4347.  
  4348. db_get_field_assoc(Result, "warn", Query, 5);
  4349. User[playerid][accountWarn] = strval(Query);
  4350.  
  4351. db_get_field_assoc(Result, "mute", Query, 5);
  4352. User[playerid][accountMuted] = strval(Query);
  4353.  
  4354. db_get_field_assoc(Result, "mutesec", Query, 8);
  4355. User[playerid][accountMuteSec] = strval(Query);
  4356.  
  4357. db_get_field_assoc(Result, "cmute", Query, 6);
  4358. User[playerid][accountCMuted] = strval(Query);
  4359.  
  4360. db_get_field_assoc(Result, "cmutesec", Query, 9);
  4361. User[playerid][accountCMuteSec] = strval(Query);
  4362.  
  4363. db_get_field_assoc(Result, "jail", Query, 5);
  4364. User[playerid][accountJail] = strval(Query);
  4365.  
  4366. db_get_field_assoc(Result, "jailsec", Query, 8);
  4367. User[playerid][accountJailSec] = strval(Query);
  4368.  
  4369. db_get_field_assoc(Result, "hours", Query, 6);
  4370. User[playerid][accountGame][2] = strval(Query);
  4371.  
  4372. db_get_field_assoc(Result, "minutes", Query, 8);
  4373. User[playerid][accountGame][1] = strval(Query);
  4374.  
  4375. db_get_field_assoc(Result, "seconds", Query, 8);
  4376. User[playerid][accountGame][0] = strval(Query);
  4377.  
  4378. User[playerid][accountLogged] = true;
  4379.  
  4380. if(User[playerid][accountMuted] == 1)
  4381. {
  4382. format(string, 200, "PUNISHMENT: You have been muted from using the chat for %d seconds, You are muted the last time you logged out.", User[playerid][accountMuteSec]);
  4383. SendClientMessage(playerid, COLOR_RED, string);
  4384. }
  4385. if(User[playerid][accountCMuted] == 1)
  4386. {
  4387. format(string, 200, "PUNISHMENT: You have been muted from using the commands for %d seconds, You are muted the last time you logged out.", User[playerid][accountCMuteSec]);
  4388. SendClientMessage(playerid, COLOR_RED, string);
  4389. }
  4390.  
  4391. SendClientMessage(playerid, COLOR_YELLOW, "SERVER: You have successfully logged in to the server.");
  4392. if(User[playerid][accountAdmin] >= 1)
  4393. {
  4394. SendClientMessage(playerid, -1, "You have logged into your administrative account, Good luck doing your duties.");
  4395. }
  4396.  
  4397. PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  4398. }
  4399. db_free_result(Result);
  4400. return 1;
  4401. }
  4402.  
  4403. function:IsValidPassword( const password[ ] )
  4404. {
  4405. for( new i = 0; password[ i ] != EOS; ++i )
  4406. {
  4407. switch( password[ i ] )
  4408. {
  4409. case '0'..'9', 'A'..'Z', 'a'..'z': continue;
  4410. default: return 0;
  4411. }
  4412. }
  4413. return 1;
  4414. }
  4415.  
  4416. stock DB_Escape(text[])
  4417. {
  4418. new
  4419. ret[80* 2],
  4420. ch,
  4421. i,
  4422. j;
  4423. while ((ch = text[i++]) && j < sizeof (ret))
  4424. {
  4425. if (ch == '\'')
  4426. {
  4427. if (j < sizeof (ret) - 2)
  4428. {
  4429. ret[j++] = '\'';
  4430. ret[j++] = '\'';
  4431. }
  4432. }
  4433. else if (j < sizeof (ret))
  4434. {
  4435. ret[j++] = ch;
  4436. }
  4437. else
  4438. {
  4439. j++;
  4440. }
  4441. }
  4442. ret[sizeof (ret) - 1] = '\0';
  4443. return ret;
  4444. }
  4445.  
  4446. stock ShowBan(playerid, admin[] = "JakAdmin3", reason[] = "69 Sex", when[] = "01/01/1970 00:00:00")
  4447. {
  4448. new string[256], string2[1500];
  4449.  
  4450. for(new i=0; i<100; i++)
  4451. {
  4452. SendClientMessage(playerid, -1, " ");
  4453. }
  4454.  
  4455. format(string, 256, "You're banned from server by %s for the following reasons:", admin);
  4456. SendClientMessage(playerid, COLOR_RED, string);
  4457. format(string, 256, "(( %s ))", reason);
  4458. SendClientMessage(playerid, -1, string);
  4459.  
  4460. strcat(string2, ""grey"");
  4461. strcat(string2, "You are banned from this server, Statistics of your ban:\n\n");
  4462. format(string, 256, ""white"Name: "red"%s\n", pName(playerid));
  4463. strcat(string2, string);
  4464. format(string, 256, ""white"Banned By: "red"%s\n", admin);
  4465. strcat(string2, string);
  4466. format(string, 256, ""white"Reason: "red"%s\n", reason);
  4467. strcat(string2, string);
  4468. format(string, 256, ""white"IP: "red"%s\n", User[playerid][accountIP]);
  4469. strcat(string2, string);
  4470. format(string, 256, ""white"Banned since: "red"%s\n\n", when);
  4471. strcat(string2, string);
  4472. strcat(string2, ""grey"");
  4473. strcat(string2, "If you think this is a bugged, false ban or the admin abused his/her power, Please place a ban appeal on forums.\n");
  4474. strcat(string2, "Make sure to take a picture of this by pressing F8, Do not lie on your appeal.");
  4475.  
  4476. SD(playerid, DIALOG_BEGIN, DM, ""red"You are banned from this server.", string2, "Close", "");
  4477. return 1;
  4478. }
  4479.  
  4480. stock BanAccountEx(name[], ip[], admin[] = "Anticheat", reason[] = "None")
  4481. {
  4482. new
  4483. Query[500],
  4484. DBResult:result,
  4485. ban_hr, ban_min, ban_sec, ban_month, ban_days, ban_years, when[128]
  4486. ;
  4487.  
  4488. gettime(ban_hr, ban_min, ban_sec);
  4489. getdate(ban_years, ban_month, ban_days);
  4490.  
  4491. format(when, 128, "%02d/%02d/%d %02d:%02d:%02d", ban_month, ban_days, ban_years, ban_hr, ban_min, ban_sec);
  4492.  
  4493. format(Query, 500, "INSERT INTO `bans` (`username`, `ip`, `banby`, `banreason`, `banwhen`) VALUES ('%s', '%s', '%s', '%s', '%s')", DB_Escape(name), DB_Escape(ip), DB_Escape(admin), DB_Escape(reason), DB_Escape(when));
  4494. result = db_query(Database, Query);
  4495.  
  4496. db_free_result(result);
  4497. return 1;
  4498. }
  4499.  
  4500. stock BanAccount(playerid, admin[] = "Anticheat", reason[] = "None")
  4501. {
  4502. new
  4503. Query[500],
  4504. DBResult:result,
  4505. ban_hr, ban_min, ban_sec, ban_month, ban_days, ban_years, when[128]
  4506. ;
  4507.  
  4508. gettime(ban_hr, ban_min, ban_sec);
  4509. getdate(ban_years, ban_month, ban_days);
  4510.  
  4511. format(when, 128, "%02d/%02d/%d %02d:%02d:%02d", ban_month, ban_days, ban_years, ban_hr, ban_min, ban_sec);
  4512.  
  4513. format(Query, 500, "INSERT INTO `bans` (`username`, `ip`, `banby`, `banreason`, `banwhen`) VALUES ('%s', '%s', '%s', '%s', '%s')", DB_Escape(pName(playerid)), DB_Escape(User[playerid][accountIP]), DB_Escape(admin), DB_Escape(reason), DB_Escape(when));
  4514. result = db_query(Database, Query);
  4515.  
  4516. db_free_result(result);
  4517. return 1;
  4518. }
  4519.  
  4520. function:j_CountCmds()
  4521. {
  4522. new
  4523. cmdBuffer[32],
  4524. commandCount;
  4525.  
  4526. for(new it = 0; it < Scripting_GetPublicsCount(); it++)
  4527. {
  4528. Scripting_GetPublic(it, cmdBuffer);
  4529.  
  4530. if(!strcmp(cmdBuffer, "cmd_", false, 4)) {
  4531. commandCount++;
  4532. }
  4533. }
  4534.  
  4535. return commandCount;
  4536. }
  4537.  
  4538. function:IsValidWeapon(weaponid)
  4539. {
  4540. if (weaponid > 0 && weaponid < 19 || weaponid > 21 && weaponid < 47) return 1;
  4541. return 0;
  4542. }
  4543.  
  4544. function:SaveLog(filename[], text[])
  4545. {
  4546. #if LOG == true
  4547.  
  4548. new string[256];
  4549.  
  4550. if(!fexist(_LOG_))
  4551. {
  4552. printf("[JakAdmin3] Unable to overwrite '%s' at the '%s', '%s' missing.", filename, _LOG_, _LOG_);
  4553. print("No logs has been saved to your server database.");
  4554.  
  4555. format(string, sizeof string, "JakAdmin3 has attempted to overwrite '%s' at the '%s' which is missing.", filename, _LOG_);
  4556. SendAdmin(COLOR_RED, string);
  4557. SendAdmin(-1, "No logs has been saved to the server database, Check the console for further solution.");
  4558. return 0;
  4559. }
  4560.  
  4561. new File:file,
  4562. filepath[128+40]
  4563. ;
  4564.  
  4565. new year, month, day;
  4566. new hour, minute, second;
  4567.  
  4568. getdate(year, month, day);
  4569. gettime(hour, minute, second);
  4570. format(filepath, sizeof(filepath), ""_LOG_"%s", filename);
  4571. file = fopen(filepath, io_append);
  4572. format(string, sizeof(string),"[%02d/%02d/%02d | %02d:%02d:%02d] %s\r\n", month, day, year, hour, minute, second, text);
  4573. fwrite(file, string);
  4574. fclose(file);
  4575. #endif
  4576. return 1;
  4577. }
  4578.  
  4579. stock VehicleOccupied(vehicleid)
  4580. {
  4581. for(new i = 0; i < MAX_PLAYERS; i++)
  4582. {
  4583. if(IsPlayerInVehicle(i, vehicleid)) return 1;
  4584. }
  4585. return 0;
  4586. }
  4587.  
  4588. stock DataExist(name[])
  4589. {
  4590. new Buffer[180],
  4591. Entry,
  4592. DBResult:Result
  4593. ;
  4594.  
  4595. format(Buffer, sizeof(Buffer), "SELECT `userid` FROM `users` WHERE `username` = '%s'", name);
  4596. Result = db_query(Database, Buffer);
  4597.  
  4598. if(Result)
  4599. {
  4600. if(db_num_rows(Result))
  4601. {
  4602. Entry = 1;
  4603. db_free_result(Result);
  4604. }
  4605. else Entry = 0;
  4606. }
  4607. return Entry;
  4608. }
  4609.  
  4610. stock SendAdmin(color, string[])
  4611. {
  4612. foreach(new i : Player)
  4613. {
  4614. if(User[i][accountAdmin] >= 1)
  4615. {
  4616. SendClientMessage(i, color, string);
  4617. }
  4618. }
  4619. }
  4620.  
  4621. #if ANTI_SWEAR == true
  4622. stock Cenzura(string[], words[], destch = '*')
  4623. {
  4624. new start_index = (-1),
  4625. end_index = (-1);
  4626.  
  4627. start_index = strfind(string, words, true);
  4628. if(start_index == (-1)) return false;
  4629. end_index = (start_index+strlen(words));
  4630.  
  4631. for( ; start_index < end_index; start_index++)
  4632. string[start_index] = destch;
  4633. return true;
  4634. }
  4635. #endif
  4636.  
  4637. stock StartSpectate(playerid, specplayerid)
  4638. {
  4639. foreach(new x : Player)
  4640. {
  4641. if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && User[x][SpecID] == playerid)
  4642. {
  4643. AdvanceSpectate(x);
  4644. }
  4645. }
  4646. SetPlayerInterior(playerid, GetPlayerInterior(specplayerid));
  4647. TogglePlayerSpectating(playerid, 1);
  4648.  
  4649. if(IsPlayerInAnyVehicle(specplayerid))
  4650. {
  4651. PlayerSpectateVehicle(playerid, GetPlayerVehicleID(specplayerid));
  4652. User[playerid][SpecID] = specplayerid;
  4653. User[playerid][SpecType] = ADMIN_SPEC_TYPE_VEHICLE;
  4654. }
  4655. else
  4656. {
  4657. PlayerSpectatePlayer(playerid, specplayerid);
  4658. User[playerid][SpecID] = specplayerid;
  4659. User[playerid][SpecType] = ADMIN_SPEC_TYPE_PLAYER;
  4660. }
  4661. return 1;
  4662. }
  4663.  
  4664. stock StopSpectate(playerid)
  4665. {
  4666. TogglePlayerSpectating(playerid, 0);
  4667. User[playerid][SpecID] = INVALID_PLAYER_ID;
  4668. User[playerid][SpecType] = ADMIN_SPEC_TYPE_NONE;
  4669. GameTextForPlayer(playerid,"~n~~n~~n~~w~Spectate mode ended",1000,3);
  4670. return 1;
  4671. }
  4672.  
  4673. stock AdvanceSpectate(playerid)
  4674. {
  4675. if(Iter_Count(Player) == 2) { StopSpectate(playerid); return 1; }
  4676. if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING && User[playerid][SpecID] != INVALID_PLAYER_ID)
  4677. {
  4678. for(new x=User[playerid][SpecID]+1; x<=MAX_PLAYERS; x++)
  4679. {
  4680. if(x == MAX_PLAYERS) x = 0;
  4681. if(IsPlayerConnected(x) && x != playerid)
  4682. {
  4683. if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && User[x][SpecID] != INVALID_PLAYER_ID || (GetPlayerState(x) != 1 && GetPlayerState(x) != 2 && GetPlayerState(x) != 3))
  4684. {
  4685. continue;
  4686. }
  4687. else
  4688. {
  4689. StartSpectate(playerid, x);
  4690. break;
  4691. }
  4692. }
  4693. }
  4694. }
  4695. return 1;
  4696. }
  4697.  
  4698. stock ReverseSpectate(playerid)
  4699. {
  4700. if(Iter_Count(Player) == 2) { StopSpectate(playerid); return 1; }
  4701. if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING && User[playerid][SpecID] != INVALID_PLAYER_ID)
  4702. {
  4703. for(new x=User[playerid][SpecID]-1; x>=0; x--)
  4704. {
  4705. if(x == 0) x = MAX_PLAYERS;
  4706. if(IsPlayerConnected(x) && x != playerid)
  4707. {
  4708. if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && User[x][SpecID] != INVALID_PLAYER_ID || (GetPlayerState(x) != 1 && GetPlayerState(x) != 2 && GetPlayerState(x) != 3))
  4709. {
  4710. continue;
  4711. }
  4712. else
  4713. {
  4714. StartSpectate(playerid, x);
  4715. break;
  4716. }
  4717. }
  4718. }
  4719. }
  4720. return 1;
  4721. }
  4722.  
  4723. stock GetVehicleModelIDFromName(vname[])
  4724. {
  4725. for(new i = 0; i < 211; i++)
  4726. {
  4727. if ( strfind(VehicleNames[i], vname, true) != -1 )
  4728. return i + 400;
  4729. }
  4730. return -1;
  4731. }
  4732.  
  4733. function:EraseVeh(vehicleid)
  4734. {
  4735. foreach(new i : Player)
  4736. {
  4737. new Float:X, Float:Y, Float:Z;
  4738. if(IsPlayerInVehicle(i, vehicleid))
  4739. {
  4740. RemovePlayerFromVehicle(i);
  4741. GetPlayerPos(i, X, Y, Z);
  4742. SetPlayerPos(i, X, Y+3, Z);
  4743. }
  4744. SetVehicleParamsForPlayer(vehicleid, i, 0, 1);
  4745. }
  4746. SetTimerEx("VehRes", 1500, 0, "i", vehicleid);
  4747. }
  4748.  
  4749. function:DelVehicle(vehicleid)
  4750. {
  4751. foreach(new players : Player)
  4752. {
  4753. new Float:X, Float:Y, Float:Z;
  4754. if(IsPlayerInVehicle(players, vehicleid))
  4755. {
  4756. GetPlayerPos(players, X, Y, Z);
  4757. SetPlayerPos(players, X, Y, Z+2);
  4758. SetVehicleToRespawn(vehicleid);
  4759. }
  4760. SetVehicleParamsForPlayer(vehicleid, players, 0, 1);
  4761. }
  4762. SetTimerEx("VehRes", 3000, 0, "d", vehicleid);
  4763. return 1;
  4764. }
  4765.  
  4766. stock Config()
  4767. {
  4768. print("\n");
  4769.  
  4770. /*
  4771. Don't blame me, Can't find a nice solution of detecting it, So i will do it
  4772. on my own way - I will find a proper code to optimize this on the next
  4773. version.
  4774. */
  4775.  
  4776. new
  4777. log,
  4778. autolog,
  4779. dialog,
  4780. readcmd,
  4781. maxping,
  4782. antiswear,
  4783. antiname,
  4784. antispawn,
  4785. antiad,
  4786. rconpass,
  4787. antispam,
  4788. on[3] ="ON",
  4789. off[4] = "OFF"
  4790. ;
  4791.  
  4792. log = 0; autolog = 0; dialog = 0; readcmd = 0; maxping = 0; antiswear = 0;
  4793. antiname = 0; antispawn = 0; antiad =0; rconpass=0; antispam = 0;
  4794.  
  4795. #if LOG == true
  4796. log = 1;
  4797. #endif
  4798.  
  4799. #if AUTO_LOGIN == true
  4800. autolog = 1;
  4801. #endif
  4802.  
  4803. #if REGISTER_DIALOG == true
  4804. dialog = 1;
  4805. #endif
  4806.  
  4807. #if READ_COMMANDS == true
  4808. readcmd = 1;
  4809. #endif
  4810.  
  4811. #if MAX_PING == true
  4812. maxping = 1;
  4813. #endif
  4814.  
  4815. #if ANTI_SWEAR == true
  4816. antiswear = 1;
  4817. #endif
  4818.  
  4819. #if ANTI_NAME == true
  4820. antiname = 1;
  4821. #endif
  4822.  
  4823. #if ANTI_SPAWN == true
  4824. antispawn = 1;
  4825. #endif
  4826.  
  4827. #if ANTI_AD == true
  4828. antiad = 1;
  4829. #endif
  4830.  
  4831. #if RconProtect == true
  4832. rconpass = 1;
  4833. #endif
  4834.  
  4835. #if AntiSpam == true
  4836. antispam = 1;
  4837. #endif
  4838.  
  4839. print("***** JaKe's Administration System Configuration *****");
  4840. printf("LogSaving: %s, AutoLogin: %s, Dialog: %s, ReadCommands: %s, MaxPing: %s", log ? on : off, autolog ? on : off, dialog ? on : off, readcmd ? on : off, maxping ? on : off);
  4841. printf("AntiSwear: %s, AntiName: %s, AntiSpawn: %s, AntiAd: %s, RCONProtect: %s", antiswear ? on : off, antiname ? on : off, antispawn ? on : off, antiad ? on : off, rconpass ? on : off);
  4842. printf("AntiSpam: %s", antispam ? on : off);
  4843. #if MAX_PING == true
  4844. printf("MaxPing Limit: %d", PING_EXCEED);
  4845. #endif
  4846. }
  4847.  
  4848. function:VehRes(vehicleid)
  4849. {
  4850. DestroyVehicle(vehicleid);
  4851. }
  4852.  
  4853. stock TimeStamp()
  4854. {
  4855. new time = GetTickCount() / 1000;
  4856. return time;
  4857. }
  4858.  
  4859. function:checkfolderEx()
  4860. {
  4861. if(!fexist("JakAdmin3/"))
  4862. {
  4863. return 0;
  4864. }
  4865. if(!fexist("JakAdmin3/Logs/"))
  4866. {
  4867. return 0;
  4868. }
  4869. return 1;
  4870. }
  4871.  
  4872. function:checkfolder()
  4873. {
  4874. if(!fexist("JakAdmin3/"))
  4875. {
  4876. print("\n[JakAdmin3]: JakAdmin3 folder doesn't exist in scriptfiles, JakAdmin3 won't start.");
  4877. print("Solution: Create the folder JakAdmin3 on the scriptfiles.");
  4878. print("Continusly using the script with the missing file will not save the target script objective.\n");
  4879. return 0;
  4880. }
  4881. if(!fexist("JakAdmin3/Logs/"))
  4882. {
  4883. print("\n[JakAdmin3]: Logs folder doesn't exist in JakAdmin3 folder, JakAdmin3 won't start.");
  4884. print("Solution: Create the folder Logs on the JakAdmin3 folder.");
  4885. print("Continusly using the script with the missing file will not save the target script objective.\n");
  4886. return 0;
  4887. }
  4888. return 1;
  4889. }
  4890.  
  4891. function:PosAfterSpec(playerid)
  4892. {
  4893. SetPlayerPos(playerid, SpecPos[playerid][0], SpecPos[playerid][1], SpecPos[playerid][2]);
  4894. SetPlayerFacingAngle(playerid, SpecPos[playerid][3]);
  4895. SetPlayerInterior(playerid, SpecInt[playerid][0]);
  4896. SetPlayerVirtualWorld(playerid, SpecInt[playerid][1]);
  4897. }
  4898.  
  4899. /*******************************************************************************
  4900. * End of the Script - JakAdmin3 (c), January 2015 *
  4901. ******************************************************************************/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement