Advertisement
Guest User

Untitled

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