Advertisement
Guest User

Untitled

a guest
May 30th, 2015
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 132.32 KB | None | 0 0
  1. //============================================================================//
  2.  
  3. /*
  4.  
  5. ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  6. ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  7. ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  8.  
  9. JaKe's Administration System 3.3 Patch I [NEW ERA] - Scripted from scratch!
  10. Scripted by Jake Hero.
  11. Never been bitter.
  12.  
  13. NOTE: Lots of changes has been made on 3.3, Please remove all the old datas from the scriptfiles of JakAdmin that uses 3.2 and below.
  14. //Ignore the note on the new patch if you have already used JakAdmin3.3.
  15.  
  16. NOTE2: Delete the juser.db, a new row in the .db file has been added.
  17.  
  18. Changelog since JakAdmin3 Patch I:
  19.  
  20. • Security Updates for Patch I.
  21. • Major bug fixes on the script core which isn't discovered in early beta testing.
  22. • A large/huge error on coding the database has been sealed and fixed (IMPORTANT)
  23. • Security Question for the player's account has been implemented back.
  24. • More better and accurate Security Question than JakAdmin 3.2.
  25. • A typo on the print message which displays '2014' instead of '2015', It has been updated.
  26. • Added a check folder script to avoid the server crash.
  27. • Added a Restart Command which wasn't added on the early stages of JakAdmin3.
  28. • Some new commands besides of the Security Patch such as /carpjob.
  29. • A new updated version of OPRL provided by Lordzy.
  30. • Added an option on the command /login to type 'forget'.
  31. • Replaced the login's dialog 2nd option button from 'Quit' to 'Forget'
  32. • An error on inserting a new registered player through /register has been fixed and synced with the code from the dialog.
  33. • Replaces some parts of the script which uses standard loop with the foreach.
  34. • Improved SQL Injection Protection on the Player Database.
  35. • Added a code which prevents from anyone using SQL Injection on the ban database.
  36. • Extended string for /jacmds.
  37.  
  38. Credits goes to: Zeex, SA-MP Team, Y_Less, Lordzy and for everyone who helped me on beta testing.
  39.  
  40. ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  41. ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  42. ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
  43.  
  44. */
  45.  
  46. //============================================================================//
  47.  
  48. //JakAdmin Includes
  49.  
  50. #include <a_samp>
  51. //#include <a_whirlpool>
  52. native WP_Hash(buffer[], len, const str[]);
  53. #include <zcmd>
  54. #include <sscanf2>
  55. #include <foreach>
  56. #include <YSI\y_scripting>
  57.  
  58. #pragma dynamic 39470
  59.  
  60. //============================================================================//
  61.  
  62. //Variables, Defnes and other stuffs starts here.
  63.  
  64. stock
  65. st[100]
  66. ;
  67.  
  68. //Public Macro
  69. #define function:%0(%1)\
  70. forward %0(%1);\
  71. public %0(%1)
  72.  
  73. //Level Check Macro
  74. //Level Check Macro
  75. #define LevelCheck(%0,%1); \
  76. if(User[(%0)][accountAdmin] < %1 && !IsPlayerAdmin((%0)))\
  77. return format(st, 100, "Du musst den admin level %d besitzen um diesen Befehl auszuführen.", (%1)),\
  78. SendClientMessage((%0), -1, st);
  79.  
  80.  
  81. //Login Check Macro
  82. #define LoginCheck(%1) if(User[%1][accountLogged] == false) return SendClientMessage(%1, COLOR_RED, "Du musst eingeloggt sein um diesen Befehl auszuführen.")
  83.  
  84. //Do not change the file type to .ini, We uses SQLite.
  85. #define _DB_ "JakAdmin3/Spieler.db"
  86. //The location and folder has been changed on 3.3.
  87.  
  88. #define _LOG_ "JakAdmin3/Logs/"
  89. //The location and folder for the log has been also changed on 3.3.
  90.  
  91. new _God[MAX_PLAYERS];
  92. new reportmsg[4][136];
  93.  
  94.  
  95. new SpecInt[MAX_PLAYERS][2];
  96. new Float:SpecPos[MAX_PLAYERS][4];
  97.  
  98. new GameTimer[MAX_PLAYERS];
  99.  
  100. new VehicleNames[212][] = {
  101. {"Landstalker"},{"Bravura"},{"Buffalo"},{"Linerunner"},{"Perrenial"},{"Sentinel"},{"Dumper"},
  102. {"Firetruck"},{"Trashmaster"},{"Stretch"},{"Manana"},{"Infernus"},{"Voodoo"},{"Pony"},{"Mule"},
  103. {"Cheetah"},{"Ambulance"},{"Leviathan"},{"Moonbeam"},{"Esperanto"},{"Taxi"},{"Washington"},
  104. {"Bobcat"},{"Mr Whoopee"},{"BF Injection"},{"Hunter"},{"Premier"},{"Enforcer"},{"Securicar"},
  105. {"Banshee"},{"Predator"},{"Bus"},{"Rhino"},{"Barracks"},{"Hotknife"},{"Trailer 1"},{"Previon"},
  106. {"Coach"},{"Cabbie"},{"Stallion"},{"Rumpo"},{"RC Bandit"},{"Romero"},{"Packer"},{"Monster"},
  107. {"Admiral"},{"Squalo"},{"Seasparrow"},{"Pizzaboy"},{"Tram"},{"Trailer 2"},{"Turismo"},
  108. {"Speeder"},{"Reefer"},{"Tropic"},{"Flatbed"},{"Yankee"},{"Caddy"},{"Solair"},{"Berkley's RC Van"},
  109. {"Skimmer"},{"PCJ-600"},{"Faggio"},{"Freeway"},{"RC Baron"},{"RC Raider"},{"Glendale"},{"Oceanic"},
  110. {"Sanchez"},{"Sparrow"},{"Patriot"},{"Quad"},{"Coastguard"},{"Dinghy"},{"Hermes"},{"Sabre"},
  111. {"Rustler"},{"ZR-350"},{"Walton"},{"Regina"},{"Comet"},{"BMX"},{"Burrito"},{"Camper"},{"Marquis"},
  112. {"Baggage"},{"Dozer"},{"Maverick"},{"News Chopper"},{"Rancher"},{"FBI Rancher"},{"Virgo"},{"Greenwood"},
  113. {"Jetmax"},{"Hotring"},{"Sandking"},{"Blista Compact"},{"Police Maverick"},{"Boxville"},{"Benson"},
  114. {"Mesa"},{"RC Goblin"},{"Hotring Racer A"},{"Hotring Racer B"},{"Bloodring Banger"},{"Rancher"},
  115. {"Super GT"},{"Elegant"},{"Journey"},{"Bike"},{"Mountain Bike"},{"Beagle"},{"Cropdust"},{"Stunt"},
  116. {"Tanker"}, {"Roadtrain"},{"Nebula"},{"Majestic"},{"Buccaneer"},{"Shamal"},{"Hydra"},{"FCR-900"},
  117. {"NRG-500"},{"HPV1000"},{"Cement Truck"},{"Tow Truck"},{"Fortune"},{"Cadrona"},{"FBI Truck"},
  118. {"Willard"},{"Forklift"},{"Tractor"},{"Combine"},{"Feltzer"},{"Remington"},{"Slamvan"},
  119. {"Blade"},{"Freight"},{"Streak"},{"Vortex"},{"Vincent"},{"Bullet"},{"Clover"},{"Sadler"},
  120. {"Firetruck LA"},{"Hustler"},{"Intruder"},{"Primo"},{"Cargobob"},{"Tampa"},{"Sunrise"},{"Merit"},
  121. {"Utility"},{"Nevada"},{"Yosemite"},{"Windsor"},{"Monster A"},{"Monster B"},{"Uranus"},{"Jester"},
  122. {"Sultan"},{"Stratum"},{"Elegy"},{"Raindance"},{"RC Tiger"},{"Flash"},{"Tahoma"},{"Savanna"},
  123. {"Bandito"},{"Freight Flat"},{"Streak Carriage"},{"Kart"},{"Mower"},{"Duneride"},{"Sweeper"},
  124. {"Broadway"},{"Tornado"},{"AT-400"},{"DFT-30"},{"Huntley"},{"Stafford"},{"BF-400"},{"Newsvan"},
  125. {"Tug"},{"Trailer 3"},{"Emperor"},{"Wayfarer"},{"Euros"},{"Hotdog"},{"Club"},{"Freight Carriage"},
  126. {"Trailer 3"},{"Andromada"},{"Dodo"},{"RC Cam"},{"Launch"},{"Police Car (LSPD)"},{"Police Car (SFPD)"},
  127. {"Police Car (LVPD)"},{"Police Ranger"},{"Picador"},{"S.W.A.T. Van"},{"Alpha"},{"Phoenix"},{"Glendale"},
  128. {"Sadler"},{"Luggage Trailer A"},{"Luggage Trailer B"},{"Stair Trailer"},{"Boxville"},{"Farm Plow"},
  129. {"Utility Trailer"}
  130. };
  131.  
  132. //Configuration
  133. #define VERSION "3.3 Patch I"
  134.  
  135. #define ADMIN_SPEC_TYPE_NONE 0
  136. #define ADMIN_SPEC_TYPE_PLAYER 1
  137. #define ADMIN_SPEC_TYPE_VEHICLE 2
  138.  
  139. #define STARTING_SCORE 1
  140. //Starting score for registered player.
  141. #define STARTING_CASH 10000
  142. //Starting cash for registered player.
  143. #define MAX_RCON_WARNINGS 3
  144. //Max warnings for attempting to logged in RCON.
  145. //Change the starting score and starting cash.
  146. #define LOG true
  147. //Change to false if you want to disable making logs on the server (Such as saving kicks etc, ban messages).
  148. #define AUTO_LOGIN true
  149. //Change to false if you want to disable the auto-login system.
  150. #define REGISTER_DIALOG true
  151. //Change to false if you want to disable the register/login dialog.
  152. #define READ_COMMANDS true
  153. //Change to false if you want to disable reading all player commands.
  154. #define MAX_PING false
  155. //Change to false if you want to disable this system.
  156. #define ANTI_SWEAR true
  157. //Change to false if you want to disable the AntiSwear.
  158. #define ANTI_NAME true
  159. //Change to false if you want to disable the AntiName.
  160. #define ANTI_SPAWN true
  161. //Change to false if you want to disable.
  162. //Anti Spawn disables player from spawning if they aren't registered or logged in.
  163. #define ANTI_AD true
  164. //Change to false if you want to disable the anti ad.
  165. #define RconProtect true
  166. //Change to false if you want to disable the 2nd Rcon.
  167. #define AntiSpam true
  168. //Change to false if you want to disable the AntiSpam.
  169. #define ReportTD true
  170. //Change to false if you want to disable the textdraw.
  171.  
  172. #if ReportTD == true
  173. new Text:Textdraw0;
  174. #endif
  175.  
  176. enum PlayerInfo
  177. {
  178. accountID,
  179. accountName[24],
  180. accountIP[20],
  181. accountQuestion[129],
  182. accountAnswer[129],
  183. accountPassword[129],
  184. accountAdmin,
  185. accountKills,
  186. accountDeaths,
  187. accountScore,
  188. accountCash,
  189. bool: accountLogged,
  190. WarnLog,
  191. accountDate[150],
  192. accountWarn,
  193. accountMuted,
  194. accountMuteSec,
  195. accountCMuted,
  196. accountCMuteSec,
  197. accountJail,
  198. accountJailSec,
  199. SpecID,
  200. SpecType,
  201. pCar,
  202. accountGame[3],
  203. pDuty,
  204. #if AntiSpam == true
  205. SpamCount,
  206. SpamTime
  207. #endif
  208. };
  209.  
  210. new User[MAX_PLAYERS][PlayerInfo],
  211. DB:Database,
  212. static_Warn[MAX_PLAYERS]
  213. ;
  214.  
  215. #if AntiSpam == true
  216. #define SPAM_MAX_MSGS 5 // Max Spam Messages
  217. #define SPAM_TIMELIMIT 8 // In seconds
  218. #endif
  219.  
  220. #if RconProtect == true
  221. #include <OPRL>
  222. //Includes the OPRL by Lordzy if 2nd_Rcon is set to true.
  223. #define RconPass "changeme"
  224. //Password for the 2nd Rcon, changeme to anything you want.
  225. new bool:_RCON[MAX_PLAYERS];
  226. new _RCONwarn[MAX_PLAYERS];
  227. #endif
  228.  
  229. #if ANTI_NAME == true
  230. new ForbidNames[][] =
  231. {
  232. {"Admin"},
  233. {"AssLicker"},
  234. {"Vip"},
  235. {"Hacker"},
  236. {"Justin_Bieber"},
  237. {"Supporter"},
  238. {"Projektleiter"},
  239. {"High-Admin"}
  240. //Names here, Remember, the last stanza don't have ","
  241. };
  242. #endif
  243.  
  244. #if ANTI_SWEAR == true
  245. new Swears[][] =
  246. {
  247. {"dick"},
  248. {"pussy"},
  249. {"dildo"},
  250. {"adventure time gay"},
  251. {"dik"},
  252. {"penis"},
  253. {"lutschen"},
  254. {"Hurensohn"},
  255. {"nN"},
  256. {"Homo"}
  257. //Bad Words here, Remember, the last stanza don't have ","
  258. };
  259. #endif
  260.  
  261. #if MAX_PING == true
  262. #define PING_EXCEED 1000
  263. //Maximum ping if the MAX_PING is set to true, if player exceeds it, He or SHE gets kicked.
  264. #define MAX_PING_WARN 3
  265. //Max ping warning from Ping Kick, once exceed, player gets kicked.
  266. #endif
  267.  
  268. //JakAdmin3 now makes everything easy.
  269. #define SD ShowPlayerDialog
  270. #define DP DIALOG_STYLE_PASSWORD
  271. #define DI DIALOG_STYLE_INPUT
  272. #define DM DIALOG_STYLE_MSGBOX
  273. #define DL DIALOG_STYLE_LIST
  274.  
  275. //Dialog Begin is null, You can use it as a message displayer since it is not used.
  276. #define DIALOG_BEGIN 905
  277. //Change the dialog id of the DIALOG_BEGIN if it conflicts.
  278. #define DIALOG_REGISTER DIALOG_BEGIN+1
  279. #define DIALOG_LOGIN DIALOG_BEGIN+2
  280. #define DIALOG_COLORS DIALOG_BEGIN+3
  281. #define DIALOG_RCON DIALOG_BEGIN+4
  282. #define DIALOG_QUESTION DIALOG_BEGIN+5
  283. #define DIALOG_ANSWER DIALOG_BEGIN+6
  284. #define DIALOG_FORGET DIALOG_BEGIN+7
  285.  
  286. //Colors
  287.  
  288. #define white "{FFFFFF}"
  289. #define lightblue "{33CCFF}"
  290. #define grey "{AFAFAF}"
  291. #define orange "{FF8000}"
  292. #define black "{2C2727}"
  293. #define red "{FF0000}"
  294. #define yellow "{FFFF00}"
  295. #define green "{33CC33}"
  296. #define blue "{0080FF}"
  297. #define purple "{D526D9}"
  298. #define pink "{FF80FF}"
  299. #define brown "{A52A2A}"
  300.  
  301. #define COLOR_RED 0xFF0000C8
  302. #define COLOR_YELLOW 0xFFFF00AA
  303. #define COLOR_GREEN 0x33CC33C8
  304. #define COLOR_ORANGE 0xFF8000C8
  305. #define COLOR_WHITE 0xFFFFFFFF
  306. #define COLOR_PURPLE 0xD526D9FF
  307. #define COLOR_LIGHTGREEN 0x00FF00FF
  308. #define COLOR_PINK 0xFF80FFFF
  309. #define COLOR_LIGHTBLUE 0x33CCFFAA
  310. #define COLOR_GREY 0xAFAFAFAA
  311. #define COLOR_BLUE 0x0080FFC8
  312. #define COLOR_BROWN 0xA52A2AAA
  313. #define COLOR_BLACK 0x2C2727AA
  314.  
  315. //============================================================================//
  316. //Script line starts here
  317.  
  318. public OnFilterScriptInit()
  319. {
  320. new
  321. day,
  322. month,
  323. year,
  324. hour,
  325. sec,
  326. mins,
  327. result = GetTickCount()
  328. ;
  329.  
  330. getdate(year, month, day);
  331. gettime(hour, mins, sec);
  332.  
  333. /*
  334. Checks the JakAdmin3 and logs folder if exist, otherwise sends a print message.
  335. */
  336.  
  337. checkfolder();
  338.  
  339. /*
  340. Just so you know, even if the folders of JakAdmin3 is missing, nothing will happen except
  341. accounts won't save. We have also blocked the SaveLog function from overwriting files
  342. when the Logs folder is missing.
  343. */
  344.  
  345. if(checkfolderEx() == 1)
  346. {
  347. /*
  348. If CheckFolderEX returns 1 instead of 0 (Doesn't exist), proceed the daily route.
  349. */
  350. printf("\nLolbob %s (c), Copyright - 2015", VERSION);
  351. print("Security Updates for SQL Injection, Patch I\n");
  352.  
  353. //Load the .DB file.
  354. loadb();
  355. printf("[Lolbob] Duration: %i ms", (GetTickCount() - result));
  356. printf("[Lolbob] Total Commands: %i", j_CountCmds());
  357. printf("[Lolbob] Date: %02i/%02i/%02i | Time: %02d:%02d:%02d", day, month, year, hour, mins, sec);
  358. Config();
  359. print("\n");
  360.  
  361. //Syncing Timers
  362. SetTimer("SyncStats", 1000, true);
  363. //Ping Timer (if set to true)
  364. #if MAX_PING == true
  365. SetTimer("PingCheck", 1000, true);
  366. #endif
  367. //Punishment Timer Handler
  368. SetTimer("PunishmentHandle", 1000, true);
  369.  
  370. for(new i=0; i<4; i++)
  371. {
  372. format(reportmsg[i], 136, "None");
  373. }
  374.  
  375. #if ReportTD == true
  376. Textdraw0 = TextDrawCreate(400.000000, 386.000000, "~r~New Report! ~w~Check your ~g~chat ~w~or ~y~/reports~w~!");
  377. TextDrawBackgroundColor(Textdraw0, 255);
  378. TextDrawFont(Textdraw0, 1);
  379. TextDrawLetterSize(Textdraw0, 0.320000, 1.100000);
  380. TextDrawColor(Textdraw0, -1);
  381. TextDrawSetOutline(Textdraw0, 1);
  382. TextDrawSetProportional(Textdraw0, 1);
  383. TextDrawSetSelectable(Textdraw0, 0);
  384. #endif
  385.  
  386. foreach(new i : Player)
  387. {
  388. OnPlayerConnect(i);
  389. }
  390. }
  391. return 1;
  392. }
  393.  
  394. public OnFilterScriptExit()
  395. {
  396. //Closing the .DB file.
  397. closedb();
  398.  
  399. #if ReportTD == true
  400. TextDrawDestroy(Textdraw0);
  401. #endif
  402.  
  403. foreach(new i : Player)
  404. {
  405. if(User[i][pCar] != -1)
  406. {
  407. DestroyVehicle(User[i][pCar]);
  408. }
  409. OnPlayerDisconnect(i, 1);
  410. User[i][accountLogged] = false;
  411. }
  412. return 1;
  413. }
  414.  
  415.  
  416. #if MAX_PING == true
  417. function:PingCheck()
  418. {
  419. new
  420. string[130]
  421. ;
  422. foreach(new i : Player)
  423. {
  424. if(GetPlayerPing(i) > PING_EXCEED)
  425. {
  426. if(static_Warn[i] == MAX_PING_WARN)
  427. {
  428. 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);
  429. SendClientMessageToAll(COLOR_GREY, string);
  430. KickDelay(i);
  431. return 1;
  432. }
  433. static_Warn[i] ++;
  434. 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);
  435. SendClientMessageToAll(COLOR_YELLOW, string);
  436. }
  437. }
  438. return 1;
  439. }
  440. #endif
  441.  
  442. function:SyncStats()
  443. {
  444. foreach(new i : Player)
  445. {
  446. if(User[i][accountLogged] == true)
  447. {
  448. User[i][accountCash] = GetPlayerMoney(i);
  449. User[i][accountScore] = GetPlayerScore(i);
  450. }
  451.  
  452. //Will be using for god too. (Improving it on the next version)
  453. if(_God[i] == 1)
  454. {
  455. SetPlayerHealth(i, 100000);
  456. }
  457. }
  458. return 1;
  459. }
  460.  
  461. function:GamePlay(playerid)
  462. {
  463. if(User[playerid][accountLogged] == true)
  464. {
  465. User[playerid][accountGame][0] += 1;
  466. if(User[playerid][accountGame][0] == 60)
  467. {
  468. User[playerid][accountGame][0] = 0;
  469. User[playerid][accountGame][1] += 1;
  470. if(User[playerid][accountGame][1] >= 59 && User[playerid][accountGame][0] == 0)
  471. {
  472. User[playerid][accountGame][1] = 0;
  473. User[playerid][accountGame][2] += 1;
  474. }
  475. }
  476. }
  477. return 1;
  478. }
  479.  
  480. public OnPlayerConnect(playerid)
  481. {
  482. #if ANTI_NAME == true
  483. new string[128+40];
  484. for(new x = 0; x < sizeof(ForbidNames); x++)
  485. {
  486. if(!strcmp(pName(playerid), ForbidNames[x], true))
  487. {
  488. format(string, sizeof string, "** Player %s(ID:%d) wurde vom Server gekickt (Verbotener Name)", pName(playerid), playerid);
  489. SendClientMessageToAll(COLOR_GREY, string);
  490. printf(string);
  491. #if LOG == true
  492. SaveLog("kicklog.txt", string);
  493. #endif
  494. KickDelay(playerid);
  495. return 1;
  496. }
  497. }
  498. #endif
  499.  
  500. for(new x; x < _: PlayerInfo; ++x ) User[playerid][PlayerInfo: x] = 0;
  501. User[playerid][SpecID] = INVALID_PLAYER_ID;
  502.  
  503. #if RconProtect == true
  504. _RCON[playerid] = false;
  505. _RCONwarn[playerid] = 0;
  506. #endif
  507.  
  508. User[playerid][pDuty] = 0;
  509. User[playerid][pCar] = -1;
  510. #if AntiSpam == true
  511. User[playerid][SpamCount] = 0;
  512. User[playerid][SpamTime] = 0;
  513. #endif
  514.  
  515. _God[playerid] = 0;
  516.  
  517. GetPlayerName(playerid, User[playerid][accountName], MAX_PLAYER_NAME);
  518. GetPlayerIp(playerid, User[playerid][accountIP], 20);
  519.  
  520. static_Warn[playerid] = 0;
  521.  
  522. new
  523. bQuery[128+90],
  524. reason[128],
  525. admin[128],
  526. when[128],
  527. DBResult:jResult
  528. ;
  529. format(bQuery, 600, "SELECT * FROM `bans` WHERE `username` = '%s'", pName(playerid));
  530. jResult = db_query(Database, bQuery);
  531.  
  532. if(db_num_rows(jResult))
  533. {
  534. db_get_field_assoc(jResult, "banby", admin, 128);
  535. db_get_field_assoc(jResult, "banreason", reason, 128);
  536. db_get_field_assoc(jResult, "banwhen", when, 128);
  537.  
  538. ShowBan(playerid, admin, reason, when);
  539.  
  540. KickDelay(playerid);
  541. return 1;
  542. }
  543. db_free_result(jResult);
  544.  
  545. new
  546. Query[128+71],
  547. DBResult: Result
  548. ;
  549.  
  550. #if AUTO_LOGIN == true
  551. new fIP[20];
  552. #endif
  553.  
  554. #if ReportTD == true
  555. TextDrawHideForPlayer(playerid, Textdraw0);
  556. #endif
  557.  
  558. GameTimer[playerid] = SetTimerEx("GamePlay", 1000, true, "d", playerid);
  559.  
  560. #if AUTO_LOGIN == true
  561. format(Query, sizeof(Query), "SELECT `password`, `IP` FROM `users` WHERE `username` = '%s'", DB_Escape(User[playerid][accountName]));
  562. Result = db_query(Database, Query);
  563. #else
  564. format(Query, sizeof(Query), "SELECT `password` FROM `users` WHERE `username` = '%s'", DB_Escape(User[playerid][accountName]));
  565. Result = db_query(Database, Query);
  566. #endif
  567. if(db_num_rows(Result))
  568. {
  569. SendClientMessage(playerid, -1, "Dein Account wurde in der Datenbank gefunden");
  570.  
  571. db_get_field_assoc(Result, "password", User[playerid][accountPassword], 129);
  572. db_get_field_assoc(Result, "question", User[playerid][accountQuestion], 129);
  573. db_get_field_assoc(Result, "answer", User[playerid][accountAnswer], 129);
  574. #if AUTO_LOGIN == true
  575. db_get_field_assoc(Result, "IP", fIP, 20);
  576. if(strcmp(fIP, User[playerid][accountIP], true) == 0)
  577. {
  578. SendClientMessage(playerid, -1, "Du wirst nun automatisch eingeloggt.");
  579. LoginPlayer(playerid);
  580. }
  581. else
  582. {
  583. #if REGISTER_DIALOG == true
  584. 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");
  585. #else
  586. SendClientMessage(playerid, COLOR_ORANGE, "Real-Shit City: /login [password] um dich einzuloggen.");
  587. #endif
  588. }
  589. #else
  590. #if REGISTER_DIALOG == true
  591. 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");
  592. #else
  593. SendClientMessage(playerid, COLOR_ORANGE, "LOGIN: /login [password] um dich einzuloggen.");
  594. #endif
  595. #endif
  596. }
  597. else
  598. {
  599. SendClientMessage(playerid, -1, "Dein Account wurde nicht in der Datenbank gefunden");
  600. #if REGISTER_DIALOG == true
  601. SD(playerid, DIALOG_REGISTER, DP, ""lightblue"Herzlich Willkommen auf Real-Shit City", ""grey"nIch sehe du bist neu auf diesem Server, bitte trage dein gewünschtes passwort ein.", "Register", "Quit");
  602. #else
  603. SendClientMessage(playerid, COLOR_ORANGE, "Real-Shit City: /register [password] um dir ein Account zu erstellen.");
  604. #endif
  605. }
  606. db_free_result(Result);
  607. return 1;
  608. }
  609.  
  610. public OnPlayerDisconnect(playerid, reason)
  611. {
  612. #if ReportTD == true
  613. TextDrawHideForPlayer(playerid, Textdraw0);
  614. #endif
  615.  
  616. for(new x=0; x<MAX_PLAYERS; x++)
  617. if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && User[x][SpecID] == playerid)
  618. AdvanceSpectate(x);
  619.  
  620. if(User[playerid][pCar] != -1) EraseVeh(User[playerid][pCar]);
  621.  
  622. KillTimer(GameTimer[playerid]);
  623.  
  624. if(User[playerid][accountLogged] == true)
  625. {
  626. //Saves the statistics to the .db.
  627. SaveData(playerid);
  628. }
  629. return 1;
  630. }
  631.  
  632. public OnPlayerSpawn(playerid)
  633. {
  634. if(User[playerid][accountJail] == 1)
  635. {
  636. SetTimerEx("JailPlayer", 3000, 0, "d", playerid);
  637. SendClientMessage(playerid, COLOR_RED, "Strafe: Du kannst deiner Strafe nicht entgehen. Du bist immer noch im Prison, Haha!");
  638.  
  639. return 1;
  640. }
  641. return 1;
  642. }
  643.  
  644. function:JailPlayer(playerid)
  645. {
  646. new string[128];
  647.  
  648. SetPlayerPos(playerid, 197.6661, 173.8179, 1003.0234);
  649. SetPlayerInterior(playerid, 3);
  650. SetCameraBehindPlayer(playerid);
  651.  
  652. format(string, 200, "Du wurdest für %d sekunden ins Prison gesteckt.", User[playerid][accountJailSec]);
  653. SendClientMessage(playerid, COLOR_RED, string);
  654. return 1;
  655. }
  656.  
  657. public OnPlayerDeath(playerid, killerid, reason)
  658. {
  659. for(new x=0; x<MAX_PLAYERS; x++)
  660. if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && User[x][SpecID] == playerid)
  661. AdvanceSpectate(x);
  662.  
  663. User[playerid][accountDeaths] ++;
  664. if(killerid != INVALID_PLAYER_ID)
  665. {
  666. User[killerid][accountKills] ++;
  667. }
  668. return 1;
  669. }
  670.  
  671. public OnVehicleSpawn(vehicleid)
  672. {
  673. foreach(new i : Player)
  674. {
  675. if(vehicleid == User[i][pCar])
  676. {
  677. EraseVeh(vehicleid);
  678. User[i][pCar] = -1;
  679. }
  680. }
  681. return 1;
  682. }
  683.  
  684. public OnVehicleDeath(vehicleid, killerid)
  685. {
  686. return 1;
  687. }
  688.  
  689. public OnPlayerText(playerid, text[])
  690. {
  691. new string[128+50];
  692.  
  693. #if ANTI_AD == true
  694. if(strfind(text, ":", true) != -1)
  695. {
  696. new
  697. i_numcount,
  698. i_period,
  699. i_pos;
  700.  
  701. while(text[i_pos]) {
  702. if('0' <= text[i_pos] <= '9') i_numcount++;
  703. else if(text[i_pos] == '.') i_period++;
  704. i_pos++;
  705. }
  706. if(i_numcount >= 8 && i_period >= 3)
  707. {
  708. format(string, sizeof(string), "Werbung: Spieler %s(ID: %d) vielleicht Server Werbung: '%s'.", pName(playerid), playerid, text);
  709. foreach(new i : Player)
  710. {
  711. if(User[i][accountLogged] == true)
  712. {
  713. if(User[i][accountAdmin] >= 1)
  714. {
  715. SendClientMessage(i, COLOR_RED, string);
  716. }
  717. }
  718. }
  719. SendClientMessage(playerid, -1, "Dein Chat wurde gesendet.");
  720. return 0;
  721. }
  722. }
  723. #endif
  724.  
  725. if(User[playerid][accountMuted] == 1)
  726. {
  727. format(string, sizeof(string), "Du bist immernoch gemuted, Du kannst nach %d sekunden wieder reden.", User[playerid][accountMuteSec]);
  728. SendClientMessage(playerid, COLOR_ORANGE, string);
  729. return 0;
  730. }
  731.  
  732. #if AntiSpam == true
  733. if((User[playerid][accountAdmin] == 0 && !IsPlayerAdmin(playerid)))
  734. {
  735. if(User[playerid][SpamCount] == 0) User[playerid][SpamTime] = TimeStamp();
  736.  
  737. User[playerid][SpamCount]++;
  738. if(TimeStamp() - User[playerid][SpamTime] > SPAM_TIMELIMIT)
  739. {
  740. User[playerid][SpamCount] = 0;
  741. User[playerid][SpamTime] = TimeStamp();
  742. }
  743. else if(User[playerid][SpamCount] == SPAM_MAX_MSGS)
  744. {
  745. format(string, sizeof(string), "** Spieler %s (ID:%d) wurde vom Server gekickt Grund (Spam Schutz)", pName(playerid), playerid);
  746. SendClientMessageToAll(COLOR_GREY, string);
  747. print(string);
  748. #if LOG == true
  749. SaveLog("kicklog.txt", string);
  750. #endif
  751. KickDelay(playerid);
  752. }
  753. else if(User[playerid][SpamCount] == SPAM_MAX_MSGS-1)
  754. {
  755. SendClientMessage(playerid, COLOR_RED, "WARNUNG: Anti Spam Warnung! Nochmal und du bekommst ein Kick!");
  756. return 0;
  757. }
  758. }
  759. #endif
  760.  
  761. #if ANTI_SWEAR == true
  762. for(new i = 0; i < sizeof(Swears); i++)
  763. {
  764. Cenzura(text, Swears[i]);
  765. }
  766. #endif
  767. return 1;
  768. }
  769.  
  770. //============================================================================//
  771. // ZCMD //
  772.  
  773. public OnPlayerCommandReceived(playerid, cmdtext[])
  774. {
  775. new string[128+50];
  776.  
  777. #if ANTI_AD == true
  778. if(strfind(cmdtext, ":", true) != -1)
  779. {
  780.  
  781. new
  782. i_numcount,
  783. i_period,
  784. i_pos;
  785.  
  786. while(cmdtext[i_pos]) {
  787. if('0' <= cmdtext[i_pos] <= '9') i_numcount++;
  788. else if(cmdtext[i_pos] == '.') i_period++;
  789. i_pos++;
  790. }
  791. if(i_numcount >= 8 && i_period >= 3)
  792. {
  793. format(string, sizeof(string), "Werbung: Spieler %s(ID: %d) vielleicht Server Werbung: '%s'.", pName(playerid), playerid, cmdtext);
  794. foreach(new i : Player)
  795. {
  796. if(User[i][accountLogged] == true)
  797. {
  798. if(User[i][accountAdmin] >= 1)
  799. {
  800. SendClientMessage(i, COLOR_RED, string);
  801. }
  802. }
  803. }
  804. SendClientMessage(playerid, -1, "Dein Befehl wurde erfolgreich gesendet.");
  805. return 0;
  806. }
  807. }
  808. #endif
  809.  
  810. if(User[playerid][accountCMuted] == 1)
  811. {
  812. format(string, sizeof(string), "Du bist immer noch gemuted, Du kannst alle Befehle nach %d sekunden wieder benutzen.", User[playerid][accountCMuteSec]);
  813. SendClientMessage(playerid, COLOR_ORANGE, string);
  814. return 0;
  815. }
  816.  
  817. #if READ_COMMANDS == true
  818. format(string, sizeof(string), "*** %s(ID:%d) : '%s'", pName(playerid), playerid, cmdtext);
  819. foreach(new i : Player)
  820. {
  821. if(User[i][accountAdmin] >= 1 && User[i][accountAdmin] > User[playerid][accountAdmin] && i != playerid)
  822. {
  823. SendClientMessage(i, COLOR_GREY, string);
  824. }
  825. }
  826. #endif
  827. return 1;
  828. }
  829.  
  830. //============================================================================//
  831. // Administrative Level 1-5 //
  832. //============================================================================//
  833.  
  834. CMD:jacmds(playerid, params[])
  835. {
  836. new string[1246+200];
  837.  
  838. LoginCheck(playerid);
  839. LevelCheck(playerid, 1);
  840.  
  841. strcat(string, ""orange"");
  842. strcat(string, "Auflistung aller benutzbaren Befehle für dein Admin-Rang.\n\n");
  843.  
  844. if(User[playerid][accountAdmin] >= 1)
  845. {
  846. strcat(string, ""lightblue">>> Supporter <<<\n");
  847. strcat(string, ""grey"");
  848. strcat(string, "/Durchsage /Kick /Antwort /goto /ip /spawn /gotoco\n");
  849. strcat(string, "/repair /reports /aduty /waffen /a(Admin Chat\n");
  850. strcat(string, "/takew /tv(off) /car /fluestern\n\n");
  851. }
  852. if(User[playerid][accountAdmin] >= 2)
  853. {
  854. strcat(string, ""lightblue">>> Moderator <<<\n");
  855. strcat(string, ""grey"");
  856. strcat(string, "/setinterior /heal /clearchat /(un)Prison\n");
  857. strcat(string, "/alltp /tpspieler /armour /respawncars\n");
  858. strcat(string, "/awaffen /tp\n\n");
  859. }
  860. if(User[playerid][accountAdmin] >= 3)
  861. {
  862. strcat(string, ""lightblue">>> Admin <<<\n");
  863. strcat(string, ""grey"");
  864. strcat(string, "/(un)ban (/un)freeze /geldentf /armourall /mute\n");
  865. strcat(string, "/armourall /sethealth /gibwaffen /healall /warn\n");
  866. strcat(string, "/write /warnentf /unmute\n\n");
  867. }
  868. if(User[playerid][accountAdmin] >= 4)
  869. {
  870. strcat(string, ""lightblue">>> Stellvertretender <<<\n");
  871. strcat(string, ""grey"");
  872. strcat(string, "/setweather /settime /allwaffen\n");
  873. strcat(string, "/ageld /alevel /setinterior /awaffenentf\n");
  874. strcat(string, "/allkill /restart /akick\n\n");
  875. }
  876. if(User[playerid][accountAdmin] >= 5 || IsPlayerAdmin(playerid))
  877. {
  878. strcat(string, ""lightblue">>> Projektleiter <<<\n");
  879. strcat(string, ""grey"");
  880. strcat(string, "/explode /ipban /acctot /jetpack\n");
  881. strcat(string, "/setlevel /setgeld /aexplode\n\n");
  882. }
  883.  
  884. SD(playerid, DIALOG_BEGIN, DM, ""orange"Administrative Befehle", string, "Verlassen", "");
  885. return 1;
  886. }
  887.  
  888. //============================================================================//
  889. // Administrative Level One //
  890. //============================================================================//
  891.  
  892. CMD:car(playerid, params[])
  893. {
  894. LoginCheck(playerid);
  895. LevelCheck(playerid, 1);
  896.  
  897. new carID[50], car, colour1, colour2, string[128];
  898. if(sscanf(params, "s[50]I(255)I(255)", carID, colour1, colour2)) return SendClientMessage(playerid, COLOR_RED, "/car [Car Name] [Farbe1(Optional)] [Farbe2(Optional)]");
  899. if(!isnumeric(carID)) car = GetVehicleModelIDFromName(carID);
  900. else car = strval(carID);
  901. if(car < 400 || car > 611) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Invalid Vehicle Model ID!");
  902.  
  903. if(colour1==255) colour1=random(256);
  904. if(colour2==255) colour2=random(256);
  905.  
  906. if(User[playerid][pCar] != -1 && !IsPlayerAdmin(playerid))
  907. EraseVeh(User[playerid][pCar]);
  908. new VehicleID;
  909. new Float:X, Float:Y, Float:Z;
  910. new Float:Angle, int1;
  911. GetPlayerPos(playerid, X, Y, Z);
  912. GetPlayerFacingAngle(playerid, Angle);
  913. int1 = GetPlayerInterior(playerid);
  914. VehicleID = CreateVehicle(car, X+3,Y,Z, Angle, colour1, colour2, -1);
  915. LinkVehicleToInterior(VehicleID, int1);
  916. SetVehicleVirtualWorld(VehicleID, GetPlayerVirtualWorld(playerid));
  917. User[playerid][pCar] = VehicleID;
  918. format(string, sizeof(string), "Du hast ein \"%s\" (Model: %d) gespawnt mit den Farben %d,%d", VehicleNames[car-400], car, colour1, colour2);
  919. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  920. return 1;
  921. }
  922.  
  923. CMD:takew(playerid, params[])
  924. {
  925. LoginCheck(playerid);
  926. LevelCheck(playerid, 1);
  927.  
  928. new
  929. string[130],
  930. id
  931. ;
  932.  
  933. if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "/takew [spielerid]");
  934. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler ist nicht Online.");
  935. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Du kannst diesen Befehl nicht an Admins ausführen die höheren rang als du haben.");
  936. ResetPlayerWeapons(id);
  937. format(string, sizeof(string), "Du hast die Waffen von %s's weggenommen.", pName(id));
  938. SendClientMessage(playerid, COLOR_YELLOW, string);
  939. format(string, sizeof(string), "Administrator %s hat dir deine Waffen weggenommen.", pName(playerid));
  940. SendClientMessage(id, COLOR_YELLOW, string);
  941. return 1;
  942. }
  943.  
  944. CMD:fluestern(playerid, params[])
  945. {
  946. LoginCheck(playerid);
  947. LevelCheck(playerid, 1);
  948.  
  949. new Player, Show[129];
  950. if(sscanf(params, "us[129]", Player, Show)) return SendClientMessage(playerid, COLOR_RED, "/fluestern [spielerid] [text]");
  951. if(Player == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler ist nicht Online.");
  952.  
  953. GameTextForPlayer(Player, Show, 6000, 3);
  954.  
  955. new string[120];
  956. format(string, sizeof(string), "Screen text sent to %s(ID:%d).", pName(Player), Player);
  957. SendClientMessage(playerid, COLOR_YELLOW, string);
  958. format(string, sizeof(string), "Administrator %s(ID:%d) fluester mit dir.", pName(playerid), playerid);
  959. SendClientMessage(Player, COLOR_YELLOW, string);
  960. return 1;
  961. }
  962.  
  963. CMD:tv(playerid, params[])
  964. {
  965. LoginCheck(playerid);
  966. LevelCheck(playerid, 1);
  967.  
  968. new string[150], specplayerid;
  969.  
  970. if(sscanf(params, "u", specplayerid)) return SendClientMessage(playerid, COLOR_RED, "/Tv [playerid]");
  971. if(specplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler nicht Online.");
  972. if(User[playerid][accountAdmin] < User[specplayerid][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Du kannst diesen Befehl nicht an Admins ausführen die Rang höher sind als du.");
  973. if(specplayerid == playerid) return SendClientMessage(playerid, COLOR_RED, "Du kannst dich nicht selbst tvn.");
  974. if(GetPlayerState(specplayerid) == PLAYER_STATE_SPECTATING && User[specplayerid][SpecID] != INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player is spectating someone.");
  975. if(GetPlayerState(specplayerid) != 1 && GetPlayerState(specplayerid) != 2 && GetPlayerState(specplayerid) != 3) return SendClientMessage(playerid, COLOR_RED, "Spieler ist noch nicht gespawnt.");
  976. GetPlayerPos(playerid, SpecPos[playerid][0], SpecPos[playerid][1], SpecPos[playerid][2]);
  977. GetPlayerFacingAngle(playerid, SpecPos[playerid][3]);
  978. SpecInt[playerid][0] = GetPlayerInterior(playerid);
  979. SpecInt[playerid][1] = GetPlayerVirtualWorld(playerid);
  980. StartSpectate(playerid, specplayerid);
  981. format(string, sizeof(string), "Now Spectating: %s (ID: %d)", pName(specplayerid), specplayerid);
  982. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  983. SendClientMessage(playerid, -1, "Drücke SHIFT für das erweiterte Tvn und SPACE für das normale Tvn.");
  984. return 1;
  985. }
  986.  
  987. CMD:tvoff(playerid, params[])
  988. {
  989. LoginCheck(playerid);
  990. LevelCheck(playerid, 1);
  991.  
  992. if(User[playerid][SpecType] != ADMIN_SPEC_TYPE_NONE)
  993. {
  994. StopSpectate(playerid);
  995. SetTimerEx("PosAfterSpec", 3000, 0, "d", playerid);
  996. SendClientMessage(playerid, COLOR_LIGHTBLUE, "No longer spectating.");
  997. }
  998. else return SendClientMessage(playerid, COLOR_RED, "Du Tvst keinen.");
  999. return 1;
  1000. }
  1001.  
  1002. CMD:waffen(playerid, params[])
  1003. {
  1004. LoginCheck(playerid);
  1005. LevelCheck(playerid, 1);
  1006.  
  1007. new
  1008. id,
  1009. Count,
  1010. x,
  1011. string[128],
  1012. string2[64],
  1013. WeapName[24],
  1014. slot,
  1015. weap,
  1016. ammo
  1017. ;
  1018. if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "/Waffen [spielerid]");
  1019. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler nicht Online.");
  1020. format(string2, sizeof(string2), "_______ [ %s(ID:%d) Weapons ] _______", pName(id), id);
  1021. SendClientMessage(playerid, COLOR_WHITE, string2);
  1022. for(slot = 0; slot < 14; slot++)
  1023. {
  1024. GetPlayerWeaponData(id, slot, weap, ammo);
  1025. if(ammo != 0 && weap != 0)
  1026. Count++;
  1027. }
  1028. if(Count < 1) return SendClientMessage(playerid, COLOR_RED, "Der Spieler hat keine Waffen bei sich!");
  1029. if(Count >= 1)
  1030. {
  1031. for (slot = 0; slot < 14; slot++)
  1032. {
  1033. GetPlayerWeaponData(id, slot, weap, ammo);
  1034. if(ammo != 0 && weap != 0)
  1035. {
  1036. GetWeaponName(weap, WeapName, sizeof(WeapName));
  1037. if(ammo == 65535 || ammo == 1)
  1038. format(string, sizeof(string), "%s%s (1)",string, WeapName);
  1039. else format(string, sizeof(string), "%s%s (%d)", string, WeapName, ammo);
  1040. x++;
  1041. if(x >= 5)
  1042. {
  1043. SendClientMessage(playerid, COLOR_YELLOW, string);
  1044. x = 0;
  1045. format(string, sizeof(string), "");
  1046. }
  1047. else format(string, sizeof(string), "%s, ", string);
  1048. }
  1049. }
  1050. if(x <= 4 && x > 0)
  1051. {
  1052. string[strlen(string)-3] = '.';
  1053. SendClientMessage(playerid, COLOR_YELLOW, string);
  1054. }
  1055. }
  1056. return 1;
  1057. }
  1058.  
  1059. CMD:aduty(playerid, params[])
  1060. {
  1061. LoginCheck(playerid);
  1062. LevelCheck(playerid, 1);
  1063.  
  1064. new
  1065. string[128]
  1066. ;
  1067.  
  1068. switch(User[playerid][pDuty])
  1069. {
  1070. case 0:
  1071. {
  1072. User[playerid][pDuty] = 1;
  1073. format(string, 128, "%s(ID:%d) geht in den \" Admin Mode \"", pName(playerid), playerid);
  1074. SendClientMessageToAll(COLOR_RED, string);
  1075. }
  1076. case 1:
  1077. {
  1078. User[playerid][pDuty] = 0;
  1079. format(string, 128, "%s(ID:%d) verlässt den \" Admin Mode \"", pName(playerid), playerid);
  1080. SendClientMessageToAll(COLOR_YELLOW, string);
  1081. }
  1082. }
  1083. return 1;
  1084. }
  1085.  
  1086. CMD:reports(playerid, params[])
  1087. {
  1088. LoginCheck(playerid);
  1089. LevelCheck(playerid, 1);
  1090.  
  1091. new string[1400], string2[136];
  1092. strcat(string, ""red"*** Report Send by the Players ***\n\n");
  1093. strcat(string, ""grey"");
  1094. for(new i=0; i<4; i++)
  1095. {
  1096. format(string2, sizeof string2, "(%d) %s\n", i, reportmsg[i]);
  1097. strcat(string, string2);
  1098. }
  1099.  
  1100. SD(playerid, DIALOG_BEGIN, DM, ""red"Reports", string, "Verlassen", "");
  1101. return 1;
  1102. }
  1103.  
  1104. CMD:repair(playerid, params[])
  1105. {
  1106. LoginCheck(playerid);
  1107. LevelCheck(playerid, 1);
  1108.  
  1109. if(IsPlayerInAnyVehicle(playerid))
  1110. {
  1111. new VehicleID = GetPlayerVehicleID(playerid);
  1112. RepairVehicle(VehicleID);
  1113. GameTextForPlayer(playerid, "~w~~n~~n~~n~~n~~n~~n~Vehicle ~g~Repaired!", 3000, 3);
  1114. SetVehicleHealth(VehicleID, 1000.0);
  1115. }
  1116. else
  1117. SendClientMessage(playerid, COLOR_RED, "Syntax Error: You must be inside of the vehicle to use this command.");
  1118. return 1;
  1119. }
  1120. CMD:gotoco(playerid, params[])
  1121. {
  1122. LoginCheck(playerid);
  1123. LevelCheck(playerid, 1);
  1124.  
  1125. new
  1126. Float: Pos[3],
  1127. string[128]
  1128. ;
  1129. if(sscanf(params, "fff", Pos[0], Pos[1], Pos[2])) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /gotoco [x] [y] [z]");
  1130. if(IsPlayerInAnyVehicle(playerid)) SetVehiclePos(GetPlayerVehicleID(playerid), Pos[0], Pos[1], Pos[2]);
  1131. else SetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  1132.  
  1133. format(string, sizeof string, "You have teleported to Coordinates %.1f %.1f %.1f", Pos[0], Pos[1], Pos[2]);
  1134. SendClientMessage(playerid, COLOR_YELLOW, string);
  1135. return 1;
  1136. }
  1137.  
  1138. CMD:ip(playerid, params[])
  1139. {
  1140. LoginCheck(playerid);
  1141. LevelCheck(playerid, 1);
  1142.  
  1143. new
  1144. id,
  1145. string[120]
  1146. ;
  1147. if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /ip [playerid]");
  1148. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  1149. format(string, 120, "> %s's IP: %s <", pName(id), getIP(id));
  1150. SendClientMessage(playerid, GetPlayerColor(id), string);
  1151. return 1;
  1152. }
  1153.  
  1154. CMD:spawn(playerid, params[])
  1155. {
  1156. LoginCheck(playerid);
  1157. LevelCheck(playerid, 1);
  1158.  
  1159. new
  1160. string[128],
  1161. id
  1162. ;
  1163.  
  1164. if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /spawn [playerid]");
  1165. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  1166. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  1167. SetPlayerPos(id, 0.0, 0.0, 0.0);
  1168. SpawnPlayer(id);
  1169. format(string, sizeof(string), "You have respawned Player %s.", pName(id));
  1170. SendClientMessage(playerid, -1, string);
  1171. format(string, sizeof(string), "Administrator %s has respawned you.", pName(playerid));
  1172. SendClientMessage(id, COLOR_YELLOW, string);
  1173. return 1;
  1174. }
  1175.  
  1176. CMD:goto(playerid, params[])
  1177. {
  1178. LoginCheck(playerid);
  1179. LevelCheck(playerid, 1);
  1180.  
  1181. new
  1182. id,
  1183. string[130],
  1184. Float:x,
  1185. Float:y,
  1186. Float:z
  1187. ;
  1188. if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /goto [playerid]");
  1189. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  1190. GetPlayerPos(id, x, y, z);
  1191. SetPlayerInterior(playerid, GetPlayerInterior(id));
  1192. SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id));
  1193. if(GetPlayerState(playerid) == 2)
  1194. {
  1195. SetVehiclePos(GetPlayerVehicleID(playerid), x+3, y, z);
  1196. LinkVehicleToInterior(GetPlayerVehicleID(playerid), GetPlayerInterior(id));
  1197. SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), GetPlayerVirtualWorld(id));
  1198. }
  1199. else SetPlayerPos(playerid, x+2, y, z);
  1200. format(string, sizeof(string), "You have been teleported to Player %s.", pName(id));
  1201. SendClientMessage(playerid, COLOR_GREEN, string);
  1202. format(string, sizeof(string), "Administrator %s has teleported to your location.", pName(playerid));
  1203. SendClientMessage(id, COLOR_GREEN, string);
  1204. return 1;
  1205. }
  1206. CMD:durchsage(playerid, params[])
  1207. {
  1208. LoginCheck(playerid);
  1209. LevelCheck(playerid, 1);
  1210. if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "/Durchsage [Nachricht an alle User]");
  1211. GameTextForAll(params, 4000, 3);
  1212. return 1;
  1213. }
  1214.  
  1215. CMD:kick(playerid, params[])
  1216. {
  1217. LoginCheck(playerid);
  1218. LevelCheck(playerid, 1);
  1219.  
  1220. new
  1221. string[128],
  1222. id,
  1223. reason[128]
  1224. ;
  1225. if(sscanf(params, "uS(N/A)[128]", id, reason)) return SendClientMessage(playerid, COLOR_RED, "/kick [spielerid] [Grund(Standart: N/A)]");
  1226. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler nicht Online.");
  1227. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Du kannst keine Admins Kicken die Rang höher sind als du.");
  1228. format(string, sizeof(string), "** %s wurde von den Adminstratoren für %s gekickt [Grund: %s]", pName(id), pName(playerid), reason);
  1229. SendClientMessageToAll(COLOR_GREY, string);
  1230.  
  1231. #if LOG == true
  1232. SaveLog("kicklog.txt", string);
  1233. #endif
  1234.  
  1235. KickDelay(id);
  1236. return 1;
  1237. }
  1238.  
  1239. CMD:antwort(playerid, params[])
  1240. {
  1241. LoginCheck(playerid);
  1242. LevelCheck(playerid, 1);
  1243.  
  1244. new
  1245. string[128]
  1246. ;
  1247.  
  1248. if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "/antwort [nachricht als Antwort im]");
  1249.  
  1250. format(string, sizeof(string), "** Admin %s: %s", pName(playerid), params);
  1251. SendClientMessageToAll(COLOR_GREEN, string);
  1252. return 1;
  1253. }
  1254.  
  1255. CMD:a(playerid, params[])
  1256. {
  1257. new
  1258. string[140]
  1259. ;
  1260.  
  1261. LoginCheck(playerid);
  1262. LevelCheck(playerid, 1);
  1263.  
  1264. if(isnull(params)) return SendClientMessage(playerid, COLOR_RED, "/a [admin chat]");
  1265.  
  1266. format(string, sizeof( string ), "<!> Admin Chat %s: %s", pName(playerid), params);
  1267.  
  1268. #if LOG == true
  1269. SaveLog("adminchat.txt", string);
  1270. #endif
  1271.  
  1272. foreach(new i : Player)
  1273. {
  1274. if(User[i][accountLogged] == true)
  1275. {
  1276. if(User[i][accountAdmin] >= 1)
  1277. {
  1278. SendClientMessage(i, COLOR_YELLOW, string);
  1279. }
  1280. }
  1281. }
  1282. return 1;
  1283. }
  1284.  
  1285. //============================================================================//
  1286. // Administrative Level Two //
  1287. //============================================================================//
  1288.  
  1289. CMD:aweapons(playerid, params[])
  1290. {
  1291. LoginCheck(playerid);
  1292. LevelCheck(playerid, 2);
  1293.  
  1294. GivePlayerWeapon(playerid, 24, 99999);
  1295. GivePlayerWeapon(playerid, 26, 99999);
  1296. GivePlayerWeapon(playerid, 29, 99999);
  1297. GivePlayerWeapon(playerid, 31, 99999);
  1298. GivePlayerWeapon(playerid, 33, 99999);
  1299. GivePlayerWeapon(playerid, 38, 99999);
  1300. GivePlayerWeapon(playerid, 9, 1);
  1301.  
  1302. SendClientMessage(playerid, COLOR_YELLOW, "Waffen von Admin %s erhalten!");
  1303. return 1;
  1304. }
  1305.  
  1306. //----------------------------------Befehle die jeder Spieler benutzen kann--------------------------------------//
  1307. CMD:eject(playerid, params[])
  1308. {
  1309. new string[130],
  1310. id
  1311. ;
  1312.  
  1313. if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "/eject [spielerid]");
  1314. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler befindet sich nicht in deinem Auto.");
  1315. if(!IsPlayerInAnyVehicle(id)) return SendClientMessage(playerid, COLOR_RED, "Spieler ist nicht in deinem Auto.");
  1316. if(GetPlayerVehicleID(id) != GetPlayerVehicleID(playerid)) return SendClientMessage(playerid, COLOR_RED, "Der Spieler ist nicht in deinem Auto.");
  1317. if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_RED, "Du bist nicht der Fahrer dieses Fahrzeuges.");
  1318. if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "Du kannst dich nicht selbst ejecten.");
  1319. RemovePlayerFromVehicle(id);
  1320. format(string, sizeof(string), "Du hast den Spieler %s(ID:%d) von deinem Auto rausgeschmissen", pName(id), id);
  1321. SendClientMessage(playerid, COLOR_YELLOW, string);
  1322. return 1;
  1323. }
  1324.  
  1325. CMD:muteinfo(playerid, params[])
  1326. {
  1327. new string[128], count = 0;
  1328.  
  1329. SendClientMessage(playerid, -1, "** "orange"Muted Players "white"**");
  1330. foreach(new i : Player)
  1331. {
  1332. if(User[i][accountLogged] == true)
  1333. {
  1334. if(User[i][accountMuted] == 1)
  1335. {
  1336. format(string, sizeof(string), "(%d) %s - Seconds left %d", i, pName(i), User[i][accountMuteSec]);
  1337. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  1338. count++;
  1339. }
  1340. }
  1341. }
  1342. if(count == 0) return SendClientMessage(playerid, -1, "Zurzeit befinden sich keine Spieler auf dem Server die einen mute haben.");
  1343. return 1;
  1344. }
  1345.  
  1346. CMD:prisoninfo(playerid, params[])
  1347. {
  1348. new string[128], count = 0;
  1349.  
  1350. SendClientMessage(playerid, -1, "** "orange"Spieler im Prison "white"**");
  1351. foreach(new i : Player)
  1352. {
  1353. if(User[i][accountLogged] == true)
  1354. {
  1355. if(User[i][accountJail] == 1)
  1356. {
  1357. format(string, sizeof(string), "(%d) %s - Seconds left %d", i, pName(i), User[i][accountJailSec]);
  1358. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  1359. count++;
  1360. }
  1361. }
  1362. }
  1363. if(count == 0) return SendClientMessage(playerid, -1, "Keine Spieler die zurzeit im Prison sind.");
  1364. return 1;
  1365. }
  1366. //-------------------------------------------------------------------------------------------------------------------//
  1367.  
  1368. CMD:akill(playerid, params[])
  1369. {
  1370. LoginCheck(playerid);
  1371. LevelCheck(playerid, 2);
  1372.  
  1373. new
  1374. string[150],
  1375. reason[128],
  1376. id
  1377. ;
  1378.  
  1379. if(sscanf(params, "uS(No Reason)[128]", id, reason)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /akill [playerid] [reason(Default: None)]");
  1380. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  1381. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  1382.  
  1383. if(_God[id] == 1)
  1384. {
  1385. _God[id] = 0;
  1386. }
  1387.  
  1388. SetPlayerHealth(id, 0.0);
  1389. format(string, sizeof(string), "** %s(%d) has been killed by Administrator %s(%d) (Reason: %s)", pName(id), id, pName(playerid), playerid, reason);
  1390. SendClientMessageToAll(COLOR_GREY, string);
  1391. return 1;
  1392. }
  1393.  
  1394. CMD:prison(playerid, params[])
  1395. {
  1396. LoginCheck(playerid);
  1397. LevelCheck(playerid, 2);
  1398.  
  1399. new id, sec, reason[128], string[250];
  1400. if(sscanf(params, "uiS(None)[128]", id, sec, reason)) return SendClientMessage(playerid, COLOR_RED, "/Prison [spielerid] [sekunden] [Grund]");
  1401. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler ist nicht Online.");
  1402. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Du kannst diesen Befehl nicht bei Admins ausführen die Rank höher sind als du.");
  1403. if(sec < 900) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Du kannst nicht unter 900 sekunden jemanden ins Prison stecken.");
  1404. if(User[id][accountJail] == 1) return SendClientMessage(playerid, COLOR_RED, "Spieler ist schon im Prison.");
  1405. if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "Du kannst dich nicht selbst ins Prison stecken.");
  1406.  
  1407. SetCameraBehindPlayer(id);
  1408. SetPlayerPos(id, 197.6661, 173.8179, 1003.0234);
  1409. SetPlayerInterior(id, 3);
  1410.  
  1411. format(string, sizeof(string), "** %s(%d) wurde von dem Administrator %s(%d) für %d Sekunden ins Prison gesteckt [%s]", pName(id), id, pName(playerid), playerid, sec, reason);
  1412. SendClientMessageToAll(COLOR_GREY, string);
  1413. SendClientMessage(id, COLOR_ORANGE, "Du wurdest von den Administratoren ins Prison gesteckt, wenn du meinst der Admin hat eine fehlentscheidung getroffen dann mach bitte einen screenshot indem du (F8) drückst und melde dich im ts bei einem Admin.");
  1414.  
  1415. #if LOG == true
  1416. format(string, sizeof(string), "%s wurde ins Prison gesteckt von %s (%d sekunden, Grund %s)", pName(id), pName(playerid), sec, reason);
  1417. SaveLog("jail.txt", string);
  1418. #endif
  1419.  
  1420. User[id][accountJail] = 1, User[id][accountJailSec] = sec;
  1421. return 1;
  1422. }
  1423.  
  1424. CMD:unprison(playerid, params[])
  1425. {
  1426. LoginCheck(playerid);
  1427. LevelCheck(playerid, 2);
  1428.  
  1429. new id, reason[128], string[250];
  1430. if(sscanf(params, "uS(None)[128]", id, reason)) return SendClientMessage(playerid, COLOR_RED, "/unprison [spielerid] [Grund]");
  1431. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler ist nicht online.");
  1432. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Du kannst diesen Befehl nicht bei Admins ausführen die Rank höher sind als du.");
  1433. if(User[id][accountJail] == 0) return SendClientMessage(playerid, COLOR_RED, "Spieler ist nicht im Prison.");
  1434. if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "Du kannst dich nicht selber rausholen.");
  1435.  
  1436. format(string, sizeof(string), "** %s(%d) wurde aus dem Prison rausgeholt von %s(%d) für %s", pName(id), id, pName(playerid), playerid, reason);
  1437. SendClientMessageToAll(COLOR_GREY, string);
  1438. SendClientMessage(id, COLOR_ORANGE, "Du wurdest aus dem Prison von den Admins rausgeholt.");
  1439.  
  1440. #if LOG == true
  1441. format(string, sizeof(string), "%s wurde aus dem Prison rausgeholt von %s für %s", pName(id), pName(playerid), reason);
  1442. SaveLog("jail.txt", string);
  1443. #endif
  1444.  
  1445. User[id][accountJail] = 0, User[id][accountJailSec] = 0;
  1446. SpawnPlayer(id);
  1447. return 1;
  1448. }
  1449.  
  1450. CMD:mute(playerid, params[])
  1451. {
  1452. LoginCheck(playerid);
  1453. LevelCheck(playerid, 2);
  1454.  
  1455. new id, sec, reason[128], string[128+50];
  1456. if(sscanf(params, "uiS(None)[128]", id, sec, reason)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /mute [playerid] [seconds] [reason]");
  1457. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  1458. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  1459. if(sec < 30) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot mute lower than 30 seconds.");
  1460. if(User[id][accountMuted] == 1) return SendClientMessage(playerid,COLOR_RED, "Syntax Error: Player already muted.");
  1461. if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on yourself.");
  1462.  
  1463. 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);
  1464. SendClientMessageToAll(COLOR_GREY, string);
  1465. 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.");
  1466.  
  1467. #if LOG == true
  1468. format(string, sizeof(string), "%s has been muted by %s (%d seconds, reason %s)", pName(id), pName(playerid), sec, reason);
  1469. SaveLog("mute.txt", string);
  1470. #endif
  1471.  
  1472. User[id][accountMuted] = 1, User[id][accountMuteSec] = sec;
  1473. return 1;
  1474. }
  1475.  
  1476. CMD:unmute(playerid, params[])
  1477. {
  1478. LoginCheck(playerid);
  1479. LevelCheck(playerid, 2);
  1480.  
  1481. new id, reason[128], string[250];
  1482. if(sscanf(params, "uS(None)[128]", id, reason)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /unmute [playerid] [reason]");
  1483. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  1484. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  1485. if(User[id][accountMuted] == 0) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not muted.");
  1486. if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on yourself.");
  1487.  
  1488. format(string, sizeof(string), "* %s(%d) has been unmuted by Administrator %s(%d) for %s", pName(id), id, pName(playerid), playerid, reason);
  1489. SendClientMessageToAll(COLOR_GREY, string);
  1490. SendClientMessage(id, COLOR_ORANGE, "You have been unmuted by an Admin.");
  1491.  
  1492. #if LOG == true
  1493. format(string, sizeof(string), "%s has been unmuted by %s", pName(id), pName(playerid));
  1494. SaveLog("mute.txt", string);
  1495. #endif
  1496.  
  1497. User[id][accountMuted] = 0, User[id][accountMuteSec] = 0;
  1498. return 1;
  1499. }
  1500.  
  1501.  
  1502. CMD:clearchat(playerid, params[])
  1503. {
  1504. LoginCheck(playerid);
  1505. LevelCheck(playerid, 2);
  1506.  
  1507. new
  1508. string[128]
  1509. ;
  1510.  
  1511. for(new i=0; i<100; i++)
  1512. {
  1513. SendClientMessageToAll(-1, " ");
  1514. }
  1515.  
  1516. format(string, sizeof string, "Administrator "orange"%s "white"has cleared the chat.", pName(playerid));
  1517. SendClientMessageToAll(-1, string);
  1518. return 1;
  1519. }
  1520.  
  1521. CMD:heal(playerid, params[])
  1522. {
  1523. LoginCheck(playerid);
  1524. LevelCheck(playerid, 2);
  1525.  
  1526. new
  1527. id,
  1528. string[130]
  1529. ;
  1530.  
  1531. if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /heal [playerid]");
  1532. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  1533.  
  1534. SetPlayerHealth(id, 100.0);
  1535. format(string, sizeof(string), "You have given Player %s a full pack of health.", pName(id));
  1536. SendClientMessage(playerid, COLOR_YELLOW, string);
  1537. format(string, sizeof(string), "Administrator %s has given you a full pack of health.", pName(playerid));
  1538. SendClientMessage(id, COLOR_YELLOW, string);
  1539. return 1;
  1540. }
  1541.  
  1542. CMD:awaffen(playerid, params[])
  1543. {
  1544. LoginCheck(playerid);
  1545. LevelCheck(playerid, 2);
  1546.  
  1547. new
  1548. ammo,
  1549. wID[32],
  1550. weap,
  1551. WeapName[32],
  1552. string[130]
  1553. ;
  1554. if(sscanf(params, "s[32]i", wID, ammo)) return SendClientMessage(playerid, COLOR_RED, "/awaffen [Waffen ID)] [Munition]");
  1555. if(ammo <= 0 || ammo > 99999) ammo = 500;
  1556. if(!isnumeric(wID)) weap = GetWeaponIDFromName(wID);
  1557. else weap = strval(wID);
  1558. if(!IsValidWeapon(weap)) return SendClientMessage(playerid, COLOR_RED, "Ungültige Waffen ID");
  1559. GetWeaponName(weap, WeapName, 32);
  1560. foreach(new i : Player)
  1561. {
  1562. GivePlayerWeapon(i, weap, ammo);
  1563. format(string, sizeof string, "~g~%s for all!", WeapName);
  1564. GameTextForPlayer(i, string, 2500, 3);
  1565. }
  1566. format(string,sizeof(string), "Administrator %s(ID:%d) hat allen Spielern die Waffe %s(%d) mit %d Munition gegeben.", pName(playerid), playerid, WeapName, weap, ammo);
  1567. SendClientMessageToAll(COLOR_YELLOW, string);
  1568. return 1;
  1569. }
  1570.  
  1571. CMD:armour(playerid, params[])
  1572. {
  1573. LoginCheck(playerid);
  1574. LevelCheck(playerid, 2);
  1575.  
  1576. new
  1577. id,
  1578. string[130]
  1579. ;
  1580.  
  1581. if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /armour [playerid]");
  1582. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  1583.  
  1584. SetPlayerArmour(id, 100.0);
  1585. format(string, sizeof(string), "You have given %s an armour.", pName(id));
  1586. SendClientMessage(playerid, COLOR_YELLOW, string);
  1587. format(string, sizeof(string), "Administrator %s has given you a full armour.", pName(playerid));
  1588. SendClientMessage(id, COLOR_YELLOW, string);
  1589. return 1;
  1590. }
  1591.  
  1592. CMD:respawncars(playerid, params[])
  1593. {
  1594. LoginCheck(playerid);
  1595. LevelCheck(playerid, 2);
  1596.  
  1597. SendClientMessage(playerid, COLOR_GREEN, "Du hast alle Fahrzeuge erfolgreich respawnt!");
  1598. GameTextForAll("~n~~n~~n~~n~~n~~n~~r~Fahrzeuge ~g~Respawnt!", 3000, 3);
  1599. for(new cars=0; cars<MAX_VEHICLES; cars++)
  1600. {
  1601. if(!VehicleOccupied(cars))
  1602. {
  1603. SetVehicleToRespawn(cars);
  1604. }
  1605. }
  1606. return 1;
  1607. }
  1608.  
  1609. CMD:tp(playerid, params[])
  1610. {
  1611. LoginCheck(playerid);
  1612. LevelCheck(playerid, 2);
  1613.  
  1614. new
  1615. id,
  1616. string[130],
  1617. Float:x,
  1618. Float:y,
  1619. Float:z
  1620. ;
  1621. if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "/tp [spielerid]");
  1622.  
  1623. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler ist nicht Online.");
  1624. if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "Du kannst dich nicht zu dir selber Teleportieren.");
  1625. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Du kannst diesen Befehl nicht an Admins ausführen die Rang höher sind als du.");
  1626.  
  1627. GetPlayerPos(playerid, x, y, z);
  1628. SetPlayerInterior(id, GetPlayerInterior(playerid));
  1629. SetPlayerVirtualWorld(id, GetPlayerVirtualWorld(playerid));
  1630.  
  1631. if(GetPlayerState(id) == 2)
  1632. {
  1633. new VehicleID = GetPlayerVehicleID(id);
  1634. SetVehiclePos(VehicleID, x+3, y, z);
  1635. LinkVehicleToInterior(VehicleID, GetPlayerInterior(playerid));
  1636. SetVehicleVirtualWorld(GetPlayerVehicleID(id), GetPlayerVirtualWorld(playerid));
  1637. }
  1638. else SetPlayerPos(id, x+2, y, z);
  1639.  
  1640. format(string, sizeof(string), "Du wurdest zum Standpunkt von dem Admin %s(ID:%d) teleportiert.", pName(playerid), playerid);
  1641. SendClientMessage(id, COLOR_YELLOW, string);
  1642. format(string, sizeof(string), "Du hast den Spieler %s(ID:%d) zu deinem Standpunkt teleportiert.", pName(id), id);
  1643. SendClientMessage(playerid, COLOR_YELLOW, string);
  1644. return 1;
  1645. }
  1646.  
  1647. CMD:tpspieler(playerid, params[])
  1648. {
  1649. LoginCheck(playerid);
  1650. LevelCheck(playerid, 2);
  1651.  
  1652. new
  1653. string[128],
  1654. id,
  1655. id2,
  1656. Float:x,
  1657. Float:y,
  1658. Float:z
  1659. ;
  1660. if(sscanf(params, "uu", id, id2)) return SendClientMessage(playerid, COLOR_RED, "/tpspieler [spielerid] zu [spielerid2]");
  1661. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Du kannst diesen Befehl nicht an einem Admin ausführen der Rank höher ist als du.");
  1662. if(User[playerid][accountAdmin] < User[id2][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Du kannst diesen Befehl nicht an einem Admin ausführen der Rank höher ist als du.");
  1663. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler ist nicht Online.");
  1664. if(id2 == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler ist nicht Online.");
  1665. if(id == playerid && id2 == playerid) return SendClientMessage(playerid, COLOR_RED, "Du kannst dich nicht zu dir selbst Teleportieren!");
  1666. GetPlayerPos(id2, x, y, z);
  1667. format(string, sizeof(string), "Du hast den Spieler %s(%d) zu Player %s(%d) Teleportiert", pName(id), id, pName(id2), id2);
  1668. SendClientMessage(playerid, COLOR_YELLOW, string);
  1669. format(string, sizeof(string), "Du wurdest zu dem Spieler %s(%d) von dem Admin %s(%d) Teleportiert", pName(id2), id2, pName(playerid), playerid);
  1670. SendClientMessage(id, COLOR_YELLOW, string);
  1671. format(string, sizeof(string), "Admin %s(%d) hat den Spieler %s(%d) zu dir Teleportiert", pName(playerid), playerid, pName(id), id);
  1672. SendClientMessage(id2, COLOR_YELLOW, string);
  1673. SetPlayerInterior(id, GetPlayerInterior(id2));
  1674. SetPlayerVirtualWorld(id, GetPlayerVirtualWorld(id2));
  1675. if(GetPlayerState(id) == 2)
  1676. {
  1677. SetVehiclePos(GetPlayerVehicleID(id), x+3, y, z);
  1678. LinkVehicleToInterior(GetPlayerVehicleID(id), GetPlayerInterior(id2));
  1679. SetVehicleVirtualWorld(GetPlayerVehicleID(id), GetPlayerVirtualWorld(id2));
  1680. }
  1681. else SetPlayerPos(id, x+2, y, z);
  1682. return 1;
  1683. }
  1684.  
  1685. //============================================================================//
  1686. // Administrative Level Three //
  1687. //============================================================================//
  1688. CMD:warnentf(playerid, params[])
  1689. {
  1690. LoginCheck(playerid);
  1691. LevelCheck(playerid, 3);
  1692.  
  1693. new
  1694. string[130],
  1695. id
  1696. ;
  1697.  
  1698. if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /remwarn [playerid]");
  1699. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  1700. if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot remove warn yourself.");
  1701. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  1702. if(User[id][accountWarn] == 0) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player has no warnings.");
  1703. User[id][accountWarn] -= 1;
  1704.  
  1705. format(string, sizeof(string), "Administrator %s(%d) has removed %s(%d) warnings (Warnings Left: %i)", pName(playerid), playerid, pName(id), id, User[id][accountWarn]);
  1706. SendClientMessageToAll(COLOR_YELLOW, string);
  1707. return 1;
  1708. }
  1709. CMD:warn(playerid, params[])
  1710. {
  1711. LoginCheck(playerid);
  1712. LevelCheck(playerid, 3);
  1713.  
  1714. new
  1715. string[128],
  1716. id,
  1717. reason[128]
  1718. ;
  1719.  
  1720. if(sscanf(params, "uS(No Reason)[128]", id, reason)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /warn [playerid] [reason]");
  1721. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  1722. if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot warn yourself.");
  1723. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  1724.  
  1725. User[id][accountWarn] += 1;
  1726.  
  1727. format(string, sizeof(string), "Administrator %s(%d) warned %s(%d) for %s (Warnings: %d)", pName(playerid), playerid, pName(id), id, reason, User[id][accountWarn]);
  1728. SendClientMessageToAll(COLOR_YELLOW, string);
  1729. return 1;
  1730. }
  1731.  
  1732. CMD:write(playerid, params[])
  1733. {
  1734. LoginCheck(playerid);
  1735. LevelCheck(playerid, 3);
  1736.  
  1737. new
  1738. Colour,
  1739. string[130]
  1740. ;
  1741. if(sscanf(params, "is[128]", Colour, params))
  1742. return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /write [color] [text]") &&
  1743. 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");
  1744. 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");
  1745.  
  1746. if(Colour == 0) { format(string,sizeof(string),"%s",params); SendClientMessageToAll(COLOR_BLACK,string);return 1;}
  1747. else if(Colour == 1) {
  1748. format(string,sizeof(string),"%s",params);SendClientMessageToAll(COLOR_WHITE,string); return 1;}
  1749. else if(Colour == 2) {
  1750. format(string,sizeof(string),"%s",params);SendClientMessageToAll(COLOR_RED,string); return 1;}
  1751. else if(Colour == 3) {
  1752. format(string,sizeof(string),"%s",params);SendClientMessageToAll(COLOR_ORANGE,string); return 1;}
  1753. else if(Colour == 4) {
  1754. format(string,sizeof(string),"%s",params);SendClientMessageToAll(COLOR_YELLOW,string); return 1;}
  1755. else if(Colour == 5) {
  1756. format(string,sizeof(string),"%s",params);SendClientMessageToAll(COLOR_GREEN,string); return 1;}
  1757. else if(Colour == 6) {
  1758. format(string,sizeof(string),"%s",params);SendClientMessageToAll(COLOR_BLUE,string); return 1;}
  1759. else if(Colour == 7) {
  1760. format(string,sizeof(string),"%s",params);SendClientMessageToAll(COLOR_PURPLE,string); return 1;}
  1761. else if(Colour == 8) {
  1762. format(string,sizeof(string),"%s",params);SendClientMessageToAll(COLOR_BROWN,string); return 1;}
  1763. else if(Colour == 9) {
  1764. format(string,sizeof(string),"%s",params);SendClientMessageToAll(COLOR_PINK,string); return 1;}
  1765. return 1;
  1766. }
  1767.  
  1768. CMD:force(playerid, params[])
  1769. {
  1770. LoginCheck(playerid);
  1771. LevelCheck(playerid, 3);
  1772.  
  1773. new
  1774. string[130],
  1775. id
  1776. ;
  1777.  
  1778. if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /force [playerid]");
  1779. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  1780. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  1781.  
  1782. format(string, sizeof(string), "You have force Player %s(ID:%d) to goto class selection.", pName(id), id);
  1783. SendClientMessage(playerid, COLOR_YELLOW, string);
  1784.  
  1785. format(string, sizeof(string), "Admin %s(ID:%d) force you to goto class selection.", pName(playerid), playerid);
  1786. SendClientMessage(id, COLOR_YELLOW, string);
  1787.  
  1788. SetPlayerHealth(id, 0.0);
  1789. ForceClassSelection(id);
  1790. return 1;
  1791. }
  1792.  
  1793. CMD:healall(playerid, params[])
  1794. {
  1795. LoginCheck(playerid);
  1796. LevelCheck(playerid, 3);
  1797.  
  1798. new
  1799. string[130]
  1800. ;
  1801.  
  1802. foreach(new i : Player)
  1803. {
  1804. if(i != playerid)
  1805. {
  1806. SetPlayerHealth(i, 100.0);
  1807. }
  1808. }
  1809. format(string, sizeof(string), "Admin %s(ID:%d) has heal all players.", pName(playerid), playerid);
  1810. SendClientMessageToAll(COLOR_YELLOW, string);
  1811. return 1;
  1812. }
  1813.  
  1814. CMD:setfstyle(playerid, params[])
  1815. {
  1816. LoginCheck(playerid);
  1817. LevelCheck(playerid, 3);
  1818.  
  1819. new
  1820. string[128],
  1821. id,
  1822. fstyle,
  1823. style[50]
  1824. ;
  1825.  
  1826. if(sscanf(params, "ui", id, fstyle)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /setfstyle [playerid] [styles]") &&
  1827. SendClientMessage(playerid, COLOR_GREY, "Styles: [0]Normal, [1]Boxing, [2]Kungfu, [3]Kneehead, [4]Grabkick, [5]Elbow");
  1828. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  1829. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  1830. if(fstyle > 5) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Inavlid Fighting Style.");
  1831.  
  1832. switch(fstyle)
  1833. {
  1834. case 0:
  1835. {
  1836. SetPlayerFightingStyle(id, 4);
  1837. style = "Normal";
  1838. }
  1839. case 1:
  1840. {
  1841. SetPlayerFightingStyle(id, 5);
  1842. style = "Boxing";
  1843. }
  1844. case 2:
  1845. {
  1846. SetPlayerFightingStyle(id, 6);
  1847. style = "Kung Fu";
  1848. }
  1849. case 3:
  1850. {
  1851. SetPlayerFightingStyle(id, 7);
  1852. style = "Kneehead";
  1853. }
  1854. case 4:
  1855. {
  1856. SetPlayerFightingStyle(id, 15);
  1857. style = "Grabkick";
  1858. }
  1859. case 5:
  1860. {
  1861. SetPlayerFightingStyle(id, 16);
  1862. style = "Elbow";
  1863. }
  1864. }
  1865. format(string, sizeof(string), "You have set %s(ID:%d) fighting style to '%s'", pName(id), id, style);
  1866. SendClientMessage(playerid, COLOR_YELLOW, string);
  1867. format(string, sizeof(string), "Admin %s(ID:%d) has set your fighting style to '%s'", pName(playerid), playerid, style);
  1868. SendClientMessage(id, COLOR_YELLOW, string);
  1869. return 1;
  1870. }
  1871.  
  1872. CMD:sethealth(playerid, params[])
  1873. {
  1874. LoginCheck(playerid);
  1875. LevelCheck(playerid, 3);
  1876.  
  1877. new
  1878. string[130],
  1879. id,
  1880. hp
  1881. ;
  1882.  
  1883. if(sscanf(params, "ud", id, hp)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /sethealth [playerid] [heatlh]");
  1884. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  1885. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  1886.  
  1887. new Float:hp2 = float(hp);
  1888.  
  1889. SetPlayerHealth(id, hp2);
  1890.  
  1891. format(string, sizeof(string), "You have set Player %s(ID:%d) health to %d", pName(id), id, floatround(hp2));
  1892. SendClientMessage(playerid, COLOR_YELLOW, string);
  1893. format(string, sizeof(string), "Admin %s(ID:%d) has set your health to %d", pName(playerid), playerid, floatround(hp2));
  1894. SendClientMessage(id, COLOR_YELLOW, string);
  1895. return 1;
  1896. }
  1897.  
  1898. CMD:gibarmour(playerid, params[])
  1899. {
  1900. LoginCheck(playerid);
  1901. LevelCheck(playerid, 3);
  1902.  
  1903. new
  1904. string[130],
  1905. id,
  1906. armour
  1907. ;
  1908.  
  1909. if(sscanf(params, "ud", id, armour)) return SendClientMessage(playerid, COLOR_RED, "/gibarmour [spielerid] [armour]");
  1910. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler ist nicht Online.");
  1911.  
  1912. new Float:ar = float(armour);
  1913. SetPlayerArmour(id, ar);
  1914.  
  1915. format(string, sizeof(string), "Du hast dem Spieler %s(ID:%d) eine Rüstung mit dem Wert %d deff gegeben", pName(id), id, floatround(ar));
  1916. SendClientMessage(playerid, COLOR_YELLOW, string);
  1917. format(string, sizeof(string), "Administrator %s(ID:%d) Hat den Wert deiner Rüstung auf %d deff geändert", pName(playerid), playerid, floatround(ar));
  1918. SendClientMessage(id, COLOR_YELLOW, string);
  1919. return 1;
  1920. }
  1921.  
  1922.  
  1923. CMD:allarmour(playerid, params[])
  1924. {
  1925. LoginCheck(playerid);
  1926. LevelCheck(playerid, 3);
  1927.  
  1928. new
  1929. string[130]
  1930. ;
  1931. foreach(new i : Player)
  1932. {
  1933. if(i != playerid)
  1934. {
  1935. SetPlayerArmour(i, 100.0);
  1936. }
  1937. }
  1938. format(string, sizeof(string), "Administrator %s(ID:%d) hat jedem Spieler eine Rüstung gegeben.", pName(playerid), playerid);
  1939. SendClientMessageToAll(COLOR_YELLOW, string);
  1940. return 1;
  1941. }
  1942.  
  1943. CMD:alltp(playerid, params[])
  1944. {
  1945. LoginCheck(playerid);
  1946. LevelCheck(playerid, 2);
  1947.  
  1948. new Float:x,
  1949. Float:y,
  1950. Float:z,
  1951. string[130],
  1952. interior = GetPlayerInterior(playerid)
  1953. ;
  1954.  
  1955. GetPlayerPos(playerid, x, y, z);
  1956. foreach(new i : Player)
  1957. {
  1958. if(i != playerid)
  1959. {
  1960. PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
  1961. SetPlayerPos(i, x+(playerid/4)+1, y+(playerid/4), z);
  1962. SetPlayerInterior(i, interior);
  1963. SetPlayerVirtualWorld(i, GetPlayerVirtualWorld(playerid));
  1964. }
  1965. }
  1966.  
  1967. format(string, sizeof(string), "Administrator %s(ID:%d) hat alle Spieler zur seiner Position teleportier !", pName(playerid), playerid);
  1968. SendClientMessageToAll(COLOR_YELLOW, string);
  1969. return 1;
  1970. }
  1971.  
  1972. CMD:freeze(playerid, params[])
  1973. {
  1974. LoginCheck(playerid);
  1975. LevelCheck(playerid, 3);
  1976.  
  1977. new
  1978. string[130],
  1979. id,
  1980. reason[128]
  1981. ;
  1982. if(sscanf(params, "uS(No Reason)[128]", id, reason)) return SendClientMessage(playerid, COLOR_RED, "/freeze [spielerid] [Grund]");
  1983. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler nicht Online.");
  1984. if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "Du kannst dich nicht selbst freezen.");
  1985. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Du kannst diesen Befehl nicht an Admins ausführen die Rank höher sind als du.");
  1986.  
  1987. TogglePlayerControllable(id, false);
  1988.  
  1989. format(string, sizeof(string), "Du hast den Spieler %s(%d)gefreezt (Grund: %s)", pName(id), id, reason);
  1990. SendClientMessage(playerid, COLOR_YELLOW, string);
  1991. format(string, sizeof(string), "Administrator %s(ID:%d) hat dich gefreezt (Grund: %s)", pName(playerid), playerid, reason);
  1992. SendClientMessage(id, COLOR_YELLOW, string);
  1993. return 1;
  1994. }
  1995.  
  1996. CMD:gibwaffen(playerid, params[])
  1997. {
  1998. LoginCheck(playerid);
  1999. LevelCheck(playerid, 3);
  2000.  
  2001. new
  2002. id,
  2003. ammo,
  2004. wID[32],
  2005. weap,
  2006. WeapName[32],
  2007. string[130]
  2008. ;
  2009.  
  2010. if(sscanf(params, "us[32]i", id, wID, ammo)) return SendClientMessage(playerid, COLOR_RED, "/gibwaffen [spielerid] [Waffen Name] [Munition]");
  2011. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler ist nicht Online.");
  2012. if(ammo <= 0 || ammo > 99999) ammo = 500;
  2013. if(!isnumeric(wID)) weap = GetWeaponIDFromName(wID);
  2014. else weap = strval(wID);
  2015. if(!IsValidWeapon(weap)) return SendClientMessage(playerid, COLOR_RED, "ungültiger Waffen Name.");
  2016. GetWeaponName(weap, WeapName, 32);
  2017.  
  2018. format(string, sizeof(string), "Du hast %s die Waffe %s(%d) mit %d Munition gegeben.", WeapName, weap, ammo, pName(id));
  2019. SendClientMessage(playerid, COLOR_YELLOW, string);
  2020. format(string,sizeof(string),"Administrator %s hat dir die Waffe %s(%d) mit %d Munition gegeben.", pName(playerid), WeapName, weap, ammo);
  2021. SendClientMessage(id, COLOR_YELLOW, string);
  2022. GivePlayerWeapon(id, weap, ammo);
  2023. return 1;
  2024. }
  2025.  
  2026. CMD:unban(playerid, params[])
  2027. {
  2028. LoginCheck(playerid);
  2029. LevelCheck(playerid, 3);
  2030.  
  2031. new
  2032. string[150],
  2033. Account[24],
  2034. DBResult:Result,
  2035. Query[129],
  2036. fIP[30]
  2037. ;
  2038. if(sscanf(params, "s[24]", Account)) return SendClientMessage(playerid, COLOR_RED, "/unban [Account Name]");
  2039. format(Query, 129, "SELECT * FROM `bans` WHERE `username` = '%s'", Account);
  2040. Result = db_query(Database, Query);
  2041.  
  2042. if(db_num_rows(Result))
  2043. {
  2044. db_get_field_assoc(Result, "ip", fIP, 30);
  2045.  
  2046. format(Query, 129, "DELETE FROM `bans` WHERE `username` = '%s'", Account);
  2047. Result = db_query(Database, Query);
  2048. db_free_result(Result);
  2049.  
  2050. format(string, sizeof string, "Administrator %s hat den Spieler %s gebannt.", pName(playerid), Account);
  2051. SendClientMessageToAll(COLOR_YELLOW, string);
  2052. print(string);
  2053.  
  2054. #if LOG == true
  2055. SaveLog("banlog.txt", string);
  2056. #endif
  2057. }
  2058. else
  2059. {
  2060. db_free_result(Result);
  2061. SendClientMessage(playerid, COLOR_RED, "Spieler nicht in der Datenbank(Bannliste) gefunden.");
  2062. return 1;
  2063. }
  2064. return 1;
  2065. }
  2066.  
  2067. CMD:ban(playerid, params[])
  2068. {
  2069. LoginCheck(playerid);
  2070. LevelCheck(playerid, 3);
  2071.  
  2072. new
  2073. string[128],
  2074. id,
  2075. reason[128],
  2076. when[128],
  2077. ban_hr, ban_min, ban_sec, ban_month, ban_days, ban_years
  2078. ;
  2079.  
  2080. gettime(ban_hr, ban_min, ban_sec);
  2081. getdate(ban_years, ban_month, ban_days);
  2082.  
  2083. if(sscanf(params, "uS(No Reason)[128]", id, reason)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /ban [spielerid] [Grund(Standartt: No Reason)]");
  2084. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler ist nicht Online.");
  2085. if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "Du kannst dich nicht selber bannen.");
  2086. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Du kannst diesen Befehl nicht an Admins ausführen die Rang höher sind als du.");
  2087.  
  2088. format(when, 128, "%02d/%02d/%d %02d:%02d:%02d", ban_month, ban_days, ban_years, ban_hr, ban_min, ban_sec);
  2089.  
  2090. format(string, sizeof(string), "** %s(ID:%d) wurde von dem Administrator %s(%d)gebannt (Grund: %s)", pName(id), id, pName(playerid), playerid, reason);
  2091. SendClientMessageToAll(COLOR_GREY, string);
  2092. printf(string);
  2093. #if LOG == true
  2094. SaveLog("banlog.txt", string);
  2095. #endif
  2096. format(string, sizeof(string), "You have banned %s(%d) for %s.", pName(id), id, reason);
  2097. SendClientMessage(playerid, COLOR_YELLOW, string);
  2098. format(string, sizeof(string), "Du wurdest von dem Administrator %s(%d) gebannt (Grund: %s)", pName(playerid), playerid, reason);
  2099. SendClientMessage(id, COLOR_YELLOW, string);
  2100. BanAccount(id, pName(playerid), reason);
  2101. ShowBan(id, pName(playerid), reason, when);
  2102. KickDelay(id);
  2103. return 1;
  2104. }
  2105.  
  2106. CMD:unfreeze(playerid, params[])
  2107. {
  2108. LoginCheck(playerid);
  2109. LevelCheck(playerid, 3);
  2110.  
  2111. new
  2112. string[128],
  2113. id
  2114. ;
  2115.  
  2116. if(sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_RED, "/unfreeze [spielerid]");
  2117. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler ist nicht Online.");
  2118. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Du kannst diesen Befehl nicht an Admins ausführen die Rank höher sind als du.");
  2119.  
  2120. TogglePlayerControllable(id, true);
  2121.  
  2122. format(string, sizeof(string), "Du hast den Spieler %s(%d) unfreezt", pName(id), id);
  2123. SendClientMessage(playerid, COLOR_YELLOW, string);
  2124. format(string, sizeof(string), "Administrator %s(%d) hat dich unfreezt du kannst dich wieder normal Bewegen.", pName(playerid), playerid);
  2125. SendClientMessage(id, COLOR_YELLOW, string);
  2126. return 1;
  2127. }
  2128.  
  2129. CMD:offlineban(playerid, params[])
  2130. {
  2131. LoginCheck(playerid);
  2132. LevelCheck(playerid, 4);
  2133.  
  2134. new
  2135. string[150],
  2136. name[24],
  2137. reason[128],
  2138. Query[256],
  2139. admin,
  2140. ip[20],
  2141. DBResult:Result,
  2142. ban_hr, ban_min, ban_sec, ban_month, ban_days, ban_years
  2143. ;
  2144.  
  2145. gettime(ban_hr, ban_min, ban_sec);
  2146. getdate(ban_years, ban_month, ban_days);
  2147.  
  2148. if(sscanf(params, "s[24]s[128]", name, reason)) return SendClientMessage(playerid, COLOR_RED, "/offlineban [Name] [Grund]");
  2149. foreach(new i : Player)
  2150. {
  2151. if(strcmp(pName(i), name, true) == 0)
  2152. {
  2153. SendClientMessage(playerid, COLOR_RED, "Der Spieler den du Offlinebannen wolltest ist Online, benutze statdessen /ban.");
  2154. return 1;
  2155. }
  2156. }
  2157. format(Query, sizeof(Query), "SELECT * FROM `users` WHERE `username` = '%s'", DB_Escape(name));
  2158. Result = db_query(Database, Query);
  2159. if(db_num_rows(Result))
  2160. {
  2161. db_get_field_assoc(Result, "admin", Query, 6);
  2162. admin = strval(Query);
  2163. db_get_field_assoc(Result, "IP", ip, 20);
  2164.  
  2165. if(User[playerid][accountAdmin] < admin)
  2166. {
  2167. SendClientMessage(playerid, COLOR_RED, "Du kannst diesen Befehl nicht an Admins ausführen die Rank höher sind als du.");
  2168.  
  2169. #if LOG == true
  2170. format(string, sizeof(string), "%s hat versucht den Spieler offline zu bannen %s aber fehlgeschlagen für %s", pName(playerid), name, reason);
  2171. SaveLog("admin.txt", string);
  2172. #endif
  2173. return 1;
  2174. }
  2175.  
  2176. BanAccountEx(name, ip, pName(playerid), reason);
  2177.  
  2178. format(string, sizeof(string), "** %s wurde von dem Administrator %s(%d)Offline gebannt (Grund: %s)", name, pName(playerid), playerid, reason);
  2179. SendClientMessageToAll(COLOR_GREY, string);
  2180. printf(string);
  2181. #if LOG == true
  2182. SaveLog("banlog.txt", string);
  2183. #endif
  2184. }
  2185. else
  2186. {
  2187. SendClientMessage(playerid, COLOR_RED, "Es gibt keinen Spieler mit diesen Daten in der Datenbank.");
  2188. }
  2189. db_free_result(Result);
  2190. return 1;
  2191. }
  2192.  
  2193. //============================================================================//
  2194. // Administrative Level Four //
  2195. //============================================================================//
  2196.  
  2197. CMD:setinterior(playerid, params[])
  2198. {
  2199. LoginCheck(playerid);
  2200. LevelCheck(playerid, 4);
  2201.  
  2202. new
  2203. string[130],
  2204. id,
  2205. interior
  2206. ;
  2207.  
  2208. if(sscanf(params, "ui", id, interior)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /setinterior [playerid] [interior]");
  2209. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not connected.");
  2210. if(User[playerid][accountAdmin] < User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You cannot use this command on higher admin.");
  2211. SetPlayerInterior(id, interior);
  2212. format(string, sizeof(string), "Administrator %s has set your interior to %d.", pName(playerid), interior);
  2213. SendClientMessage(id, COLOR_ORANGE, string);
  2214. format(string, sizeof(string), "You have set Player %s's interior to %d.", pName(id), interior);
  2215. SendClientMessage(playerid, COLOR_ORANGE, string);
  2216. return 1;
  2217. }
  2218.  
  2219.  
  2220. CMD:restart(playerid, params[])
  2221. {
  2222. new
  2223.  
  2224. time
  2225. ;
  2226.  
  2227. LoginCheck(playerid);
  2228. LevelCheck(playerid, 4);
  2229.  
  2230. if(sscanf(params, "I(0)", time)) return SendClientMessage(playerid, COLOR_RED, "/restart [Restart Timer(optional)") &&
  2231. SendClientMessage(playerid, -1, "Tipp: Trage als Timer nichts ein für einen schnellen Restart");
  2232.  
  2233. if(time < 10 && time !=0) return SendClientMessage(playerid, COLOR_RED, "Der Restart kann nicht unter 10min dauern.");
  2234. return 1;
  2235. }
  2236.  
  2237. CMD:setallinterior(playerid, params[])
  2238. {
  2239. LoginCheck(playerid);
  2240. LevelCheck(playerid, 4);
  2241.  
  2242. new
  2243. id,
  2244. string[130]
  2245. ;
  2246. if(sscanf(params, "i", id)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /setallinterior [interior]");
  2247. foreach(new i : Player)
  2248. {
  2249. PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
  2250. SetPlayerInterior(i, id);
  2251. }
  2252. format(string, sizeof(string), "Admin %s(ID:%d) has set all players interior to \"%d\"", pName(playerid), playerid, id);
  2253. SendClientMessageToAll(COLOR_YELLOW, string);
  2254. return 1;
  2255. }
  2256.  
  2257. CMD:aexplode(playerid, params[])
  2258. {
  2259. LoginCheck(playerid);
  2260. LevelCheck(playerid, 5);
  2261.  
  2262. new
  2263. string[130],
  2264. Float:x,
  2265. Float:y,
  2266. Float:z
  2267. ;
  2268.  
  2269. foreach(new i : Player)
  2270. {
  2271. if(i != playerid)
  2272. {
  2273. GetPlayerPos(i, x, y, z);
  2274. CreateExplosion(x, y, z, 7, 1.00);
  2275. }
  2276. }
  2277.  
  2278. format(string, sizeof(string), "Administrator %s(ID:%d) hat alle Spieler zum explodieren gebracht :D.", pName(playerid), playerid);
  2279. SendClientMessageToAll(COLOR_YELLOW, string);
  2280. printf(string);
  2281. return 1;
  2282. }
  2283.  
  2284. CMD:akick(playerid, params[])
  2285. {
  2286. LoginCheck(playerid);
  2287. LevelCheck(playerid, 4);
  2288.  
  2289. new
  2290. string[130]
  2291. ;
  2292.  
  2293. foreach(new i : Player)
  2294. {
  2295. if(i != playerid)
  2296. {
  2297. KickDelay(i);
  2298. }
  2299.  
  2300. }
  2301.  
  2302. format(string, sizeof(string), "Administrator %s(ID:%d) hat alle Spieler gekickt.", pName(playerid), playerid);
  2303. SendClientMessageToAll(COLOR_YELLOW, string);
  2304. printf(string);
  2305. #if LOG == true
  2306. SaveLog("kicklog.txt", string);
  2307. #endif
  2308. return 1;
  2309. }
  2310.  
  2311. CMD:awaffenentf(playerid, params[])
  2312. {
  2313. LoginCheck(playerid);
  2314. LevelCheck(playerid, 4);
  2315.  
  2316. new
  2317. string[128]
  2318. ;
  2319.  
  2320. foreach(new i : Player)
  2321. {
  2322. ResetPlayerWeapons(i);
  2323. }
  2324. format(string, sizeof(string), "Administrator %s(ID:%d) hat die Waffen aller Spieler entfernt.", pName(playerid), playerid);
  2325. SendClientMessageToAll(COLOR_YELLOW, string);
  2326. return 1;
  2327. }
  2328.  
  2329. CMD:alevel(playerid, params[])
  2330. {
  2331. LoginCheck(playerid);
  2332. LevelCheck(playerid, 4);
  2333.  
  2334. new
  2335. id,
  2336. string[130]
  2337. ;
  2338. if(sscanf(params, "i", id)) return SendClientMessage(playerid, COLOR_RED, "/alllevel [level]");
  2339. foreach(new i : Player)
  2340. {
  2341. if(i != playerid)
  2342. {
  2343. PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
  2344. SetPlayerScore(i, GetPlayerScore(i) + id);
  2345. }
  2346. }
  2347.  
  2348. format(string, sizeof(string), "Administrator %s(ID:%d) hat allen Spielern Level \"%d\ gegeben"", pName(playerid), playerid, id);
  2349. SendClientMessageToAll(COLOR_YELLOW, string);
  2350. return 1;
  2351. }
  2352.  
  2353. CMD:settime(playerid, params[])
  2354. {
  2355. LoginCheck(playerid);
  2356. LevelCheck(playerid, 4);
  2357.  
  2358. new
  2359. id,
  2360. string[128]
  2361. ;
  2362.  
  2363. if(sscanf(params, "i", id)) return SendClientMessage(playerid, COLOR_RED, "/settime [time(0-23)]");
  2364. if(id < 0 || id > 23) return SendClientMessage(playerid, COLOR_RED, "Ungueltige Uhrzeit (0-23).");
  2365. foreach(new i : Player)
  2366. {
  2367. PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
  2368. SetPlayerTime(i, id, 0);
  2369. }
  2370.  
  2371. format(string, sizeof(string), "Admin %s(ID:%d) has set all players time to \"%d:00\"", pName(playerid), playerid, id);
  2372. SendClientMessageToAll(COLOR_YELLOW, string);
  2373. return 1;
  2374. }
  2375.  
  2376. CMD:ageld(playerid, params[])
  2377. {
  2378. LoginCheck(playerid);
  2379. LevelCheck(playerid, 4);
  2380.  
  2381. new
  2382. id,
  2383. string[130]
  2384. ;
  2385. if(sscanf(params, "i", id)) return SendClientMessage(playerid, COLOR_RED, "/ageld [geld]");
  2386. foreach(new i : Player)
  2387. {
  2388. if(i != playerid)
  2389. {
  2390. PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
  2391. GivePlayerMoney(i, id);
  2392. }
  2393. }
  2394.  
  2395. format(string, sizeof(string), "Admin %s(ID:%d) hat allen Spielern \"$%d\ gegeben"", pName(playerid), playerid, id);
  2396. SendClientMessageToAll(COLOR_YELLOW, string);
  2397. return 1;
  2398. }
  2399.  
  2400. CMD:setweather(playerid, params[])
  2401. {
  2402. LoginCheck(playerid);
  2403. LevelCheck(playerid, 4);
  2404.  
  2405. new
  2406. id,
  2407. string[128]
  2408. ;
  2409. if(sscanf(params, "i", id)) return SendClientMessage(playerid, COLOR_RED, "/setweather [weather(0-45)]");
  2410. if(id < 0 || id > 45) return SendClientMessage(playerid, COLOR_RED, "Ungültige Wetter ID! (0-45)");
  2411. foreach(new i : Player)
  2412. {
  2413. PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
  2414. SetPlayerWeather(i, id);
  2415. }
  2416. format(string, sizeof(string), "Das Wetter wurde geändert \"%d\"", pName(playerid), playerid, id);
  2417. SendClientMessageToAll(COLOR_YELLOW, string);
  2418. return 1;
  2419. }
  2420.  
  2421. //============================================================================//
  2422. // Administrative Level Five //
  2423. //============================================================================//
  2424.  
  2425. CMD:explode(playerid, params[])
  2426. {
  2427. LoginCheck(playerid);
  2428. LevelCheck(playerid, 5);
  2429.  
  2430. new string[128],
  2431. id,
  2432. Float:x,
  2433. Float:y,
  2434. Float:z,
  2435. reason[128]
  2436. ;
  2437.  
  2438. if(sscanf(params, "uS(N/A)[128]", id, reason)) return SendClientMessage(playerid, COLOR_RED, "/explode [spielerid] [Grund(Standart: N/A)]");
  2439. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler ist nicht Online.");
  2440.  
  2441. GetPlayerPos(id, x, y, z);
  2442. format(string, sizeof(string), "** %s(%d) wurde von dem Administrator explodiert %s [Grund: %s]", pName(id), id, pName(playerid), reason);
  2443. SendClientMessageToAll(COLOR_GREY, string);
  2444.  
  2445. #if LOG == true
  2446. SaveLog("explode.txt", string);
  2447. #endif
  2448.  
  2449. CreateExplosion(x, y, z, 7, 1.00);
  2450. return 1;
  2451. }
  2452.  
  2453. CMD:setgeld(playerid, params[])
  2454. {
  2455. LoginCheck(playerid);
  2456. LevelCheck(playerid, 5);
  2457.  
  2458. new
  2459. id,
  2460. string[128],
  2461. amount
  2462. ;
  2463.  
  2464. if(sscanf(params, "ui", id, amount)) return SendClientMessage(playerid, COLOR_RED, "/setgeld [spielerid] [cash]");
  2465. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler ist nicht Online.");
  2466.  
  2467. ResetPlayerMoney(id);
  2468. GivePlayerMoney(id, amount);
  2469. format(string, sizeof(string), "Du hast den Geldbetrag von %s's zu $%i gemacht.", pName(id), amount);
  2470. SendClientMessage(playerid, COLOR_YELLOW, string);
  2471. format(string, sizeof(string), "Administrator %s hat dein Geldbetrag zu $%i gemacht.", pName(playerid), amount);
  2472. SendClientMessage(id, COLOR_YELLOW, string);
  2473.  
  2474. #if LOG == true
  2475. format(string, sizeof string, "Administrator %s hat den Geldbetrag von %s's zu $%i gemacht", pName(playerid), pName(id), amount);
  2476. SaveLog("set.txt", string);
  2477. #endif
  2478. return 1;
  2479. }
  2480.  
  2481. CMD:setlevel(playerid, params[])
  2482. {
  2483. LoginCheck(playerid);
  2484. LevelCheck(playerid, 5);
  2485.  
  2486. new
  2487. id,
  2488. string[128],
  2489. amount
  2490. ;
  2491.  
  2492. if(sscanf(params, "ui", id, amount)) return SendClientMessage(playerid, COLOR_RED, "/setlevel [spielerid] [level]");
  2493. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler ist nicht Online.");
  2494.  
  2495. SetPlayerScore(id, amount);
  2496. format(string, sizeof(string), "Du hast das Level %s's zu %i geändert.", pName(id), amount);
  2497. SendClientMessage(playerid, COLOR_YELLOW, string);
  2498. format(string, sizeof(string), "Administrator %s hat dein Level zu %i geändert.", pName(playerid), amount);
  2499. SendClientMessage(id, COLOR_YELLOW, string);
  2500.  
  2501. #if LOG == true
  2502. format(string, sizeof string, "Administrator %s hat das Level von %s's zu %i gemacht", pName(playerid), pName(id), amount);
  2503. SaveLog("set.txt", string);
  2504. #endif
  2505. return 1;
  2506. }
  2507.  
  2508. CMD:jetpack(playerid, params[])
  2509. {
  2510. LoginCheck(playerid);
  2511. LevelCheck(playerid, 5);
  2512.  
  2513. new
  2514. id,
  2515. string[130]
  2516. ;
  2517.  
  2518. if(!sscanf(params, "u", id))
  2519. {
  2520. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler ist nicht Online.");
  2521. SetPlayerSpecialAction(id, SPECIAL_ACTION_USEJETPACK);
  2522. format(string, sizeof(string), "Du hast dem Spieler %s(ID:%d) ein Jetpack gegeben.", pName(id), id);
  2523. SendClientMessage(playerid, COLOR_YELLOW, string);
  2524. format(string, sizeof(string), "Administrator %s(ID:%d) hat dir ein Jetpack gegeben.", pName(playerid), playerid);
  2525. SendClientMessage(id, COLOR_YELLOW, string);
  2526. }
  2527. else
  2528. {
  2529. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK);
  2530. SendClientMessage(playerid, COLOR_YELLOW, "Jetpack Spawned!");
  2531. SendClientMessage(playerid, -1, "Du willst anderen Spieler ein Jetpack geben? Dann benutze "orange"/jetpack [playerid]");
  2532. }
  2533. return 1;
  2534. }
  2535.  
  2536. CMD:acctot(playerid, params[])
  2537. {
  2538. LoginCheck(playerid);
  2539. LevelCheck(playerid, 5);
  2540.  
  2541. new
  2542. Account[MAX_PLAYER_NAME],
  2543. Reason[100],
  2544. string[128]
  2545. ;
  2546. if(sscanf(params, "s[24]s[100]", Account, Reason)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /acctot [Account Name] [Grund]");
  2547. if(DataExist(Account))
  2548. {
  2549. if(!strcmp(pName(playerid), Account, false))
  2550. return SendClientMessage(playerid, COLOR_RED, "Du kannst nicht dein Acc selber löschen!");
  2551.  
  2552. foreach(new i : Player)
  2553. {
  2554. if(strcmp(Account, pName(i), true) == 0)
  2555. {
  2556. SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player is online, fail to delete the account.");
  2557. return 1;
  2558. }
  2559. }
  2560.  
  2561. new Query[128+50];
  2562. format(Query, 100, "DELETE FROM `users` WHERE `username` = '%s'", Account);
  2563. db_query(Database, Query);
  2564. db_free_result(db_query(Database, Query));
  2565.  
  2566. format(string, 128, "Admin %s(ID: %d) hat den Account %s's getötet [Grund: %s]", pName(playerid), playerid, Account, Reason);
  2567. SendClientMessageToAll(COLOR_YELLOW, string);
  2568. SaveLog("account.txt", string);
  2569.  
  2570. format(string, 128, "Du hast den Account %s's erfolgreich getötet [Grund: %s]", Account, Reason);
  2571. SendClientMessage(playerid, COLOR_YELLOW, string);
  2572. }
  2573. else
  2574. {
  2575. SendClientMessage(playerid, COLOR_RED, "Account wurde in der Datenbank nicht gefunden!");
  2576. }
  2577. return 1;
  2578. }
  2579.  
  2580. CMD:adminrank(playerid, params[])
  2581. {
  2582. new
  2583. string[128],
  2584. id,
  2585. level
  2586. ;
  2587.  
  2588. LoginCheck(playerid);
  2589. LevelCheck(playerid, 5);
  2590.  
  2591. if(sscanf(params, "ui", id, level)) return SendClientMessage(playerid, COLOR_RED, "/adminrank [spielerid] [level(0/4)]");
  2592. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler ist nicht Online.");
  2593. if(level < 0 || level > 4) return SendClientMessage(playerid, COLOR_RED, "Der adminrank darf nicht unter null und über 4 sein.");
  2594. if(level == User[id][accountAdmin]) return SendClientMessage(playerid, COLOR_RED, "Spieler ist schon in diesem Adminrank.");
  2595. if(User[id][accountLogged] == false) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Player not logged in.");
  2596.  
  2597. if(User[id][accountAdmin] < level)
  2598. {
  2599. format(string, 128, "Du wurdest zum Adminrank %d befördert von [%s].", level, pName(playerid));
  2600. SendClientMessage(id, COLOR_YELLOW, string);
  2601. format(string, 128, "Du hast %s zum Adminrank %d befördert.", pName(id), level);
  2602. SendClientMessage(playerid, COLOR_YELLOW, string);
  2603. }
  2604. else if(User[id][accountAdmin] > level)
  2605. {
  2606. format(string, 128, "Du wurdest zum Adminrank %d degradiert von [%s].", level, pName(playerid));
  2607. SendClientMessage(id, COLOR_YELLOW, string);
  2608. format(string, 128, "Du hast %s zum Adminrank %d degradiert.", pName(id), level);
  2609. SendClientMessage(playerid, COLOR_YELLOW, string);
  2610. }
  2611.  
  2612. User[id][accountAdmin] = level;
  2613.  
  2614. #if LOG == true
  2615. format(string, sizeof string, "Administrator %s hat %s's adminrank zum %d gemacht", pName(playerid), pName(id), level);
  2616. SaveLog("account.txt", string);
  2617. #endif
  2618.  
  2619. SaveData(id); //Saving the whole data - Neater version than previously.
  2620. return 1;
  2621. }
  2622.  
  2623. //============================================================================//
  2624. // Administrative Level Zero //
  2625. //============================================================================//
  2626.  
  2627. CMD:admins(playerid, params[])
  2628. {
  2629. new string[128], count = 0;
  2630.  
  2631. SendClientMessage(playerid, -1, "** "orange"Admins Online "white"**");
  2632. foreach(new i : Player)
  2633. {
  2634. if(User[i][accountLogged] == true)
  2635. {
  2636. if(User[i][accountAdmin] >= 1)
  2637. {
  2638. format(string, sizeof(string), "(%d) %s - Level %d Admin", i, pName(i), User[i][accountAdmin]);
  2639. SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  2640. count++;
  2641. }
  2642. }
  2643. }
  2644. if(count == 0) return SendClientMessage(playerid, -1, "Kein Administrator Online.");
  2645. return 1;
  2646. }
  2647.  
  2648.  
  2649. CMD:report(playerid, params[])
  2650. {
  2651. new id, reason[128], string[136];
  2652. if(sscanf(params, "us[128]", id, reason)) return SendClientMessage(playerid, COLOR_RED, "/report [spielerid] [Grund]");
  2653. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Spieler nicht Online.");
  2654. if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "Du kannst dich nicht selbst Reporten.");
  2655. new r_hr, r_min, r_sec, r_m, r_d, r_y;
  2656. getdate(r_y, r_m, r_d);
  2657. gettime(r_hr, r_min, r_sec);
  2658.  
  2659. reportmsg[3] = reportmsg[2];
  2660. reportmsg[2] = reportmsg[1];
  2661. reportmsg[1] = reportmsg[0];
  2662.  
  2663. format(string, sizeof(string), "(%02d/%02d/%d - %02d:%02d:%02d) %s(ID:%d) hat %s(ID:%d)reportet für %s", r_m, r_d, r_y, r_hr, r_min, r_sec, pName(playerid), playerid, pName(id), id, reason);
  2664. reportmsg[0] = string;
  2665.  
  2666. format(string, sizeof(string), "REPORT: %s(ID:%d) hat %s(ID:%d) reportet für %s", pName(playerid), playerid, pName(id), id, reason);
  2667. SendAdmin(COLOR_RED, string);
  2668.  
  2669. foreach(new i : Player)
  2670. {
  2671. if(User[i][accountLogged] == true)
  2672. {
  2673. if(User[i][accountAdmin] >= 1)
  2674. {
  2675. PlayerPlaySound(i, 1085, 0.0, 0.0, 0.0);
  2676. #if ReportTD == true
  2677. TextDrawShowForPlayer(i, Textdraw0);
  2678. SetTimerEx("HideTD", 3500, false, "d", i);
  2679. #endif
  2680. }
  2681. }
  2682. }
  2683.  
  2684. format(string, sizeof(string), "Deine Beschwerde gegen %s(ID:%d) %s wurde an die Admins die Online sind gesendet.", pName(id), id, reason);
  2685. SendClientMessage(playerid, COLOR_YELLOW, string);
  2686. return 1;
  2687. }
  2688.  
  2689. #if ReportTD == true
  2690. function:HideTD(playerid)
  2691. {
  2692. return TextDrawHideForPlayer(playerid, Textdraw0);
  2693. }
  2694. #endif
  2695.  
  2696. CMD:register(playerid, params[])
  2697. {
  2698. if(User[playerid][accountLogged] == true) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: You are logged in and registered already.");
  2699.  
  2700. if(!DataExist(pName(playerid)))
  2701. {
  2702. new
  2703. string[128],
  2704. password[24],
  2705. hashpass[129]
  2706. ;
  2707.  
  2708. if(sscanf(params, "s[24]", password)) return SendClientMessage(playerid, COLOR_RED, "<!> Syntax Error: /register [password]");
  2709. if(!IsValidPassword(password)) return SendClientMessage(playerid, COLOR_RED, "Syntax Error: Invalid Password Symbols.");
  2710. 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.");
  2711.  
  2712. WP_Hash(hashpass, 129, password);
  2713.  
  2714. SetPlayerScore(playerid, STARTING_SCORE);
  2715. GivePlayerMoney(playerid, STARTING_CASH);
  2716.  
  2717. //Time = Hours, Time2 = Minutes, Time3 = Seconds
  2718. new time, time2, time3;
  2719. gettime(time, time2, time3);
  2720. new date, date2, date3;
  2721. //Date = Month, Date2 = Day, Date3 = Year
  2722. getdate(date3, date, date2);
  2723.  
  2724. format(User[playerid][accountDate], 150, "%02d/%02d/%d %02d:%02d:%02d", date, date2, date3, time, time2, time3);
  2725.  
  2726. new
  2727. query[750+1000]
  2728. ;
  2729. format(query, sizeof(query),
  2730. "INSERT INTO `users` (`username`, `IP`, `joindate`, `password`, `admin`, `kills`, `deaths`, `score`, `money`, `warn`, `mute`, `jail`, `jailsec`, `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')",\
  2731. DB_Escape(pName(playerid)),
  2732. DB_Escape(User[playerid][accountIP]),
  2733. DB_Escape(User[playerid][accountDate]),
  2734. DB_Escape(hashpass),
  2735. User[playerid][accountScore],
  2736. User[playerid][accountCash],
  2737. DB_Escape(User[playerid][accountQuestion]),
  2738. DB_Escape(User[playerid][accountAnswer])
  2739. );
  2740. db_query(Database, query);
  2741.  
  2742. User[playerid][accountLogged] = true;
  2743.  
  2744. PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  2745.  
  2746. new
  2747. count,
  2748. DBResult: result
  2749. ;
  2750. result = db_query(Database, "SELECT * FROM `users`");
  2751. count = db_num_rows(result);
  2752. db_free_result(result);
  2753.  
  2754. User[playerid][accountID] = count;
  2755. SendClientMessage(playerid, -1, "You have successfully registered from the database.");
  2756. format(string, sizeof(string), "You are now handling accountID %i from the JakAdmin3 system.", count);
  2757. SendClientMessage(playerid, COLOR_ORANGE, string);
  2758.  
  2759. SendClientMessage(playerid, COLOR_YELLOW, "Proceeding to the Security Question.");
  2760.  
  2761. 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", "");
  2762. }
  2763. else
  2764. {
  2765. SendClientMessage(playerid, COLOR_RED, "Syntax Error: You already have an account, /login instead.");
  2766. }
  2767. return 1;
  2768. }
  2769.  
  2770. CMD:login(playerid, params[])
  2771. {
  2772. if(User[playerid][accountLogged] == true) return SendClientMessage(playerid, COLOR_RED, "Du hast dich erfolgreich eingeloggt.");
  2773.  
  2774. if(DataExist(pName(playerid)))
  2775. {
  2776. new
  2777. hashp[129],
  2778. string[900],
  2779. password[24]
  2780. ;
  2781.  
  2782. if(sscanf(params, "s[24]", password)) return SendClientMessage(playerid, COLOR_RED, "/login [password]");
  2783.  
  2784. if(strcmp(password, "forget", true) == 0)
  2785. {
  2786. format(string, sizeof(string), ""grey"You have forgotten your password? If that's the case, answer the question you set on your account and you'll access your account.\n\n%s\n\nAnswer?\nPress Quit if you are willing to quit.", User[playerid][accountQuestion]);
  2787. SD(playerid, DIALOG_FORGET, DI, ""lightblue"Security Question", string, "Answer", "Quit");
  2788. return 1;
  2789. }
  2790.  
  2791. WP_Hash(hashp, 129, password);
  2792. if(!strcmp(hashp, User[playerid][accountPassword], false))
  2793. {
  2794. LoginPlayer(playerid);
  2795. }
  2796. else
  2797. {
  2798. User[playerid][WarnLog]++;
  2799.  
  2800. if(User[playerid][WarnLog] == 3)
  2801. {
  2802. SD(playerid, DIALOG_BEGIN, DM, ""lightblue"Kicked", ""grey"Du wurdest gekickt, weil du zu oft das falsche Password eingegeben hast!\nVersuch es nochmal, Reconnect (/q dann join den Server nochmal.)", "Verlassen", "");
  2803. KickDelay(playerid);
  2804. return 1;
  2805. }
  2806.  
  2807. format(string, sizeof(string), "Invalid password! - %d out of 3 Warning Log Tires.", User[playerid][WarnLog]);
  2808. SendClientMessage(playerid, COLOR_RED, string);
  2809.  
  2810. SendClientMessage(playerid, -1, "LOGIN: Versuche es nochmal, /login [password].");
  2811. }
  2812. }
  2813. else
  2814. {
  2815. SendClientMessage(playerid, COLOR_RED, "Du hast noch keinen Account, dann benutze /register ");
  2816. }
  2817. return 1;
  2818. }
  2819.  
  2820. CMD:stats(playerid, params[])
  2821. {
  2822. LoginCheck(playerid);
  2823.  
  2824. new id;
  2825. if(sscanf(params, "u")) return SendClientMessage(playerid, COLOR_RED, "/stats ");
  2826. ShowStatistics(playerid, id); //Show the statistics to yourself.
  2827. return 1;
  2828. }
  2829.  
  2830. // //
  2831. //============================================================================//
  2832.  
  2833. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  2834. {
  2835. return 1;
  2836. }
  2837.  
  2838. public OnPlayerExitVehicle(playerid, vehicleid)
  2839. {
  2840. return 1;
  2841. }
  2842.  
  2843. public OnPlayerStateChange(playerid, newstate, oldstate)
  2844. {
  2845. new vehicleid = GetPlayerVehicleID(playerid);
  2846.  
  2847. if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER)
  2848. {
  2849. foreach(new x : Player)
  2850. {
  2851. if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && User[x][SpecID] == playerid && User[x][SpecType] == ADMIN_SPEC_TYPE_VEHICLE)
  2852. {
  2853. TogglePlayerSpectating(x, 1);
  2854. PlayerSpectatePlayer(x, playerid);
  2855. User[x][SpecType] = ADMIN_SPEC_TYPE_PLAYER;
  2856. }
  2857. }
  2858. }
  2859.  
  2860. if(newstate == PLAYER_STATE_PASSENGER)
  2861. {
  2862. foreach(new x : Player)
  2863. {
  2864. if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && User[x][SpecID] == playerid)
  2865. {
  2866. TogglePlayerSpectating(x, 1);
  2867. PlayerSpectateVehicle(x, vehicleid);
  2868. User[x][SpecType] = ADMIN_SPEC_TYPE_VEHICLE;
  2869. }
  2870. }
  2871. }
  2872.  
  2873. if(newstate == PLAYER_STATE_DRIVER)
  2874. {
  2875. foreach(new x : Player)
  2876. {
  2877. if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && User[x][SpecID] == playerid)
  2878. {
  2879. TogglePlayerSpectating(x, 1);
  2880. PlayerSpectateVehicle(x, vehicleid);
  2881. User[x][SpecType] = ADMIN_SPEC_TYPE_VEHICLE;
  2882. }
  2883. }
  2884. }
  2885. return 1;
  2886. }
  2887.  
  2888. public OnPlayerRequestSpawn(playerid)
  2889. {
  2890. #if ANTI_SPAWN == true
  2891. if(User[playerid][accountLogged] == false)
  2892. {
  2893. SendClientMessage(playerid, COLOR_RED, "Du musst dich Einloggen oder Registrieren bevor du Spawnen kannst.");
  2894. return 0;
  2895. }
  2896. #endif
  2897. return 1;
  2898. }
  2899.  
  2900. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  2901. {
  2902. foreach(new x : Player)
  2903. {
  2904. if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && User[x][SpecID] == playerid && User[x][SpecType] == ADMIN_SPEC_TYPE_PLAYER)
  2905. {
  2906. SetPlayerInterior(x,newinteriorid);
  2907. }
  2908. }
  2909. return 1;
  2910. }
  2911.  
  2912. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  2913. {
  2914. if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING && User[playerid][SpecID] != INVALID_PLAYER_ID)
  2915. {
  2916. if(newkeys == KEY_JUMP) AdvanceSpectate(playerid);
  2917. else if(newkeys == KEY_SPRINT) ReverseSpectate(playerid);
  2918. }
  2919. return 1;
  2920. }
  2921.  
  2922. #if RconProtect == true
  2923. public OnPlayerRconLogin(playerid)
  2924. {
  2925. if(_RCON[playerid] == false)
  2926. {
  2927. SendClientMessage(playerid, COLOR_YELLOW, "Der Server hat einen zweiten RCON, geschützt von Lolbob");
  2928. SD(playerid, DIALOG_RCON, DP, ""green"zweite RCON password", ""grey"Das zweite RCON password ist geschützt von Lolbob\nBitte scheibe den zweiten password um dir Zugang zum RCON zu verschaffen.", "Access", "Kick");
  2929. }
  2930. return 1;
  2931. }
  2932. #endif
  2933.  
  2934. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  2935. {
  2936. switch( dialogid )
  2937. {
  2938. #if RconProtect == true
  2939. case DIALOG_RCON:
  2940. {
  2941. new
  2942. string[130]
  2943. ;
  2944. if(!response)
  2945. {
  2946. format(string, sizeof(string), "** Spieler %s(ID:%d) wurde vom Server gekickt (zu viele Versuche um Zugang zu RCON zu verschaffen)", pName(playerid), playerid);
  2947. SendClientMessageToAll(COLOR_GREY, string);
  2948. print(string);
  2949. #if LOG == true
  2950. SaveLog("rcon.txt", string);
  2951. #endif
  2952. return KickDelay(playerid);
  2953. }
  2954. if(response)
  2955. {
  2956. if(!strcmp(RconPass, inputtext) && !(!strlen(inputtext)))
  2957. {
  2958. format(string, sizeof(string), "** Spieler %s(ID:%d) hat sich erfolgreich Zugang zum RCON verschafft!", pName(playerid), playerid);
  2959. SendAdmin(COLOR_GREY, string);
  2960. print(string);
  2961. #if LOG == true
  2962. SaveLog("rcon.txt", string);
  2963. #endif
  2964.  
  2965. _RCON[playerid] = true;
  2966.  
  2967. GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~g~Autorisierter ~w~Zugang!~n~~y~Willkommen Administrator!", 3000, 3);
  2968. }
  2969. else
  2970. {
  2971. if(_RCONwarn[playerid] == MAX_RCON_WARNINGS+1)
  2972. {
  2973. format(string, sizeof(string), "** Spieler %s(ID:%d) wurde vom Server gekickt (zu viele Versuche um Zugang zu RCON zu verschaffen)", pName(playerid), playerid);
  2974. SendClientMessageToAll(COLOR_GREY, string);
  2975. print(string);
  2976. #if LOG == true
  2977. SaveLog("kicklog.txt", string);
  2978. #endif
  2979. KickDelay(playerid);
  2980. return 1;
  2981. }
  2982. _RCONwarn[playerid] ++;
  2983. format(string, sizeof(string), "You have been warned for incorrect 2nd RCON Password (Warnings: %i/%i)", _RCONwarn[playerid], MAX_RCON_WARNINGS);
  2984. SendClientMessage(playerid, COLOR_GREY, string);
  2985. 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");
  2986. }
  2987. }
  2988. }
  2989. #endif
  2990.  
  2991. case DIALOG_REGISTER:
  2992. {
  2993. new
  2994. string[128],
  2995. hashpass[129]
  2996. ;
  2997. if(response)
  2998. {
  2999. if(!IsValidPassword(inputtext))
  3000. {
  3001. 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");
  3002. return 0;
  3003. }
  3004. if (strlen(inputtext) < 4 || strlen(inputtext) > 20)
  3005. {
  3006. 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");
  3007. return 0;
  3008. }
  3009.  
  3010. WP_Hash(hashpass, 129, inputtext);
  3011.  
  3012. SetPlayerScore(playerid, STARTING_SCORE);
  3013. GivePlayerMoney(playerid, STARTING_CASH);
  3014.  
  3015. //Time = Hours, Time2 = Minutes, Time3 = Seconds
  3016. new time, time2, time3;
  3017. gettime(time, time2, time3);
  3018. new date, date2, date3;
  3019. //Date = Month, Date2 = Day, Date3 = Year
  3020. getdate(date3, date, date2);
  3021.  
  3022. format(User[playerid][accountDate], 150, "%02d/%02d/%d %02d:%02d:%02d", date, date2, date3, time, time2, time3);
  3023.  
  3024. format(User[playerid][accountQuestion], 129, "What?");
  3025. format(User[playerid][accountAnswer], 129, "Yes");
  3026.  
  3027. new
  3028. query[750+1000]
  3029. ;
  3030. format(query, sizeof(query),
  3031. "INSERT INTO `users` (`username`, `IP`, `joindate`, `password`, `admin`, `kills`, `deaths`, `score`, `money`, `warn`, `mute`, `mutesec`, `cmute`, `cmutesec`, `jail`, `jailsec`, `hours`, `minutes`, `seconds`, `question`, `answer`) VALUES ('%s','%s','%s','%s',0,0,0,%d,%d,0,0,0,0,0,0,0,0,0,0,'%s','%s')",\
  3032. DB_Escape(pName(playerid)),
  3033. DB_Escape(User[playerid][accountIP]),
  3034. DB_Escape(User[playerid][accountDate]),
  3035. DB_Escape(hashpass),
  3036. User[playerid][accountScore],
  3037. User[playerid][accountCash],
  3038. DB_Escape(User[playerid][accountQuestion]),
  3039. DB_Escape(User[playerid][accountAnswer])
  3040. );
  3041. db_query(Database, query);
  3042.  
  3043. User[playerid][accountLogged] = true;
  3044.  
  3045. PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  3046.  
  3047. new
  3048. count,
  3049. DBResult: result
  3050. ;
  3051. result = db_query(Database, "SELECT * FROM `users`");
  3052. count = db_num_rows(result);
  3053. db_free_result(result);
  3054.  
  3055. User[playerid][accountID] = count;
  3056. SendClientMessage(playerid, -1, "You have successfully registered from the database.");
  3057. format(string, sizeof(string), "You are now handling accountID %i from the JakAdmin3 system.", count);
  3058. SendClientMessage(playerid, COLOR_ORANGE, string);
  3059.  
  3060. }
  3061. }
  3062.  
  3063. case DIALOG_LOGIN:
  3064. {
  3065. new
  3066. hashp[129],
  3067. string[900]
  3068. ;
  3069. if(response)
  3070. {
  3071. WP_Hash(hashp, 129, inputtext);
  3072. if(!strcmp(hashp, User[playerid][accountPassword], false))
  3073. {
  3074. LoginPlayer(playerid);
  3075. }
  3076. else
  3077. {
  3078. User[playerid][WarnLog]++;
  3079.  
  3080. if(User[playerid][WarnLog] == 3)
  3081. {
  3082. 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", "");
  3083. KickDelay(playerid);
  3084. return 0;
  3085. }
  3086.  
  3087. format(string, sizeof(string), "Invalid password! - %d out of 3 Warning Log Tires.", User[playerid][WarnLog]);
  3088. SendClientMessage(playerid, COLOR_RED, string);
  3089.  
  3090. 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]);
  3091. }
  3092. }
  3093. }
  3094. case DIALOG_COLORS:
  3095. {
  3096. new string[120], id = GetPVarInt(playerid, "_Colors_");
  3097.  
  3098. switch( response )
  3099. {
  3100. case 0:
  3101. {
  3102. DeletePVar(playerid, "_Colors_");
  3103. SendClientMessage(playerid, -1, "Colour setting has been cancelled.");
  3104. }
  3105. case 1:
  3106. {
  3107. switch( listitem )
  3108. {
  3109. case 0:
  3110. {
  3111. format(string, sizeof(string), ""red"Administrator %s "white"has set your name color to "black"Black", pName(playerid));
  3112. SendClientMessage(id, -1, string);
  3113. format(string, sizeof(string), "Color Name for Player %s has been set.", pName(id));
  3114. SendClientMessage(playerid, COLOR_YELLOW, string);
  3115. SetPlayerColor(id, COLOR_BLACK);
  3116. DeletePVar(playerid, "_Colors_");
  3117. }
  3118. case 1:
  3119. {
  3120. format(string, sizeof(string), ""red"Administrator %s "white"has set your name color to "white"White", pName(playerid));
  3121. SendClientMessage(id, -1, string);
  3122. format(string, sizeof(string), "Color Name for Player %s has been set.", pName(id));
  3123. SendClientMessage(playerid, COLOR_YELLOW, string);
  3124. SetPlayerColor(id, COLOR_WHITE);
  3125. DeletePVar(playerid, "_Colors_");
  3126. }
  3127. case 2:
  3128. {
  3129. format(string, sizeof(string), ""red"Administrator %s "white"has set your name color to "red"Red", pName(playerid));
  3130. SendClientMessage(id, -1, string);
  3131. format(string, sizeof(string), "Color Name for Player %s has been set.", pName(id));
  3132. SendClientMessage(playerid, COLOR_YELLOW, string);
  3133. SetPlayerColor(id, COLOR_RED);
  3134. DeletePVar(playerid, "_Colors_");
  3135. }
  3136. case 3:
  3137. {
  3138. format(string, sizeof(string), ""red"Administrator %s "white"has set your name color to "orange"Orange", pName(playerid));
  3139. SendClientMessage(id, -1, string);
  3140. format(string, sizeof(string), "Color Name for Player %s has been set.", pName(id));
  3141. SendClientMessage(playerid, COLOR_YELLOW, string);
  3142. SetPlayerColor(id, COLOR_ORANGE);
  3143. DeletePVar(playerid, "_Colors_");
  3144. }
  3145. case 4:
  3146. {
  3147. format(string, sizeof(string), ""red"Administrator %s "white"has set your name color to "yellow"Yellow", pName(playerid));
  3148. SendClientMessage(id, -1, string);
  3149. format(string, sizeof(string), "Color Name for Player %s has been set.", pName(id));
  3150. SendClientMessage(playerid, COLOR_YELLOW, string);
  3151. SetPlayerColor(id, COLOR_YELLOW);
  3152. DeletePVar(playerid, "_Colors_");
  3153. }
  3154. case 5:
  3155. {
  3156. format(string, sizeof(string), ""red"Administrator %s "white"has set your name color to "green"Green", pName(playerid));
  3157. SendClientMessage(id, -1, string);
  3158. format(string, sizeof(string), "Color Name for Player %s has been set.", pName(id));
  3159. SendClientMessage(playerid, COLOR_YELLOW, string);
  3160. SetPlayerColor(id, COLOR_GREEN);
  3161. DeletePVar(playerid, "_Colors_");
  3162. }
  3163. case 6:
  3164. {
  3165. format(string, sizeof(string), ""red"Administrator %s "white"has set your name color to "blue"Blue", pName(playerid));
  3166. SendClientMessage(id, -1, string);
  3167. format(string, sizeof(string), "Color Name for Player %s has been set.", pName(id));
  3168. SendClientMessage(playerid, COLOR_YELLOW, string);
  3169. SetPlayerColor(id, COLOR_BLUE);
  3170. DeletePVar(playerid, "_Colors_");
  3171. }
  3172. case 7:
  3173. {
  3174. format(string, sizeof(string), ""red"Administrator %s "white"has set your name color to "purple"Purple", pName(playerid));
  3175. SendClientMessage(id, -1, string);
  3176. format(string, sizeof(string), "Color Name for Player %s has been set.", pName(id));
  3177. SendClientMessage(playerid, COLOR_YELLOW, string);
  3178. SetPlayerColor(id, COLOR_PURPLE);
  3179. DeletePVar(playerid, "_Colors_");
  3180. }
  3181. case 8:
  3182. {
  3183. format(string, sizeof(string), ""red"Administrator %s "white"has set your name color to "brown"Brown", pName(playerid));
  3184. SendClientMessage(id, -1, string);
  3185. format(string, sizeof(string), "Color Name for Player %s has been set.", pName(id));
  3186. SendClientMessage(playerid, COLOR_YELLOW, string);
  3187. SetPlayerColor(id, COLOR_BROWN);
  3188. DeletePVar(playerid, "_Colors_");
  3189. }
  3190. case 9:
  3191. {
  3192. format(string, sizeof(string), ""red"Administrator %s "white"has set your name color to "pink"Pink", pName(playerid));
  3193. SendClientMessage(id, -1, string);
  3194. format(string, sizeof(string), "Color Name for Player %s has been set.", pName(id));
  3195. SendClientMessage(playerid, COLOR_YELLOW, string);
  3196. SetPlayerColor(id, COLOR_PINK);
  3197. DeletePVar(playerid, "_Colors_");
  3198. }
  3199. }
  3200. }
  3201. }
  3202. }
  3203. }
  3204. return 1;
  3205. }
  3206.  
  3207.  
  3208.  
  3209. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  3210. {
  3211. new string[128+50];
  3212.  
  3213. format(string, sizeof(string), "You are now viewing '{%06x}%s"white"' statistics.", GetPlayerColor(clickedplayerid) >>> 8, pName(clickedplayerid));
  3214. SendClientMessage(playerid, -1, string);
  3215.  
  3216. ShowStatistics(playerid, clickedplayerid);
  3217. return 1;
  3218. }
  3219.  
  3220. //============================================================================//
  3221.  
  3222. //Stock and functions starts here.
  3223.  
  3224. stock pName(playerid)
  3225. {
  3226. new GetName[24];
  3227. GetPlayerName(playerid, GetName, 24);
  3228. return GetName;
  3229. }
  3230.  
  3231. function:ShowStatistics(playerid, playerid2)
  3232. {
  3233. if(playerid2 == INVALID_PLAYER_ID) return 1; //Do not proceed.
  3234.  
  3235. new string[1024], string2[64];
  3236. format(string, sizeof(string), ""grey"Spieler ID: %d\n", playerid2);
  3237. format(string, sizeof(string), "%sMitglied seit: %s\n", string, User[playerid2][accountDate]);
  3238. format(string, sizeof(string), "%sOnline Zeit: %02d:%02d:%02d\n", string, User[playerid2][accountGame][2], User[playerid2][accountGame][1], User[playerid2][accountGame][0]);
  3239. format(string, sizeof(string), "%sAdmin Rang: %d\n", string, User[playerid2][accountAdmin]);
  3240. format(string, sizeof(string), "%sLevel: %d\n", string, User[playerid2][accountScore]);
  3241. format(string, sizeof(string), "%sGeld: $%d\n", string, User[playerid2][accountCash]);
  3242. format(string, sizeof(string), "%sKills: %d\n", string, User[playerid2][accountKills]);
  3243. format(string, sizeof(string), "%sMorde: %d\n", string, User[playerid2][accountDeaths]);
  3244. new deaths = User[playerid2][accountDeaths];
  3245. if(deaths == 0) deaths = 1; //Man kann nicht durch 0 teilen.
  3246. new Float:ratio = (float(User[playerid2][accountKills])/float(deaths));
  3247. format(string, sizeof(string), "%sRatio (K/D): %.3f\n", string, ratio);
  3248.  
  3249. format(string2, sizeof(string2), "{FFA200}%s's Statistiken", pName(playerid2));
  3250. SD(playerid, DIALOG_BEGIN, DM, string2, string, "Verlassen", "");
  3251. return 1;
  3252. }
  3253.  
  3254. function:KickMe(playerid)
  3255. {
  3256. return Kick(playerid);
  3257. }
  3258.  
  3259. stock KickDelay(playerid)
  3260. {
  3261. SetTimerEx("KickMe", 2000, false, "d", playerid);
  3262. return 1;
  3263. }
  3264.  
  3265. stock loadb()
  3266. {
  3267. Database = db_open(_DB_);
  3268. db_query(Database,
  3269. "CREATE TABLE IF NOT EXISTS `users`\
  3270. (`userid` INTEGER PRIMARY KEY AUTOINCREMENT, `username` TEXT, `IP` TEXT, `joindate` TEXT, `password` TEXT, `admin` NUMERIC, `kills` NUMERIC, `deaths` NUMERIC, `score` NUMERIC, `money` NUMERIC, `warn` NUMERIC, `mute` NUMERIC, `mutesec` NUMERIC, `cmute` NUMERIC, `cmutesec` NUMERIC, `jail` NUMERIC, `jailsec` NUMERIC, `hours` NUMERIC, `minutes` NUMERIC, `seconds` NUMERIC, `question` TEXT, `answer` TEXT)");
  3271.  
  3272. db_query(Database,
  3273. "CREATE TABLE IF NOT EXISTS `bans` (`username` TEXT, `ip` TEXT, `banby` TEXT, `banreason` TEXT, `banwhen` TEXT)");
  3274.  
  3275. print("[JakAdmin3] "_DB_" loading...");
  3276. return 1;
  3277. }
  3278. stock closedb()
  3279. {
  3280. print("[JakAdmin3] "_DB_" closing...");
  3281. return db_close(Database);
  3282. }
  3283.  
  3284. stock SaveData(playerid)
  3285. {
  3286. new
  3287. Query[700+1000]
  3288. ;
  3289.  
  3290. format(Query, sizeof(Query), "UPDATE `users` SET `IP` = '%s', `admin` = %d, `kills` = %d, `deaths` = %d, `score` = %d, `money` = %d, `warn` = %d, `mute` = %d, `mutesec` = %d, `cmute` = %d, `cmutesec` = %d, `jail` = %d, `jailsec` = %d, `hours` = %d, `minutes` = %d, `seconds` = %d, `question` = '%s', `answer` = '%s' WHERE `username` = '%s'",
  3291. DB_Escape(User[playerid][accountIP]),
  3292. User[playerid][accountAdmin],
  3293. User[playerid][accountKills],
  3294. User[playerid][accountDeaths],
  3295. User[playerid][accountScore],
  3296. User[playerid][accountCash],
  3297. User[playerid][accountWarn],
  3298. User[playerid][accountMuted],
  3299. User[playerid][accountMuteSec],
  3300. User[playerid][accountCMuted],
  3301. User[playerid][accountCMuteSec],
  3302. User[playerid][accountJail],
  3303. User[playerid][accountJailSec],
  3304. User[playerid][accountGame][2],
  3305. User[playerid][accountGame][1],
  3306. User[playerid][accountGame][0],
  3307. DB_Escape(User[playerid][accountQuestion]),
  3308. DB_Escape(User[playerid][accountAnswer]),
  3309. DB_Escape(User[playerid][accountName])
  3310. );
  3311. db_query(Database, Query);
  3312. db_free_result(db_query(Database, Query));
  3313. return 1;
  3314. }
  3315.  
  3316. stock getIP(playerid)
  3317. {
  3318. new twerp[20];
  3319. GetPlayerIp(playerid, twerp, 20);
  3320. return twerp;
  3321. }
  3322.  
  3323. stock isnumeric(const string[])
  3324. {
  3325. for (new i = 0, j = strlen(string); i < j; i++)
  3326. {
  3327. if (string[i] > '9' || string[i] < '0') return 0;
  3328. }
  3329. return 1;
  3330. }
  3331.  
  3332. stock GetWeaponIDFromName(WeaponName[])
  3333. {
  3334. if(strfind("molotov", WeaponName, true) != -1) return 18;
  3335. for(new i = 0; i <= 46; i++)
  3336. {
  3337. switch(i)
  3338. {
  3339. case 0,19,20,21,44,45: continue;
  3340. default:
  3341. {
  3342. new name[32]; GetWeaponName(i,name,32);
  3343. if(strfind(name,WeaponName,true) != -1) return i;
  3344. }
  3345. }
  3346. }
  3347. return -1;
  3348. }
  3349.  
  3350. function:LoginPlayer(playerid)
  3351. {
  3352. new
  3353. Query[900],
  3354. DBResult:Result,
  3355. string[128+40]
  3356. ;
  3357. format(Query, sizeof(Query), "SELECT * FROM `users` WHERE `username` = '%s'", DB_Escape(pName(playerid)));
  3358. Result = db_query(Database, Query);
  3359. if(db_num_rows(Result))
  3360. {
  3361. db_get_field_assoc(Result, "userid", Query, 7);
  3362. User[playerid][accountID] = strval(Query);
  3363.  
  3364. db_get_field_assoc(Result, "score", Query, 20);
  3365. User[playerid][accountScore] = strval(Query);
  3366. SetPlayerScore(playerid, User[playerid][accountScore]);
  3367.  
  3368. db_get_field_assoc(Result, "money", Query, 20);
  3369. User[playerid][accountCash] = strval(Query);
  3370. GivePlayerMoney(playerid, User[playerid][accountCash]);
  3371.  
  3372. db_get_field_assoc(Result, "kills", Query, 20);
  3373. User[playerid][accountKills] = strval(Query);
  3374.  
  3375. db_get_field_assoc(Result, "deaths", Query, 20);
  3376. User[playerid][accountDeaths] = strval(Query);
  3377.  
  3378. db_get_field_assoc(Result, "admin", Query, 7);
  3379. User[playerid][accountAdmin] = strval(Query);
  3380.  
  3381. db_get_field_assoc(Result, "joindate", Query, 150);
  3382. format(User[playerid][accountDate], 150, "%s", Query);
  3383.  
  3384. db_get_field_assoc(Result, "warn", Query, 5);
  3385. User[playerid][accountWarn] = strval(Query);
  3386.  
  3387. db_get_field_assoc(Result, "mute", Query, 5);
  3388. User[playerid][accountMuted] = strval(Query);
  3389.  
  3390. db_get_field_assoc(Result, "mutesec", Query, 8);
  3391. User[playerid][accountMuteSec] = strval(Query);
  3392.  
  3393. db_get_field_assoc(Result, "cmute", Query, 6);
  3394. User[playerid][accountCMuted] = strval(Query);
  3395.  
  3396. db_get_field_assoc(Result, "cmutesec", Query, 9);
  3397. User[playerid][accountCMuteSec] = strval(Query);
  3398.  
  3399. db_get_field_assoc(Result, "jail", Query, 5);
  3400. User[playerid][accountJail] = strval(Query);
  3401.  
  3402. db_get_field_assoc(Result, "jailsec", Query, 8);
  3403. User[playerid][accountJailSec] = strval(Query);
  3404.  
  3405. db_get_field_assoc(Result, "hours", Query, 6);
  3406. User[playerid][accountGame][2] = strval(Query);
  3407.  
  3408. db_get_field_assoc(Result, "minutes", Query, 8);
  3409. User[playerid][accountGame][1] = strval(Query);
  3410.  
  3411. db_get_field_assoc(Result, "seconds", Query, 8);
  3412. User[playerid][accountGame][0] = strval(Query);
  3413.  
  3414. User[playerid][accountLogged] = true;
  3415.  
  3416. if(User[playerid][accountMuted] == 1)
  3417. {
  3418. format(string, 200, "PUNISHMENT: You have been muted from using the chat for %d seconds, You are muted the last time you logged out.", User[playerid][accountMuteSec]);
  3419. SendClientMessage(playerid, COLOR_RED, string);
  3420. }
  3421. if(User[playerid][accountCMuted] == 1)
  3422. {
  3423. format(string, 200, "PUNISHMENT: You have been muted from using the commands for %d seconds, You are muted the last time you logged out.", User[playerid][accountCMuteSec]);
  3424. SendClientMessage(playerid, COLOR_RED, string);
  3425. }
  3426.  
  3427. SendClientMessage(playerid, COLOR_YELLOW, "SERVER: You have successfully logged in to the server.");
  3428. if(User[playerid][accountAdmin] >= 1)
  3429. {
  3430. SendClientMessage(playerid, -1, "You have logged into your administrative account, Good luck doing your duties.");
  3431. }
  3432.  
  3433. PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  3434. }
  3435. db_free_result(Result);
  3436. return 1;
  3437. }
  3438.  
  3439. function:IsValidPassword( const password[ ] )
  3440. {
  3441. for( new i = 0; password[ i ] != EOS; ++i )
  3442. {
  3443. switch( password[ i ] )
  3444. {
  3445. case '0'..'9', 'A'..'Z', 'a'..'z': continue;
  3446. default: return 0;
  3447. }
  3448. }
  3449. return 1;
  3450. }
  3451.  
  3452. stock DB_Escape(text[])
  3453. {
  3454. new
  3455. ret[80* 2],
  3456. ch,
  3457. i,
  3458. j;
  3459. while ((ch = text[i++]) && j < sizeof (ret))
  3460. {
  3461. if (ch == '\'')
  3462. {
  3463. if (j < sizeof (ret) - 2)
  3464. {
  3465. ret[j++] = '\'';
  3466. ret[j++] = '\'';
  3467. }
  3468. }
  3469. else if (j < sizeof (ret))
  3470. {
  3471. ret[j++] = ch;
  3472. }
  3473. else
  3474. {
  3475. j++;
  3476. }
  3477. }
  3478. ret[sizeof (ret) - 1] = '\0';
  3479. return ret;
  3480. }
  3481.  
  3482. stock ShowBan(playerid, admin[] = "JakAdmin3", reason[] = "69 Sex", when[] = "01/01/1970 00:00:00")
  3483. {
  3484. new string[256], string2[1500];
  3485.  
  3486. for(new i=0; i<100; i++)
  3487. {
  3488. SendClientMessage(playerid, -1, " ");
  3489. }
  3490.  
  3491. format(string, 256, "You're banned from server by %s for the following reasons:", admin);
  3492. SendClientMessage(playerid, COLOR_RED, string);
  3493. format(string, 256, "(( %s ))", reason);
  3494. SendClientMessage(playerid, -1, string);
  3495.  
  3496. strcat(string2, ""grey"");
  3497. strcat(string2, "You are banned from this server, Statistics of your ban:\n\n");
  3498. format(string, 256, ""white"Name: "red"%s\n", pName(playerid));
  3499. strcat(string2, string);
  3500. format(string, 256, ""white"Banned By: "red"%s\n", admin);
  3501. strcat(string2, string);
  3502. format(string, 256, ""white"Reason: "red"%s\n", reason);
  3503. strcat(string2, string);
  3504. format(string, 256, ""white"IP: "red"%s\n", User[playerid][accountIP]);
  3505. strcat(string2, string);
  3506. format(string, 256, ""white"Banned since: "red"%s\n\n", when);
  3507. strcat(string2, string);
  3508. strcat(string2, ""grey"");
  3509. strcat(string2, "If you think this is a bugged, false ban or the admin abused his/her power, Please place a ban appeal on forums.\n");
  3510. strcat(string2, "Make sure to take a picture of this by pressing F8, Do not lie on your appeal.");
  3511.  
  3512. SD(playerid, DIALOG_BEGIN, DM, ""red"You are banned from this server.", string2, "Close", "");
  3513. return 1;
  3514. }
  3515.  
  3516. stock BanAccountEx(name[], ip[], admin[] = "Anticheat", reason[] = "None")
  3517. {
  3518. new
  3519. Query[500],
  3520. DBResult:result,
  3521. ban_hr, ban_min, ban_sec, ban_month, ban_days, ban_years, when[128]
  3522. ;
  3523.  
  3524. gettime(ban_hr, ban_min, ban_sec);
  3525. getdate(ban_years, ban_month, ban_days);
  3526.  
  3527. format(when, 128, "%02d/%02d/%d %02d:%02d:%02d", ban_month, ban_days, ban_years, ban_hr, ban_min, ban_sec);
  3528.  
  3529. 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));
  3530. result = db_query(Database, Query);
  3531.  
  3532. db_free_result(result);
  3533. return 1;
  3534. }
  3535.  
  3536. stock BanAccount(playerid, admin[] = "Anticheat", reason[] = "None")
  3537. {
  3538. new
  3539. Query[500],
  3540. DBResult:result,
  3541. ban_hr, ban_min, ban_sec, ban_month, ban_days, ban_years, when[128]
  3542. ;
  3543.  
  3544. gettime(ban_hr, ban_min, ban_sec);
  3545. getdate(ban_years, ban_month, ban_days);
  3546.  
  3547. format(when, 128, "%02d/%02d/%d %02d:%02d:%02d", ban_month, ban_days, ban_years, ban_hr, ban_min, ban_sec);
  3548.  
  3549. 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));
  3550. result = db_query(Database, Query);
  3551.  
  3552. db_free_result(result);
  3553. return 1;
  3554. }
  3555.  
  3556. function:j_CountCmds()
  3557. {
  3558. new
  3559. cmdBuffer[32],
  3560. commandCount;
  3561.  
  3562. for(new it = 0; it < Scripting_GetPublicsCount(); it++)
  3563. {
  3564. Scripting_GetPublic(it, cmdBuffer);
  3565.  
  3566. if(!strcmp(cmdBuffer, "cmd_", false, 4)) {
  3567. commandCount++;
  3568. }
  3569. }
  3570.  
  3571. return commandCount;
  3572. }
  3573.  
  3574. function:IsValidWeapon(weaponid)
  3575. {
  3576. if (weaponid > 0 && weaponid < 19 || weaponid > 21 && weaponid < 47) return 1;
  3577. return 0;
  3578. }
  3579.  
  3580. function:SaveLog(filename[], text[])
  3581. {
  3582. #if LOG == true
  3583.  
  3584. new string[256];
  3585.  
  3586. if(!fexist(_LOG_))
  3587. {
  3588. printf("[JakAdmin3] Unable to overwrite '%s' at the '%s', '%s' missing.", filename, _LOG_, _LOG_);
  3589. print("No logs has been saved to your server database.");
  3590.  
  3591. format(string, sizeof string, "JakAdmin3 has attempted to overwrite '%s' at the '%s' which is missing.", filename, _LOG_);
  3592. SendAdmin(COLOR_RED, string);
  3593. SendAdmin(-1, "No logs has been saved to the server database, Check the console for further solution.");
  3594. return 0;
  3595. }
  3596.  
  3597. new File:file,
  3598. filepath[128+40]
  3599. ;
  3600.  
  3601. new year, month, day;
  3602. new hour, minute, second;
  3603.  
  3604. getdate(year, month, day);
  3605. gettime(hour, minute, second);
  3606. format(filepath, sizeof(filepath), ""_LOG_"%s", filename);
  3607. file = fopen(filepath, io_append);
  3608. format(string, sizeof(string),"[%02d/%02d/%02d | %02d:%02d:%02d] %s\r\n", month, day, year, hour, minute, second, text);
  3609. fwrite(file, string);
  3610. fclose(file);
  3611. #endif
  3612. return 1;
  3613. }
  3614.  
  3615. stock VehicleOccupied(vehicleid)
  3616. {
  3617. for(new i = 0; i < MAX_PLAYERS; i++)
  3618. {
  3619. if(IsPlayerInVehicle(i, vehicleid)) return 1;
  3620. }
  3621. return 0;
  3622. }
  3623.  
  3624. stock DataExist(name[])
  3625. {
  3626. new Buffer[180],
  3627. Entry,
  3628. DBResult:Result
  3629. ;
  3630.  
  3631. format(Buffer, sizeof(Buffer), "SELECT `userid` FROM `users` WHERE `username` = '%s'", name);
  3632. Result = db_query(Database, Buffer);
  3633.  
  3634. if(Result)
  3635. {
  3636. if(db_num_rows(Result))
  3637. {
  3638. Entry = 1;
  3639. db_free_result(Result);
  3640. }
  3641. else Entry = 0;
  3642. }
  3643. return Entry;
  3644. }
  3645.  
  3646. stock SendAdmin(color, string[])
  3647. {
  3648. foreach(new i : Player)
  3649. {
  3650. if(User[i][accountAdmin] >= 1)
  3651. {
  3652. SendClientMessage(i, color, string);
  3653. }
  3654. }
  3655. }
  3656.  
  3657. #if ANTI_SWEAR == true
  3658. stock Cenzura(string[], words[], destch = '*')
  3659. {
  3660. new start_index = (-1),
  3661. end_index = (-1);
  3662.  
  3663. start_index = strfind(string, words, true);
  3664. if(start_index == (-1)) return false;
  3665. end_index = (start_index+strlen(words));
  3666.  
  3667. for( ; start_index < end_index; start_index++)
  3668. string[start_index] = destch;
  3669. return true;
  3670. }
  3671. #endif
  3672.  
  3673. stock StartSpectate(playerid, specplayerid)
  3674. {
  3675. foreach(new x : Player)
  3676. {
  3677. if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && User[x][SpecID] == playerid)
  3678. {
  3679. AdvanceSpectate(x);
  3680. }
  3681. }
  3682. SetPlayerInterior(playerid, GetPlayerInterior(specplayerid));
  3683. TogglePlayerSpectating(playerid, 1);
  3684.  
  3685. if(IsPlayerInAnyVehicle(specplayerid))
  3686. {
  3687. PlayerSpectateVehicle(playerid, GetPlayerVehicleID(specplayerid));
  3688. User[playerid][SpecID] = specplayerid;
  3689. User[playerid][SpecType] = ADMIN_SPEC_TYPE_VEHICLE;
  3690. }
  3691. else
  3692. {
  3693. PlayerSpectatePlayer(playerid, specplayerid);
  3694. User[playerid][SpecID] = specplayerid;
  3695. User[playerid][SpecType] = ADMIN_SPEC_TYPE_PLAYER;
  3696. }
  3697. return 1;
  3698. }
  3699.  
  3700. stock StopSpectate(playerid)
  3701. {
  3702. TogglePlayerSpectating(playerid, 0);
  3703. User[playerid][SpecID] = INVALID_PLAYER_ID;
  3704. User[playerid][SpecType] = ADMIN_SPEC_TYPE_NONE;
  3705. GameTextForPlayer(playerid,"~n~~n~~n~~w~Spectate mode ended",1000,3);
  3706. return 1;
  3707. }
  3708.  
  3709. stock AdvanceSpectate(playerid)
  3710. {
  3711. if(Iter_Count(Player) == 2) { StopSpectate(playerid); return 1; }
  3712. if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING && User[playerid][SpecID] != INVALID_PLAYER_ID)
  3713. {
  3714. for(new x=User[playerid][SpecID]+1; x<=MAX_PLAYERS; x++)
  3715. {
  3716. if(x == MAX_PLAYERS) x = 0;
  3717. if(IsPlayerConnected(x) && x != playerid)
  3718. {
  3719. if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && User[x][SpecID] != INVALID_PLAYER_ID || (GetPlayerState(x) != 1 && GetPlayerState(x) != 2 && GetPlayerState(x) != 3))
  3720. {
  3721. continue;
  3722. }
  3723. else
  3724. {
  3725. StartSpectate(playerid, x);
  3726. break;
  3727. }
  3728. }
  3729. }
  3730. }
  3731. return 1;
  3732. }
  3733.  
  3734. stock ReverseSpectate(playerid)
  3735. {
  3736. if(Iter_Count(Player) == 2) { StopSpectate(playerid); return 1; }
  3737. if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING && User[playerid][SpecID] != INVALID_PLAYER_ID)
  3738. {
  3739. for(new x=User[playerid][SpecID]-1; x>=0; x--)
  3740. {
  3741. if(x == 0) x = MAX_PLAYERS;
  3742. if(IsPlayerConnected(x) && x != playerid)
  3743. {
  3744. if(GetPlayerState(x) == PLAYER_STATE_SPECTATING && User[x][SpecID] != INVALID_PLAYER_ID || (GetPlayerState(x) != 1 && GetPlayerState(x) != 2 && GetPlayerState(x) != 3))
  3745. {
  3746. continue;
  3747. }
  3748. else
  3749. {
  3750. StartSpectate(playerid, x);
  3751. break;
  3752. }
  3753. }
  3754. }
  3755. }
  3756. return 1;
  3757. }
  3758.  
  3759. stock GetVehicleModelIDFromName(vname[])
  3760. {
  3761. for(new i = 0; i < 211; i++)
  3762. {
  3763. if ( strfind(VehicleNames[i], vname, true) != -1 )
  3764. return i + 400;
  3765. }
  3766. return -1;
  3767. }
  3768.  
  3769. function:EraseVeh(vehicleid)
  3770. {
  3771. foreach(new i : Player)
  3772. {
  3773. new Float:X, Float:Y, Float:Z;
  3774. if(IsPlayerInVehicle(i, vehicleid))
  3775. {
  3776. RemovePlayerFromVehicle(i);
  3777. GetPlayerPos(i, X, Y, Z);
  3778. SetPlayerPos(i, X, Y+3, Z);
  3779. }
  3780. SetVehicleParamsForPlayer(vehicleid, i, 0, 1);
  3781. }
  3782. SetTimerEx("VehRes", 1500, 0, "i", vehicleid);
  3783. }
  3784.  
  3785. function:DelVehicle(vehicleid)
  3786. {
  3787. foreach(new players : Player)
  3788. {
  3789. new Float:X, Float:Y, Float:Z;
  3790. if(IsPlayerInVehicle(players, vehicleid))
  3791. {
  3792. GetPlayerPos(players, X, Y, Z);
  3793. SetPlayerPos(players, X, Y, Z+2);
  3794. SetVehicleToRespawn(vehicleid);
  3795. }
  3796. SetVehicleParamsForPlayer(vehicleid, players, 0, 1);
  3797. }
  3798. SetTimerEx("VehRes", 3000, 0, "d", vehicleid);
  3799. return 1;
  3800. }
  3801.  
  3802. stock Config()
  3803. {
  3804. print("\n");
  3805.  
  3806. /*
  3807. Don't blame me, Can't find a nice solution of detecting it, So i will do it
  3808. on my own way - I will find a proper code to optimize this on the next
  3809. version.
  3810. */
  3811.  
  3812. new
  3813. log,
  3814. autolog,
  3815. dialog,
  3816. readcmd,
  3817. maxping,
  3818. antiswear,
  3819. antiname,
  3820. antispawn,
  3821. antiad,
  3822. rconpass,
  3823. antispam,
  3824. on[3] ="ON",
  3825. off[4] = "OFF"
  3826. ;
  3827.  
  3828. log = 0; autolog = 0; dialog = 0; readcmd = 0; maxping = 0; antiswear = 0;
  3829. antiname = 0; antispawn = 0; antiad =0; rconpass=0; antispam = 0;
  3830.  
  3831. #if LOG == true
  3832. log = 1;
  3833. #endif
  3834.  
  3835. #if AUTO_LOGIN == true
  3836. autolog = 1;
  3837. #endif
  3838.  
  3839. #if REGISTER_DIALOG == true
  3840. dialog = 1;
  3841. #endif
  3842.  
  3843. #if READ_COMMANDS == true
  3844. readcmd = 1;
  3845. #endif
  3846.  
  3847. #if MAX_PING == true
  3848. maxping = 1;
  3849. #endif
  3850.  
  3851. #if ANTI_SWEAR == true
  3852. antiswear = 1;
  3853. #endif
  3854.  
  3855. #if ANTI_NAME == true
  3856. antiname = 1;
  3857. #endif
  3858.  
  3859. #if ANTI_SPAWN == true
  3860. antispawn = 1;
  3861. #endif
  3862.  
  3863. #if ANTI_AD == true
  3864. antiad = 1;
  3865. #endif
  3866.  
  3867. #if RconProtect == true
  3868. rconpass = 1;
  3869. #endif
  3870.  
  3871. #if AntiSpam == true
  3872. antispam = 1;
  3873. #endif
  3874.  
  3875. print("***** JaKe's Administration System Configuration *****");
  3876. 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);
  3877. 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);
  3878. printf("AntiSpam: %s", antispam ? on : off);
  3879. #if MAX_PING == true
  3880. printf("MaxPing Limit: %d", PING_EXCEED);
  3881. #endif
  3882. }
  3883.  
  3884. function:VehRes(vehicleid)
  3885. {
  3886. DestroyVehicle(vehicleid);
  3887. }
  3888.  
  3889. stock TimeStamp()
  3890. {
  3891. new time = GetTickCount() / 1000;
  3892. return time;
  3893. }
  3894.  
  3895. function:checkfolderEx()
  3896. {
  3897. if(!fexist("JakAdmin3/"))
  3898. {
  3899. return 0;
  3900. }
  3901. if(!fexist("JakAdmin3/Logs/"))
  3902. {
  3903. return 0;
  3904. }
  3905. return 1;
  3906. }
  3907.  
  3908. function:checkfolder()
  3909. {
  3910. if(!fexist("JakAdmin3/"))
  3911. {
  3912. print("\n[JakAdmin3]: JakAdmin3 folder doesn't exist in scriptfiles, JakAdmin3 won't start.");
  3913. print("Solution: Create the folder JakAdmin3 on the scriptfiles.");
  3914. print("Continusly using the script with the missing file will not save the target script objective.\n");
  3915. return 0;
  3916. }
  3917. if(!fexist("JakAdmin3/Logs/"))
  3918. {
  3919. print("\n[JakAdmin3]: Logs folder doesn't exist in JakAdmin3 folder, JakAdmin3 won't start.");
  3920. print("Solution: Create the folder Logs on the JakAdmin3 folder.");
  3921. print("Continusly using the script with the missing file will not save the target script objective.\n");
  3922. return 0;
  3923. }
  3924. return 1;
  3925. }
  3926.  
  3927. function:PosAfterSpec(playerid)
  3928. {
  3929. SetPlayerPos(playerid, SpecPos[playerid][0], SpecPos[playerid][1], SpecPos[playerid][2]);
  3930. SetPlayerFacingAngle(playerid, SpecPos[playerid][3]);
  3931. SetPlayerInterior(playerid, SpecInt[playerid][0]);
  3932. SetPlayerVirtualWorld(playerid, SpecInt[playerid][1]);
  3933. }
  3934.  
  3935. /*******************************************************************************
  3936. * End of the Script - JakAdmin3 (c), January 2015 *
  3937. ******************************************************************************/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement