Advertisement
Guest User

Untitled

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