Guest User

Untitled

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