Guest User

Untitled

a guest
Jan 29th, 2014
365
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.16 KB | None | 0 0
  1. //============================================================================//
  2. // Basic GameMode Script //
  3. //----------------------------------------------------------------------------//
  4. // By SaNeLSANY //
  5. //============================================================================//
  6.  
  7. //============================================================================// INCLUDE
  8.  
  9. #include <a_samp>
  10. #include <sscanf2>
  11. #include <streamer>
  12. #include <YSI\y_ini>
  13. #include <zcmd>
  14. #include <foreach>
  15.  
  16. //============================================================================//
  17.  
  18. //============================================================================// DEFINE
  19.  
  20.  
  21. // COLORS
  22.  
  23. #define COLOR_PINK 0xFFC0CBFF
  24. #define COLOR_RED 0xFF0000FF
  25. #define COLOR_GREEN 0x008000FF
  26. #define COLOR_DARKBLUE 0x00008BFF
  27. #define COLOR_CADETBLUE 0x5F9EA0FF
  28. #define COLOR_LIGHTBLUE 0xADD8E6FF
  29. #define COLOR_YELLOW 0xECD400F6
  30. #define COLOR_LIGHTGREEN 0x90EE90FF
  31. #define COLOR_PEACHPUFF 0xFFDAB9FF
  32. #define LIGHTBLUE2 0xF6BB0AA
  33. #define COLOR_GREY 0x808080FF
  34. #define COLOR_ORANGE 0xFFA500FF
  35. #define COLOR_BISQUE 0xFFE4C4FF
  36. #define COLOR_BLANCHEDALMOND 0xFFEBCDFF
  37. #define COLOR_BLACK 0x000000AA
  38.  
  39. #define CYELLOW "{9DBD1E}"
  40. #define CORANGE "{E68C0E}"
  41. #define CBLUE "{39AACC}"
  42. #define CLGREEN "{30DB52}"
  43. #define CDGREEN "{6FA828}"
  44. #define CWHITE "{FFFFFF}"
  45. #define CREDISH "{CF0C43}"
  46. #define CRED "{FF0000}"
  47. #define CLBLUE "{55C2CF}"
  48. #define CCADET "{5F9EA0}"
  49. #define CPINK "{FC08CB}"
  50. #define CDBLUE "{1500FF}"
  51. #define CAQUA "{5CFFE9}"
  52. #define CGREY "{7D8584}"
  53. #define CMAROON "{912514}"
  54. #define CCORAL "{FF7F50}"
  55. #define CRACE "{F2DDC4}"
  56. #define CRACE2 "{2CC900}"
  57. #define CGAME1 "{E8DB20}"
  58. #define CGAME2 "{BA80BA}"
  59. #define CMINIG1 "{648832}"
  60. #define CMINIG2 "{4F927F}"
  61.  
  62. // DIALOGS
  63.  
  64. #define DIALOG_REGISTER 0
  65. #define DIALOG_LOGIN 1
  66.  
  67. // OTHER
  68.  
  69. #define SCM SendClientMessage
  70. #define SCMToAll SendClientMessageToAll
  71. #define USER_PATH "/Players/%s.ini"
  72. #define INI_Exists(%0) fexist(%0)
  73.  
  74. //============================================================================//
  75.  
  76. //============================================================================// NEW
  77.  
  78. new Text:TextDrawPoruke;
  79. new Text:Textdraw0;
  80. new Text:Textdraw1;
  81. new RandomPoruke[][] =
  82. {
  83. "Blank GameMode: ~w~Last update of the server : 29.1.2014",
  84. "Blank GameMode: ~w~Use /report to ask to admins/report a player",
  85. "Blank GameMode: ~w~Use /help to se the commands that you can use"
  86. };
  87.  
  88. //============================================================================//
  89.  
  90. //============================================================================// FORWARD
  91.  
  92. forward ServerPoruke();
  93.  
  94. //============================================================================//
  95.  
  96. //============================================================================// ENUM
  97.  
  98. enum pInfo
  99. {
  100. pPassword[124],
  101. pKills,
  102. pDeaths,
  103. pAdmin,
  104. pLevel,
  105. pSkin,
  106. pMoney,
  107. pLogged
  108. };
  109. new PlayerInfo[MAX_PLAYERS][pInfo];
  110.  
  111. //============================================================================//
  112.  
  113. main()
  114. {
  115. print("\n----------------------------------");
  116. print(" Blank GameMode Script By SaNeLSANY ");
  117. print("----------------------------------\n");
  118. }
  119.  
  120.  
  121. public OnGameModeInit()
  122. {
  123. UsePlayerPedAnims();
  124. SetGameModeText("| Blank GameMode |");
  125. TextDrawPoruke = TextDrawCreate(1.000000, 434.000000,"~y~Welcome to ~w~** Blank GameMode **!");
  126. TextDrawAlignment(TextDrawPoruke,0);
  127. TextDrawBackgroundColor(TextDrawPoruke,0x000000FF);
  128. TextDrawFont(TextDrawPoruke,1);
  129. TextDrawLetterSize(TextDrawPoruke, 0.279999, 1.299997);
  130. TextDrawColor(TextDrawPoruke,0xffd500FF);
  131. TextDrawSetOutline(TextDrawPoruke,0);
  132. TextDrawSetProportional(TextDrawPoruke,1);
  133. TextDrawSetShadow(TextDrawPoruke,1);
  134. SetTimer("ServerPoruke",4000,1);
  135.  
  136. Textdraw0 = TextDrawCreate(532.000000, 3.000000, "Blank ~n~ GameMode");
  137. TextDrawBackgroundColor(Textdraw0, 255);
  138. TextDrawFont(Textdraw0, 1);
  139. TextDrawLetterSize(Textdraw0, 0.529999, 1.000000);
  140. TextDrawColor(Textdraw0, 16777215);
  141. TextDrawSetOutline(Textdraw0, 0);
  142. TextDrawSetProportional(Textdraw0, 1);
  143. TextDrawSetShadow(Textdraw0, 1);
  144.  
  145. Textdraw1 = TextDrawCreate(646.000000, 28.000000, "_");
  146. TextDrawBackgroundColor(Textdraw1, 255);
  147. TextDrawFont(Textdraw1, 1);
  148. TextDrawLetterSize(Textdraw1, 0.500000, -0.900000);
  149. TextDrawColor(Textdraw1, -1);
  150. TextDrawSetOutline(Textdraw1, 0);
  151. TextDrawSetProportional(Textdraw1, 1);
  152. TextDrawSetShadow(Textdraw1, 1);
  153. TextDrawUseBox(Textdraw1, 1);
  154. TextDrawBoxColor(Textdraw1, 255);
  155. TextDrawTextSize(Textdraw1, 525.000000, -21.000000);
  156. return 1;
  157. }
  158.  
  159. public OnGameModeExit()
  160. {
  161. return 1;
  162. }
  163.  
  164. public OnPlayerRequestClass(playerid, classid)
  165. {
  166. return 1;
  167. }
  168.  
  169. public OnPlayerConnect(playerid)
  170. {
  171. PlayerInfo[playerid][pLogged] = 0;
  172. new text[1024], strText[104];
  173. format(strText, 35, USER_PATH, PlayerName(playerid));
  174. if(!INI_Exists(strText))
  175. {
  176. ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""#CCADET"Account Registration", ""CYELLOW"Hello! "CBLUE"You must register to play on this server!", "Register", "Leave");
  177. SCM(playerid, COLOR_BLACK, "");
  178. SCM(playerid, COLOR_BLACK, "");
  179. SCM(playerid, COLOR_BLACK, "");
  180. SCM(playerid, COLOR_BLACK, "");
  181. SCM(playerid, COLOR_BLACK, "");
  182. SCM(playerid, COLOR_BLACK, "");
  183. SCM(playerid, COLOR_BLACK, "");
  184. SCM(playerid, COLOR_BLACK, "");
  185. SCM(playerid, COLOR_BLACK, "");
  186. SCM(playerid, COLOR_BLACK, "");
  187. SCM(playerid, COLOR_BLACK, "");
  188. SCM(playerid, COLOR_BLACK, "");
  189. SCM(playerid, COLOR_BLACK, "");
  190. SCM(playerid, COLOR_BLACK, "");
  191. SCM(playerid, COLOR_BLACK, "");
  192. SCM(playerid, COLOR_BLACK, "");
  193. SCM(playerid, COLOR_BLACK, "");
  194. SCM(playerid, COLOR_BLACK, "");
  195. SCM(playerid, COLOR_BLACK, "");
  196. SCM(playerid, COLOR_BLACK, "");
  197. SCM(playerid, COLOR_BLACK, "");
  198. SCM(playerid, COLOR_BLACK, "");
  199. SCM(playerid, COLOR_BLACK, "");
  200. SCM(playerid, COLOR_BLACK, "");
  201. SCM(playerid, COLOR_BLACK, "");
  202. SCM(playerid, COLOR_BLACK, "");
  203. SCM(playerid, COLOR_BLACK, "");
  204. }
  205. else
  206. {
  207. format(text, sizeof(text)," {0095FF}________________________________________________\n\n{FFFFFF}Welcome to {0095FF}Basic GameMode {FFFFFF}server!\n\n\n{0095FF}%s\n{FFFFFF}Your Account are finded\n\n\nPlease enter your password to enter to this server:\n\n{0095FF}________________________________________________", PlayerName(playerid));
  208. ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT, "Login",text, "Logiraj","Odustani");
  209. SCM(playerid, COLOR_BLACK, "");
  210. SCM(playerid, COLOR_BLACK, "");
  211. SCM(playerid, COLOR_BLACK, "");
  212. SCM(playerid, COLOR_BLACK, "");
  213. SCM(playerid, COLOR_BLACK, "");
  214. SCM(playerid, COLOR_BLACK, "");
  215. SCM(playerid, COLOR_BLACK, "");
  216. SCM(playerid, COLOR_BLACK, "");
  217. SCM(playerid, COLOR_BLACK, "");
  218. SCM(playerid, COLOR_BLACK, "");
  219. SCM(playerid, COLOR_BLACK, "");
  220. SCM(playerid, COLOR_BLACK, "");
  221. SCM(playerid, COLOR_BLACK, "");
  222. SCM(playerid, COLOR_BLACK, "");
  223. SCM(playerid, COLOR_BLACK, "");
  224. SCM(playerid, COLOR_BLACK, "");
  225. SCM(playerid, COLOR_BLACK, "");
  226. SCM(playerid, COLOR_BLACK, "");
  227. SCM(playerid, COLOR_BLACK, "");
  228. SCM(playerid, COLOR_BLACK, "");
  229. SCM(playerid, COLOR_BLACK, "");
  230. SCM(playerid, COLOR_BLACK, "");
  231. SCM(playerid, COLOR_BLACK, "");
  232. SCM(playerid, COLOR_BLACK, "");
  233. SCM(playerid, COLOR_BLACK, "");
  234. SCM(playerid, COLOR_BLACK, "");
  235. SCM(playerid, COLOR_BLACK, "");
  236. }
  237. return 1;
  238. }
  239.  
  240. public OnPlayerDisconnect(playerid, reason)
  241. {
  242. if(PlayerInfo[playerid][pLogged] == 1)
  243. {
  244. SavePlayer(playerid);
  245. }
  246. return 1;
  247. }
  248.  
  249. public OnPlayerSpawn(playerid)
  250. {
  251. SetSpawnInfo(playerid, 0,PlayerInfo[playerid][pSkin], 1154.0653,-1458.0643,15.7969, 0,0,0,0,0,0,0);
  252. TextDrawShowForPlayer(playerid, TextDrawPoruke);
  253. TextDrawShowForPlayer(playerid, Textdraw0);
  254. TextDrawShowForPlayer(playerid, Textdraw1);
  255. return 1;
  256. }
  257.  
  258. public OnPlayerDeath(playerid, killerid, reason)
  259. {
  260. return 1;
  261. }
  262.  
  263. public OnVehicleSpawn(vehicleid)
  264. {
  265. return 1;
  266. }
  267.  
  268. public OnVehicleDeath(vehicleid, killerid)
  269. {
  270. return 1;
  271. }
  272.  
  273. public OnPlayerText(playerid, text[])
  274. {
  275. return 1;
  276. }
  277. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  278. {
  279. return 1;
  280. }
  281.  
  282. public OnPlayerExitVehicle(playerid, vehicleid)
  283. {
  284. return 1;
  285. }
  286.  
  287. public OnPlayerStateChange(playerid, newstate, oldstate)
  288. {
  289. return 1;
  290. }
  291.  
  292. public OnPlayerEnterCheckpoint(playerid)
  293. {
  294. return 1;
  295. }
  296.  
  297. public OnPlayerLeaveCheckpoint(playerid)
  298. {
  299. return 1;
  300. }
  301.  
  302. public OnPlayerEnterRaceCheckpoint(playerid)
  303. {
  304. return 1;
  305. }
  306.  
  307. public OnPlayerLeaveRaceCheckpoint(playerid)
  308. {
  309. return 1;
  310. }
  311.  
  312. public OnRconCommand(cmd[])
  313. {
  314. return 1;
  315. }
  316.  
  317. public OnPlayerRequestSpawn(playerid)
  318. {
  319. if(PlayerInfo[playerid][pLogged] == 0)
  320. {
  321. SCM(playerid,COLOR_RED,"You must be logged in before spawn");
  322. SetTimerEx("KickPlayer", 300, 0, "d", playerid);
  323. }
  324. return 1;
  325. }
  326.  
  327. public OnObjectMoved(objectid)
  328. {
  329. return 1;
  330. }
  331.  
  332. public OnPlayerObjectMoved(playerid, objectid)
  333. {
  334. return 1;
  335. }
  336.  
  337. public OnPlayerPickUpPickup(playerid, pickupid)
  338. {
  339. return 1;
  340. }
  341.  
  342. public OnVehicleMod(playerid, vehicleid, componentid)
  343. {
  344. return 1;
  345. }
  346.  
  347. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  348. {
  349. return 1;
  350. }
  351.  
  352. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  353. {
  354. return 1;
  355. }
  356.  
  357. public OnPlayerSelectedMenuRow(playerid, row)
  358. {
  359. return 1;
  360. }
  361.  
  362. public OnPlayerExitedMenu(playerid)
  363. {
  364. return 1;
  365. }
  366.  
  367. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  368. {
  369. return 1;
  370. }
  371.  
  372. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  373. {
  374. return 1;
  375. }
  376.  
  377. public OnRconLoginAttempt(ip[], password[], success)
  378. {
  379. return 1;
  380. }
  381.  
  382. public OnPlayerUpdate(playerid)
  383. {
  384. return 1;
  385. }
  386.  
  387. public OnPlayerStreamIn(playerid, forplayerid)
  388. {
  389. return 1;
  390. }
  391.  
  392. public OnPlayerStreamOut(playerid, forplayerid)
  393. {
  394. return 1;
  395. }
  396.  
  397. public OnVehicleStreamIn(vehicleid, forplayerid)
  398. {
  399. return 1;
  400. }
  401.  
  402. public OnVehicleStreamOut(vehicleid, forplayerid)
  403. {
  404. return 1;
  405. }
  406.  
  407. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  408. {
  409. if(dialogid == DIALOG_REGISTER)
  410. {
  411. if(!response)
  412. {
  413. SCM(playerid, COLOR_LIGHTBLUE, "Hey you, you must register to play on this server !");
  414. SetTimerEx("KickPlayer", 300, 0, "d", playerid);
  415. return 1;
  416. }
  417. if(response)
  418. {
  419. if(!strlen(inputtext))
  420. {
  421. ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""#CCADET"Account Registration", ""CYELLOW"You must enter a password below to continue!", "Register", "Leave");
  422. return 1;
  423. }
  424. SCM(playerid, COLOR_GREEN, "All right, you are now registered!");
  425. new uFile[35];
  426. format(uFile, 35, USER_PATH, PlayerName(playerid));
  427. new INI:playerFile = INI_Open(uFile);
  428. INI_WriteInt(playerFile,"Password",udb_hash(inputtext));
  429. INI_WriteInt(playerFile, "AdminLVL", PlayerInfo[playerid][pAdmin]);
  430. INI_WriteInt(playerFile, "Money", PlayerInfo[playerid][pMoney]);
  431. INI_WriteInt(playerFile, "Level", PlayerInfo[playerid][pLevel]);
  432. INI_WriteInt(playerFile, "Skin", PlayerInfo[playerid][pSkin]);
  433. INI_Close(playerFile);
  434. PlayerInfo[playerid][pLevel] = 3;
  435. PlayerInfo[playerid][pLogged] = 1;
  436. PlayerInfo[playerid][pMoney] = 1000;
  437. GivePlayerMoney(playerid, PlayerInfo[playerid][pMoney]);
  438. SetPlayerSkin(playerid, 1);
  439. SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
  440. SetSpawnInfo(playerid, 0,PlayerInfo[playerid][pSkin], 1154.0653,-1458.0643,15.7969, 0,0,0,0,0,0,0);
  441. SpawnPlayer(playerid);
  442. }
  443. }
  444. if(dialogid == DIALOG_LOGIN)
  445. {
  446. if(!response)
  447. {
  448. SCM(playerid, COLOR_LIGHTBLUE, "Hey you, you must LogIn to play on this server !");
  449. SetTimerEx("KickPlayer", 300, 0, "d", playerid);
  450. return 1;
  451. }
  452. if(response)
  453. {
  454. new uFile[35];
  455. format(uFile, 35, USER_PATH, PlayerName(playerid));
  456. INI_ParseFile(uFile, "LoadUserData", .bExtra = true, .extra = playerid);
  457. if(udb_hash(inputtext) == PlayerInfo[playerid][pPassword])
  458. {
  459. new coordsstring[124];
  460. format(uFile, 35, USER_PATH, PlayerName(playerid));
  461. INI_ParseFile(uFile, "LoadUserData", .bExtra = true, .extra = playerid);
  462. format(coordsstring, sizeof(coordsstring), "*Welcome %s on the server",PlayerName(playerid));
  463. SCM(playerid, 0x33CCFFAA,coordsstring);
  464. format(coordsstring,sizeof coordsstring,"~n~~n~~n~~n~~n~~n~~w~WELCOME~n~~r~%s!",PlayerName(playerid));
  465. GameTextForPlayer(playerid, coordsstring, 6000, 3);
  466. SetPlayerColor(playerid,0xFFFFFFFF);
  467. PlayerInfo[playerid][pLogged] = 1;
  468. SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
  469. GivePlayerMoney(playerid, PlayerInfo[playerid][pMoney]);
  470. SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
  471. SetSpawnInfo(playerid, 0,PlayerInfo[playerid][pSkin], 1154.0653,-1458.0643,15.7969, 0,0,0,0,0,0,0);
  472. SpawnPlayer(playerid);
  473. }
  474. else
  475. {
  476. ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT, "Login","Wrong password", "Logiraj","Odustani");
  477. }
  478. }
  479. }
  480. return 1;
  481. }
  482.  
  483. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  484. {
  485. return 1;
  486. }
  487. //============================================================================//
  488.  
  489. forward LoadUserData(playerid, name[], value[]);
  490. public LoadUserData(playerid, name[], value[])
  491. {
  492. INI_Int("Password",PlayerInfo[playerid][pPassword]);
  493. INI_Int("Level",PlayerInfo[playerid][pLevel]);
  494. INI_Int("Money",PlayerInfo[playerid][pMoney]);
  495. INI_Int("AdminLVL",PlayerInfo[playerid][pAdmin]);
  496. INI_Int("Skin",PlayerInfo[playerid][pSkin]);
  497. return 1;
  498. }
  499. forward KickPlayer(playerid);
  500. public KickPlayer(playerid)
  501. {
  502. Kick(playerid);
  503. }
  504. public ServerPoruke()
  505. {
  506. TextDrawSetString(TextDrawPoruke, RandomPoruke[random(sizeof(RandomPoruke))]);
  507. return 1;
  508. }
  509.  
  510. //============================================================================// STOCKS
  511.  
  512. stock SavePlayer(playerid)
  513. {
  514. new uFile[35];
  515. format(uFile, 35, USER_PATH, PlayerName(playerid));
  516. new INI:playerFile = INI_Open(uFile);
  517. INI_WriteInt(playerFile, "AdminLVL", PlayerInfo[playerid][pAdmin]);
  518. INI_WriteInt(playerFile, "Money", PlayerInfo[playerid][pMoney]);
  519. INI_WriteInt(playerFile, "Level", PlayerInfo[playerid][pLevel]);
  520. INI_WriteInt(playerFile, "Skin", PlayerInfo[playerid][pSkin]);
  521. INI_Close(playerFile);
  522. return 1;
  523. }
  524. stock UserPath(playerid)
  525. {
  526. new string[128],playername[MAX_PLAYER_NAME];
  527. GetPlayerName(playerid,playername,sizeof(playername));
  528. format(string,sizeof(string),PATH,playername);
  529. return string;
  530. }
  531. stock PlayerName(playerid)
  532. {
  533. new pName[MAX_PLAYER_NAME];
  534. GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
  535. return pName;
  536. }
  537.  
  538.  
  539. stock udb_hash(buf[])
  540. {
  541. new length=strlen(buf);
  542. new s1 = 1;
  543. new s2 = 0;
  544. new n;
  545. for (n=0; n<length; n++)
  546. {
  547. s1 = (s1 + buf[n]) % 65521;
  548. s2 = (s2 + s1) % 65521;
  549. }
  550. return (s2 << 16) + s1;
  551. }
  552. stock AdminMessage(color, string[])
  553. {
  554. foreach (Player, i)
  555. {
  556. if(PlayerInfo[i][pAdmin] >= 1)
  557. {
  558. SCM(i, color, string);
  559. }
  560. }
  561. }
  562.  
  563.  
  564. //============================================================================//
  565.  
  566. //============================================================================//
  567. //============================================================================// ADMINISTATOR COMMANDS
  568.  
  569. CMD:ah(playerid, params[])
  570. {
  571. if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid,COLOR_RED,"{B5B5B5} {FFFFFF}You don't have permission to this command!");
  572. SCM(playerid, COLOR_DARKBLUE," [==================================== [Admin Commands] =========]");
  573. if(PlayerInfo[playerid][pAdmin] >= 1)
  574. {
  575. SCM(playerid, COLOR_DARKBLUE," [1] {FFFFFF}- | /a | /o | /kick | /gethere | /goto | /kill |"); }
  576. if(PlayerInfo[playerid][pAdmin] >= 2)
  577. {
  578. SCM(playerid, COLOR_DARKBLUE," [2] {FFFFFF}- | In construction ");
  579. }
  580. if(PlayerInfo[playerid][pAdmin] >= 3)
  581. {
  582. SCM(playerid, COLOR_DARKBLUE," [3] {FFFFFF}- | In construction ");
  583. }
  584. if(PlayerInfo[playerid][pAdmin] >= 4)
  585. {
  586. SCM(playerid, COLOR_DARKBLUE," [4] {FFFFFF}- | In construction "); }
  587. if(PlayerInfo[playerid][pAdmin] >= 1337)
  588. {
  589. SCM(playerid, COLOR_DARKBLUE," [1337] {FFFFFF}- | In construction ");
  590. }
  591. if(PlayerInfo[playerid][pAdmin] >= 1338)
  592. {
  593. SCM(playerid, COLOR_DARKBLUE," [1338] {FFFFFF}- | In construction ");
  594. }
  595. if(IsPlayerAdmin(playerid))
  596. {
  597. SCM(playerid, COLOR_DARKBLUE," [1338(+rcon)] {FFFFFF}- | /makeadmin");
  598. }
  599. SCM(playerid, COLOR_DARKBLUE," [================================================================]");
  600. return 1;
  601. }
  602. CMD:makeadmin(playerid, params[])
  603. {
  604. new targetid, level;
  605. new string[128];
  606. if(!IsPlayerAdmin(playerid)) return SCM(playerid,COLOR_RED,"{B5B5B5}{FFFFFF} Rcon Administators only ! ");
  607. else if (sscanf(params, "ui", targetid, level)) return SCM(playerid, LIGHTBLUE2,"Usage: {FFFFFF}/makeadmin [ID/Nick] [level 1-1338]");
  608. else if(targetid == INVALID_PLAYER_ID) return SCM(playerid, COLOR_RED, "{B3B3B3}Player is not online");
  609. else
  610. {
  611. format(string, sizeof(string),"*You maked | %s to Admin level %i!", PlayerName(targetid), level);
  612. SCM(playerid, LIGHTBLUE2, string);
  613. format(string, sizeof(string),"*Congrulations. You are now %i level Admina | Rcon Admin: %s ", level, PlayerName(playerid));
  614. SCM(targetid, LIGHTBLUE2, string);
  615. PlayerInfo[targetid][pAdmin] = level;
  616. format(string, sizeof(string),"*Rcon Admin %s | maked %s to Admin | Level: %i | ",PlayerName(playerid),PlayerName(targetid),level);
  617. AdminMessage(LIGHTBLUE2, string);
  618. SavePlayer(targetid);
  619. }
  620. return 1;
  621. }
  622. CMD:a(playerid, params[])
  623. {
  624. new string[128];
  625. if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid,COLOR_RED,"{B5B5B5}You do not have permission to do that!");
  626. if(isnull(params)) return SCM(playerid,LIGHTBLUE2,"Usage: {FFFFFF}/(a)dmin [Admin Chat]");
  627. format(string,128," |%d|A| %s: {FFFFFF}%s",PlayerInfo[playerid][pAdmin],PlayerName(playerid),params);
  628. AdminMessage(LIGHTBLUE2, string);
  629. return 1;
  630. }
  631. CMD:kick(playerid,params[])
  632. {
  633. new id, reason[128], string[128];
  634. if(PlayerInfo[playerid][pAdmin] >= 1)
  635. {
  636. if(sscanf(params,"us[128]",id,reason)) return SCM(playerid, COLOR_ORANGE,"Usage:{FFFFFF} /kick [ID/Nick] [reason]");
  637. if(!IsPlayerConnected(id)) return SCM(playerid, COLOR_RED, "{B3B3B3}Player is not online");
  638. format(string, sizeof(string),"|A|Kick| %s are kicked from %s , reason: %s",PlayerName(id),PlayerName(playerid),reason);
  639. AdminMessage(COLOR_RED,string);
  640. format(string, sizeof(string),"|A|Kick| You are kicked from %s , reason: %s",PlayerName(playerid),reason);
  641. SCM(id,COLOR_RED,string);
  642. SetTimerEx("KickIgracaID", 300, 0, "d", id);
  643. }
  644. else
  645. {
  646. SCM(playerid,COLOR_RED,"{B5B5B5}You do not have permission to do that!");
  647. }
  648. return 1;
  649. }
  650. CMD:gethere(playerid,params[])
  651. {
  652. new targetid, Float:x, Float:y, Float:z;
  653. new string[128];
  654. if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid,COLOR_RED,"{B5B5B5}You do not have permission to do that!");
  655. else if(sscanf(params, "u", targetid)) return SCM(playerid, COLOR_ORANGE,"Usage:{FFFFFF} /gethere [ID/Nick]");
  656. else if(!IsPlayerConnected(targetid)) return SCM(playerid, COLOR_RED, "{B3B3B3}Player is not online");
  657. else
  658. {
  659. GetPlayerPos(playerid, x, y, z);
  660. SetPlayerPos(targetid, x+1, y+1, z);
  661. if(IsPlayerInAnyVehicle(targetid))
  662. SetVehiclePos(GetPlayerVehicleID(targetid), x+2,y+2,z);
  663. PutPlayerInVehicle(targetid, GetPlayerVehicleID(targetid), 0);
  664. format(string, sizeof(string), "You are ported {00D5FF}%s to you!", PlayerName(targetid));
  665. SCM(playerid,COLOR_GREY,string);
  666. format(string, sizeof(string), "%s are ported you to him !", PlayerName(playerid));
  667. SCM(targetid,COLOR_GREY,string);
  668. }
  669. return 1;
  670. }
  671. CMD:goto(playerid, params[])
  672. {
  673. new id;
  674. new string[128];
  675. if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid,COLOR_RED,"{B5B5B5}You do not have permission to do that!");
  676. else if(sscanf(params, "u", id)) SCM(playerid,COLOR_ORANGE,"Usage:{FFFFFF} /goto [ID/Nick]");
  677. else if(!IsPlayerConnected(id)) SCM(playerid, COLOR_RED, "{B3B3B3}Player is not online");
  678. else
  679. {
  680. new Float:x, Float:y, Float:z;
  681. GetPlayerPos(id, x, y, z);
  682. SetPlayerPos(playerid, x+1, y+1, z);
  683. if(IsPlayerInAnyVehicle(playerid))
  684. SetVehiclePos(GetPlayerVehicleID(playerid), x+2,y+2,z);
  685. PutPlayerInVehicle(playerid, GetPlayerVehicleID(playerid), 0);
  686. format(string, sizeof(string), "You are teleported to {00D5FF}%s !", PlayerName(id));
  687. SCM(playerid,COLOR_GREY,string);
  688. }
  689. return 1;
  690. }
  691. CMD:o(playerid,params[])
  692. {
  693. new poruka[128], string2[128];
  694. if(PlayerInfo[playerid][pAdmin] < 1) return SCM(playerid,COLOR_RED,"{B5B5B5}You do not have permission to do that!");
  695. if(sscanf(params, "s[128]", poruka)) return SCM(playerid, COLOR_ORANGE,"Usage:{FFFFFF} /o [text]");
  696. format(string2, sizeof(string2), "(( Admin %s: %s ))", PlayerName(playerid), poruka);
  697. SCMToAll(LIGHTBLUE2, string2);
  698. return 1;
  699. }
  700. CMD:kill(playerid, params[])
  701. {
  702. new id, string[128];
  703. if(PlayerInfo[playerid][pAdmin] >= 1)
  704. {
  705. if(sscanf(params,"u", id )) return SCM(playerid, COLOR_ORANGE,"Usage:{FFFFFF} /kill [ID/Nick] ");
  706. if(!IsPlayerConnected(id)) return SCM(playerid, COLOR_RED, "{B3B3B3}Player is not online");
  707. format(string, sizeof(string),"|A|Killed| %s are killed from %s",PlayerName(id), PlayerName(playerid));
  708. AdminMessage(0x99DD44FF,string);
  709. SetPlayerHealth(id, 0);
  710. format(string, sizeof(string),"|A|Killed| Your are killed from Administator %s", PlayerName(playerid));
  711. SCM(id,COLOR_RED, string);
  712. }
  713. else
  714. {
  715. SCM(playerid,COLOR_RED,"{B5B5B5}You do not have permission to do that!");
  716. }
  717. return 1;
  718. }
  719.  
  720. //============================================================================//
  721.  
  722. //============================================================================// PLAYER COMMANDS
  723.  
  724. CMD:report(playerid, params[])
  725. {
  726. new string[128];
  727. if(isnull(params)) return SCM(playerid, COLOR_ORANGE,"Usage:{FFFFFF} /report [question]");
  728. static chatspam[MAX_PLAYERS];
  729. if((gettime() - chatspam[playerid]) < 60)
  730. {
  731. SCM(playerid,COLOR_RED, "{B3B3B3}({FF0000}Stop!{B3B3B3}){FFFFFF} You can use report every 1min!");
  732. return 1;
  733. }
  734. chatspam[playerid] = gettime();
  735. foreach(Player,i)
  736. {
  737. if(PlayerInfo[i][pAdmin] > 0)
  738. {
  739. format(string, sizeof(string), " |R| %s[%d]: %s", PlayerName(playerid),playerid, params);
  740. SCM(i, COLOR_ORANGE, string);
  741. }
  742. }
  743. format(string,sizeof(string),"*Your report: {FFFFFF}%s",params);
  744. SCM(playerid,0xFFFF00FF,string);
  745. SCM(playerid,0xFFFF00FF,"Online administators whill give you a reply quickly");
  746. return 1;
  747. }
  748. CMD:help(playerid, params[])
  749. {
  750. SCM(playerid, LIGHTBLUE2, "Player Commands!");
  751. SCM(playerid, COLOR_ORANGE, "/report | In Construction");
  752. return 1;
  753. }
  754.  
  755. //============================================================================//
Advertisement
Add Comment
Please, Sign In to add comment