Guest User

Untitled

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