Advertisement
Guest User

Untitled

a guest
Apr 14th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 30.33 KB | None | 0 0
  1. D:\Filip\Jiky Cops And Robbers\gamemodes\JCNR.pwn(710) : warning 203: symbol is never used: "OnPlayerText"
  2. Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase
  3.  
  4.  
  5. 1 Warning.
  6.  
  7. /*==============================================================================
  8.                         Jiky Cops And Robbers V1.0
  9.                                  Owner:Jiky
  10.                                Scripter:Jiky
  11.                         Credits:Sad Goat Production
  12. ==============================================================================*/
  13. #include <a_samp>
  14. #include <zcmd>
  15. #include <sscanf2>
  16. //==============================================================================
  17. #define COLOR_GREY 0xAFAFAFAA
  18. #define COLOR_GREEN 0x33AA33AA
  19. #define COLOR_RED 0xFF0000FF
  20. #define COLOR_YELLOW 0xFFFF00AA
  21. #define COLOR_WHITE 0xFFFFFFAA //CIVIL
  22. #define COLOR_BLUE 0x0000BBAA //POLICE
  23. #define COLOR_LIGHTBLUE 0x33CCFFAA
  24. #define COLOR_ORANGE 0xFF9900AA
  25. #define COLOR_LIME 0x10F441AA
  26. #define COLOR_MAGENTA 0xFF00FFFF
  27. #define ZA3DTEXT 0x00F5FFFF
  28. //==============================================================================
  29. #define TEAM_COPS 1
  30. #define TEAM_CIVIL 2
  31. #define TEAM_COPS_COLOR 0x0000BBAA
  32. #define TEAM_CIVIL_COLOR 0xFFFFFFAA
  33. forward timer1();
  34. forward timer2(playerid);
  35. forward SendMSG();
  36. forward SecondTimer(); //MUTE SECOND BY SECOND TIMER
  37. //==============================================================================
  38. new gTeam[MAX_PLAYERS];
  39. new pClass[MAX_PLAYERS];
  40. new robpossible;
  41. new RandomMSG[][] =
  42. {
  43.     "{37DB45}[{FFFFFF}INFO{37DB45}]: {FFFFFF}Zabranjeno koristenje citova ili modova koji vam daju prednost u igri{FF0000}(Kazna BAN){FFFFFF}!",
  44.     "{37DB45}[{FFFFFF}INFO{37DB45}]: {FFFFFF}Zabranjeno iskoristavanje bagova{FF0000}(Kazna BAN){FFFFFF}!",
  45.     "{37DB45}[{FFFFFF}INFO{37DB45}]: {FFFFFF}Postujte pravila {37DB45}/pravila!{FFFFFF}",
  46.     "{37DB45}[{FFFFFF}INFO{37DB45}]: {FFFFFF}Posetite nas forum {37DB45}/forum!{FFFFFF}",
  47.     "{37DB45}[{FFFFFF}INFO{37DB45}]: {FFFFFF}Posetite nas ts3 {37DB45}/ts3!{FFFFFF}",
  48.     "{37DB45}[{FFFFFF}INFO{37DB45}]: {FFFFFF}Zabranjeno psovanje {FF0000}(Kazna JAIL/MUTE){FFFFFF}!"
  49. };
  50. new Float:RandomSpawns[][] =
  51. {
  52.     {-2186.6382,-2442.7085,30.6250,231.0229},
  53.     {-2153.2136,-2469.7542,30.6250,231.0229},
  54.     {-2114.8606,-2466.5491,30.6250,47.6401},
  55.     {-2110.5266,-2423.6584,30.6250,139.6565},
  56.     {-2196.2129,-2260.4041,30.6532,142.0587},
  57.     {-2107.1008,-2249.3411,30.6250,142.8943}
  58. };
  59. new Mute[MAX_PLAYERS]; //VARIJABLA 1s=1000ms
  60. //==============================================================================
  61. main()
  62.  
  63. {
  64.     print("\n----------------------------------");
  65.     print("      Jiky Cops And Robbers V1.0     ");
  66.     print("----------------------------------\n");
  67. }
  68. //==============================================================================
  69. public OnGameModeInit()
  70. {
  71.     SetTimer("SecondTimer", 1000, true); // MUTE TIMER
  72.     SetTimer("SendMSG", 30000, true);
  73. //////////////////////////////////////////////////////////////////////////////// MAPS
  74. //PD
  75.     CreateObject(8615,-2171.8999000,-2366.6001000,32.3000000,0.0000000,0.0000000,231.0000000); //object(vgssstairs04_lvs) (1)
  76.     CreateObject(1428,-2173.6001000,-2369.3000000,35.6000000,0.0000000,181.0000000,49.7500000); //object(dyn_ladder) (1)
  77.     CreateObject(633,-2165.7000000,-2387.1001000,30.6000000,0.0000000,0.0000000,1.2500000); //object(veg_palmkb10) (2)
  78.     CreateObject(970,-2161.8000000,-2388.0000000,30.2000000,0.0000000,0.0000000,48.7500000); //object(fencesmallb) (1)
  79.     CreateObject(970,-2164.3000000,-2386.0000000,30.2000000,0.0000000,0.0000000,49.9920000); //object(fencesmallb) (5)
  80.     CreateObject(633,-2162.6001000,-2389.5000000,30.6000000,0.0000000,0.0000000,1.2470000); //object(veg_palmkb10) (3)
  81. //PD END
  82. ////////////////////////////////////////////////////////////////////////////////
  83.     DisableInteriorEnterExits();
  84.     EnableStuntBonusForAll(0);
  85.     robpossible = 1;
  86. ////////////////////////////////////////////////////////////////////////////////
  87.     Create3DTextLabel("[Angel Pine]\nPolice Department",ZA3DTEXT,-2161.3452, -2384.7817, 30.8963, 8.0, 0); //PD
  88.     Create3DTextLabel("[Angel Pine]\nRESTORANT",ZA3DTEXT,-2103.5950, -2342.0413, 30.6172, 8.0, -1); //RESTORANT
  89.     Create3DTextLabel("[Angel Pine]\nCluckin'Bell",ZA3DTEXT,-2155.3176 ,-2460.1699, 30.8516, 8.0, -1); //CLUCKIN'BELL
  90.     Create3DTextLabel("[POLICE]\n/gear",ZA3DTEXT,255.2108, 74.0874, 1003.6406, 8.0, 1); //PD GEAR
  91. ////////////////////////////////////////////////////////////////////////////////
  92.     CreatePickup(1239,0,-2103.5950,-2342.0413,30.6172,-1); // RESTORAN
  93.     CreatePickup(1247,0,-2161.3452,-2384.7817,30.8963,-1); // POLICIJA
  94.     CreatePickup(1239,0,-2155.3176,-2460.1699,30.8516,-1); // CLUCKIN'BELL
  95.     CreatePickup(1242,0,255.2108,74.0874,1003.6406,-1); // GEAR
  96. ////////////////////////////////////////////////////////////////////////////////
  97.     SetGameModeText("Cops And Robbers by Jiky");
  98.     AddPlayerClass(283,-2163.0229,-2386.9519,30.6250,141.1998,29,300,0,0,0,0); // PoliceSpawn1
  99.     AddPlayerClass(280,-2163.0229,-2386.9519,30.6250,141.1998,29,300,0,0,0,0); // PoliceSpawn2
  100.     AddPlayerClass(281,-2163.0229,-2386.9519,30.6250,141.1998,29,300,0,0,0,0); // PoliceSpawn3
  101.     AddPlayerClass(282,-2163.0229,-2386.9519,30.6250,141.1998,29,300,0,0,0,0); // PoliceSpawn4
  102.     AddPlayerClass(265,-2163.0229,-2386.9519,30.6250,141.1998,29,300,0,0,0,0); // PoliceSpawn5
  103.     AddPlayerClass(20,-2195.9509,-2258.5076,30.6681,143.5614,22,50,0,0,0,0); // CivilSpawn1
  104.     AddPlayerClass(46,-2195.9509,-2258.5076,30.6681,143.5614,22,50,0,0,0,0); // CivilSpawn2
  105.     AddPlayerClass(47,-2195.9509,-2258.5076,30.6681,143.5614,22,50,0,0,0,0); // CivilSpawn3
  106.     AddPlayerClass(48,-2195.9509,-2258.5076,30.6681,143.5614,22,50,0,0,0,0); // CivilSpawn4
  107.     AddPlayerClass(66,-2195.9509,-2258.5076,30.6681,143.5614,22,50,0,0,0,0); // CivilSpawn5
  108.     AddStaticVehicle(411,-2200.7744,-2270.3438,30.2713,52.0416,123,1); // Infernus
  109.     return 1;
  110. }
  111. //==============================================================================
  112. public OnGameModeExit()
  113. {
  114.     return 1;
  115. }
  116. //==============================================================================
  117. public OnPlayerRequestClass(playerid, classid)
  118. {
  119.     SetPlayerPos(playerid, -1993.1256,-2388.0022,30.6250);
  120.     SetPlayerFacingAngle(playerid, 313.2327);
  121.     SetPlayerCameraPos(playerid, -1989.7252,-2384.7461,30.6250);
  122.     SetPlayerCameraLookAt(playerid, -1993.1256,-2388.0022,30.6250);
  123.     SetPlayerTeamFromClass(playerid,classid);
  124.     pClass[playerid]=classid;
  125.     switch(classid)
  126.     {
  127.         case 0:
  128.         {
  129.             GameTextForPlayer(playerid,"~b~ POLICIJA",10000,5);
  130.         }
  131.         case 1:
  132.         {
  133.             GameTextForPlayer(playerid,"~b~ POLICIJA",10000,5);
  134.         }
  135.         case 2:
  136.         {
  137.             GameTextForPlayer(playerid,"~b~ POLICIJA",10000,5);
  138.         }
  139.         case 3:
  140.         {
  141.             GameTextForPlayer(playerid,"~b~ POLICIJA",10000,5);
  142.         }
  143.         case 4:
  144.         {
  145.             GameTextForPlayer(playerid,"~b~ POLICIJA",10000,5);
  146.         }
  147.         case 5:
  148.         {
  149.             GameTextForPlayer(playerid,"~w~ CIVIL",10000,5);
  150.         }
  151.         case 6:
  152.         {
  153.             GameTextForPlayer(playerid,"~w~ CIVIL",10000,5);
  154.         }
  155.         case 7:
  156.         {
  157.             GameTextForPlayer(playerid,"~w~ CIVIL",10000,5);
  158.         }
  159.         case 8:
  160.         {
  161.             GameTextForPlayer(playerid,"~w~ CIVIL",10000,5);
  162.         }
  163.         case 9:
  164.         {
  165.             GameTextForPlayer(playerid,"~w~ CIVIL",10000,5);
  166.         }
  167.     }
  168.     return 1;
  169. }
  170. //==============================================================================
  171. SetPlayerTeamFromClass(playerid,classid)
  172. {
  173.     switch(classid)
  174.     {
  175.         case 0..4:
  176.         {
  177.             gTeam[playerid] = TEAM_COPS;
  178.         }
  179.         case 5..9:
  180.         {
  181.             gTeam[playerid] = TEAM_CIVIL;
  182.         }
  183.     }
  184.     return 0;
  185. }
  186. //==============================================================================
  187. SetPlayerToTeamColor(playerid)
  188. {
  189.     if(gTeam[playerid] == TEAM_COPS)
  190.     {
  191.         SetPlayerColor(playerid,TEAM_COPS_COLOR);
  192.     }
  193.     else return SetPlayerColor(playerid,TEAM_CIVIL_COLOR);
  194.     return 1;
  195. }
  196. //==============================================================================
  197. public OnPlayerConnect(playerid)
  198. {
  199. ////////////////////////////////////////////////////////////////////////////////
  200.     SetPlayerMapIcon(playerid, 1, -2161.3452, -2384.7817, 30.8963, 30, 0, MAPICON_LOCAL);
  201.     SetPlayerMapIcon(playerid, 2, -2103.5950, -2342.0413, 30.6172, 50, 0, MAPICON_LOCAL);
  202.     SetPlayerMapIcon(playerid, 3, -2155.3176,-2460.1699,30.8516, 14, 0, MAPICON_LOCAL);
  203. ////////////////////////////////////////////////////////////////////////////////
  204.     return 1;
  205. }
  206. //==============================================================================
  207. public OnPlayerDisconnect(playerid, reason)
  208. {
  209.     if(Mute[playerid] >= 1) // will check if the player was muted
  210.     {
  211.         new mutename[MAX_PLAYER_NAME], string[100]; // creates a few new public variables
  212.         GetPlayerName(playerid, mutename, sizeof(mutename)); // retrieve the player name
  213.         format(string, sizeof(string), "%s just left the game with a remaining mute time of %d seconds", mutename, Mute[playerid]); // will set the string that we'll use
  214.         for(new i = 0; i <= MAX_PLAYERS; i ++) // again, loops all the players
  215.         {
  216.             if(IsPlayerConnected(i) && IsPlayerAdmin(i)) // check if the player is connected and if they're an RCON admin
  217.             {
  218.                 SendClientMessage(i, 0xAFAFAFFF, string); // send the message to the player
  219.             }
  220.         }
  221.     }
  222.     Mute[playerid] = 0; // this will reset the mute time, so the next person that logs in with the same ID won't suffer a mute
  223.     return 1; // don't add this line if you've already got it at the bottom of your OnPlayerDisconnect
  224. }
  225. //==============================================================================
  226. public OnPlayerSpawn(playerid)
  227. {
  228.     if(gTeam[playerid] == TEAM_CIVIL)
  229.     {
  230.         new RandSpawn = random(sizeof(RandomSpawns));
  231.         SetPlayerPos(playerid,RandomSpawns[RandSpawn][0],RandomSpawns[RandSpawn][1],RandomSpawns[RandSpawn][2]);
  232.         SetPlayerToTeamColor(playerid);
  233.     }
  234.     return 1;
  235. }
  236. //==============================================================================
  237. public OnPlayerDeath(playerid, killerid, reason)
  238. {
  239.     GameTextForPlayer(playerid,"~r~~h~WASTED!",3500,0);
  240.     if(gTeam[killerid] == TEAM_COPS)
  241.     {
  242.         if(gTeam[playerid] == TEAM_COPS)
  243.         {
  244.             SendClientMessage(killerid,COLOR_WHITE,"[SERVER]: {00B7FF}TEAM KILLING NIJE DOZVOLJEN, ODUZETA SU TI ORUZIJA!");
  245.             ResetPlayerWeapons(killerid);
  246.         }
  247.         else
  248.         {
  249.             if(GetPlayerWantedLevel(playerid) == 0)
  250.             {
  251.                 SendClientMessage(killerid,COLOR_WHITE,"[SERVER]{00B7FF}NISI OVLASCEN DA UBIJAS NEVINE LJUDE, ODUZETO TI JE ORUZIJE!");
  252.                 ResetPlayerWeapons(killerid);
  253.             }
  254.             else if(GetPlayerWantedLevel(playerid) == 3) return SendClientMessage(killerid,COLOR_WHITE,"[SERVER] : {00B7FF}NESMETE UBIJATI IGRACE ZA MANJIM WANTED LEVELOM!");
  255.             else return GivePlayerMoney(killerid,3000);
  256.         }
  257.     }
  258.     else
  259.     {
  260.         if(GetPlayerWantedLevel(killerid) == 0 || GetPlayerWantedLevel(killerid) == 3)
  261.      {
  262.         SetPlayerWantedLevel(killerid,6);
  263.         SetPlayerColor(killerid,COLOR_RED);
  264.         GivePlayerMoney(killerid,1500);
  265.         SendClientMessage(killerid,COLOR_RED,"[SERVER]{FF0000}SADA IMATE NAJVECI WANTED LEVEL!");
  266.         }
  267.         else return GivePlayerMoney(killerid,1500);
  268.     }
  269.     return 1;
  270. }
  271. //=============================================================================
  272. public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
  273. {
  274.     if(gTeam[playerid] == TEAM_CIVIL && GetPlayerWantedLevel(playerid) == 0)
  275.     {
  276.         SetPlayerWantedLevel(playerid,3);
  277.         SetPlayerColor(playerid,COLOR_YELLOW);
  278.         SendClientMessage(playerid,COLOR_WHITE,"[SERVER] : {FF0000}Pocinili ste zlocin: Napad na gradjana! (Prijavio:Nepoznat)");
  279.     }
  280.     return 1;
  281. }
  282. //==============================================================================
  283. public SecondTimer()
  284. {
  285.     for(new i = 0; i < MAX_PLAYERS; i ++) // loops all the players
  286.     {
  287.         if(IsPlayerConnected(i)) // will check if the player is connected
  288.         {
  289.             if(Mute[i] >= 1) // will check if their mute time is equal or above to 1
  290.             {
  291.                 Mute[i] --; // if it is, then it will minus the mute time by 1 second
  292.             }
  293.         }
  294.     }
  295.     return 1;
  296. }
  297. //==============================================================================
  298. public OnVehicleSpawn(vehicleid)
  299. {
  300.     return 1;
  301. }
  302. //==============================================================================
  303. public OnVehicleDeath(vehicleid, killerid)
  304. {
  305.     return 1;
  306. }
  307. //==============================================================================
  308. OnPlayerText(playerid, text[])
  309. {
  310.     if(Mute[playerid] >= 1) // check if the player is muted
  311.     {
  312.         new string[50]; // creates a new variable
  313.         format(string, sizeof(string), "You're muted for another %d seconds.", Mute[playerid]); // sets the string
  314.         SendClientMessage(playerid, 0xFFFFFFFF, string); // sends the message
  315.         return 0; // this is crucial, by returning 0 here it will stop the player from being able to talk
  316.     }
  317.     return 1; // don't put this here if you've already got it at the bottom of your OnPlayerText.
  318. }
  319. //==============================================================================
  320. public OnPlayerCommandText(playerid, cmdtext[])
  321. {
  322.     return 0;
  323. }
  324. //==============================================================================
  325. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  326. {
  327.     return 1;
  328. }
  329.  
  330. public OnPlayerExitVehicle(playerid, vehicleid)
  331. {
  332.     return 1;
  333. }
  334. //==============================================================================
  335. public OnPlayerStateChange(playerid, newstate, oldstate)
  336. {
  337.     return 1;
  338. }
  339. //==============================================================================
  340. public OnPlayerEnterCheckpoint(playerid)
  341. {
  342.     return 1;
  343. }
  344. //==============================================================================
  345. public OnPlayerLeaveCheckpoint(playerid)
  346. {
  347.     return 1;
  348. }
  349. //==============================================================================
  350. public OnPlayerEnterRaceCheckpoint(playerid)
  351. {
  352.     return 1;
  353. }
  354. //==============================================================================
  355. public OnPlayerLeaveRaceCheckpoint(playerid)
  356. {
  357.     return 1;
  358. }
  359. //==============================================================================
  360. public OnRconCommand(cmd[])
  361. {
  362.     return 1;
  363. }
  364. //==============================================================================
  365. public OnPlayerRequestSpawn(playerid)
  366. {
  367.     return 1;
  368. }
  369. //==============================================================================
  370. public OnObjectMoved(objectid)
  371. {
  372.     return 1;
  373. }
  374. //==============================================================================
  375. public OnPlayerObjectMoved(playerid, objectid)
  376. {
  377.     return 1;
  378. }
  379. //==============================================================================
  380. public OnPlayerPickUpPickup(playerid, pickupid)
  381. {
  382.     return 1;
  383. }
  384. //==============================================================================
  385. public OnVehicleMod(playerid, vehicleid, componentid)
  386. {
  387.     return 1;
  388. }
  389. //==============================================================================
  390. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  391. {
  392.     return 1;
  393. }
  394. //==============================================================================
  395. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  396. {
  397.     return 1;
  398. }
  399. //==============================================================================
  400. public OnPlayerSelectedMenuRow(playerid, row)
  401. {
  402.     return 1;
  403. }
  404. //==============================================================================
  405. public OnPlayerExitedMenu(playerid)
  406. {
  407.     return 1;
  408. }
  409. //==============================================================================
  410. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  411. {
  412.     return 1;
  413. }
  414. //==============================================================================
  415. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  416. {
  417.     if(newkeys & KEY_SECONDARY_ATTACK)
  418.   {
  419.         if(IsPlayerInRangeOfPoint(playerid,2.0,-2103.5950,-2342.0413,30.6172))
  420.         {
  421.             SetPlayerVirtualWorld(playerid,1);
  422.             SetPlayerInterior(playerid,17);
  423.             SetPlayerPos(playerid,377.1211,-193.3042,1000.6328);
  424.             SetCameraBehindPlayer(playerid);
  425.             SendClientMessage(playerid,COLOR_WHITE,"[RESTORANT] : {00B7FF}Dobrodosli!");
  426.         }
  427.         else if(IsPlayerInRangeOfPoint(playerid,2.0,377.1211,-193.3042,1000.6328))
  428.         {
  429.             SetPlayerVirtualWorld(playerid,0);
  430.             SetPlayerInterior(playerid,0);
  431.             SetPlayerPos(playerid,-2103.5950,-2342.0413,30.6172);
  432.             SetCameraBehindPlayer(playerid);
  433.             SendClientMessage(playerid,COLOR_WHITE,"[RESTORANT] : {00B7FF}Dovidjenja!");
  434.         } //////////
  435.         if(IsPlayerInRangeOfPoint(playerid,2.0,-2155.3176,-2460.1699,30.8516))
  436.         {
  437.             SetPlayerVirtualWorld(playerid,1);
  438.             SetPlayerInterior(playerid,9);
  439.             SetPlayerPos(playerid,364.9119,-11.4115,1001.8516);
  440.             SetCameraBehindPlayer(playerid);
  441.             SendClientMessage(playerid,COLOR_WHITE,"[CLUCKIN'BELL] : {00B7FF}Dobrodosli!");
  442.         }
  443.         else if(IsPlayerInRangeOfPoint(playerid,2.0,364.9119,-11.4115,1001.8516))
  444.         {
  445.             SetPlayerVirtualWorld(playerid,0);
  446.             SetPlayerInterior(playerid,0);
  447.             SetPlayerPos(playerid,-2155.3176,-2460.1699,30.8516);
  448.             SetCameraBehindPlayer(playerid);
  449.             SendClientMessage(playerid,COLOR_WHITE,"[CLUCKIN'BELL] : {00B7FF}Dovidjenja!");
  450.         } ///////////////
  451.         if(IsPlayerInRangeOfPoint(playerid,2.0,-2161.3452,-2384.7817,30.8963))
  452.         {
  453.             SetPlayerVirtualWorld(playerid,1);
  454.             SetPlayerInterior(playerid,6);
  455.             SetPlayerPos(playerid,246.3966,63.2117,1003.6406);
  456.             SetCameraBehindPlayer(playerid);
  457.             SendClientMessage(playerid,COLOR_WHITE,"[POLICIJA] : {00B7FF}Dobrodosli!");
  458.         }
  459.         else if(IsPlayerInRangeOfPoint(playerid,2.0,246.3966,63.2117,1003.6406))
  460.         {
  461.             SetPlayerVirtualWorld(playerid,0);
  462.             SetPlayerInterior(playerid,0);
  463.             SetPlayerPos(playerid,-2161.3452,-2384.7817,30.8963);
  464.             SetCameraBehindPlayer(playerid);
  465.             SendClientMessage(playerid,COLOR_WHITE,"[POLICIJA] : {00B7FF}Dovidjenja!");
  466.         }
  467.     }
  468.     return 1;
  469. }
  470. //==============================================================================
  471. public OnRconLoginAttempt(ip[], password[], success)
  472. {
  473.     return 1;
  474. }
  475. //==============================================================================
  476. public OnPlayerUpdate(playerid)
  477. {
  478.     return 1;
  479. }
  480. //==============================================================================
  481. public OnPlayerStreamIn(playerid, forplayerid)
  482. {
  483.     return 1;
  484. }
  485. //==============================================================================
  486. public OnPlayerStreamOut(playerid, forplayerid)
  487. {
  488.     return 1;
  489. }
  490. //==============================================================================
  491. public OnVehicleStreamIn(vehicleid, forplayerid)
  492. {
  493.     return 1;
  494. }
  495. //==============================================================================
  496. public OnVehicleStreamOut(vehicleid, forplayerid)
  497. {
  498.     return 1;
  499. }
  500. //==============================================================================
  501. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  502. {
  503.     return 1;
  504. }
  505. //==============================================================================
  506. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  507. {
  508.     return 1;
  509. }
  510. //==============================================================================
  511. CMD:rob(playerid,params[])
  512. {
  513.     if(gTeam[playerid] == TEAM_CIVIL)
  514.     {
  515.         if(robpossible == 1)
  516.         {
  517.             if(IsPlayerInRangeOfPoint(playerid,5.0,380.7079,-190.5341,1000.6328)) // RESTORANT
  518.  
  519.             {
  520.                 robpossible = 0;
  521.                 SetTimer("timer1", 120000, false);
  522.                 SetTimer("timer2", 20000, false);
  523.                 SendClientMessage(playerid,COLOR_WHITE,"[SERVER] : {FF0000}Momentalno pljackas  Restorant, policija je obavestena!");
  524.                 SendClientMessage(playerid,COLOR_WHITE,"[SERVER] : {FF0000}Sacekajte malo!");
  525.                 TogglePlayerControllable(playerid,0);
  526.             }
  527.             if(IsPlayerInRangeOfPoint(playerid,5.0,369.3565,-6.0164,1001.8516)) // CLUCKIN'BELL
  528.  
  529.             {
  530.                 robpossible = 0;
  531.                 SetTimer("timer1", 120000, false);
  532.                 SetTimer("timer2", 20000, false);
  533.                 SendClientMessage(playerid,COLOR_WHITE,"[SERVER] : {FF0000}Momentalno pljackas  Cluckin'Bell, policija je obavestena!");
  534.                 SendClientMessage(playerid,COLOR_WHITE,"[SERVER] : {FF0000}Sacekajte malo!");
  535.                 TogglePlayerControllable(playerid,0);
  536.             }
  537.             else return SendClientMessage(playerid,-1,"[SERVER] : {00B7FF}Moras biti u nekoj trgovini!");
  538.         }
  539.         else return SendClientMessage(playerid,-1,"[SERVER] : {00B7FF}Trgovina se ne moze pljackati momentalno, pokusaj kasnije!");
  540.     }
  541.     else return SendClientMessage(playerid,-1,"[SERVER] : {00B7FF}Nisi civil!");
  542.     return 1;
  543. }
  544. public timer1()
  545. {
  546.     robpossible = 1;
  547.     SendClientMessageToAll(COLOR_WHITE,"[SERVER] : {FF0000}Trgovina se moze opet pljackati!");
  548. }
  549. public timer2(playerid)
  550. {
  551.     new msg[128];
  552.     new money = random(10000);
  553.     GivePlayerMoney(playerid,money);
  554.     format(msg,sizeof(msg),"{FFFFFF}[SERVER] : {FF0000}Opljackali ste trgovinu i zaradili $%d!",money);
  555.     SendClientMessage(playerid,COLOR_RED,msg);
  556.     TogglePlayerControllable(playerid,1);
  557.     SetPlayerWantedLevel(playerid,6);
  558.     SetPlayerColor(playerid,COLOR_RED);
  559. }
  560. CMD:gear(playerid,params[])
  561. {
  562.     if(gTeam[playerid] == TEAM_COPS)
  563.     {
  564.         if(!IsPlayerInRangeOfPoint(playerid,3.0,255.2108,74.0874,1003.6406)) return SendClientMessage(playerid,COLOR_WHITE,"[SERVER] : {00B7FF}Nisi kod Pickupa!");
  565.         SetPlayerHealth(playerid,100);
  566.         SetPlayerArmour(playerid,100);
  567.         GivePlayerWeapon(playerid,22,100);
  568.         GivePlayerWeapon(playerid,27,100);
  569.         GivePlayerWeapon(playerid,29,350);
  570.         GivePlayerWeapon(playerid,31,300);
  571.         GivePlayerWeapon(playerid,3,1);
  572.         SendClientMessage(playerid,COLOR_WHITE,"[SERVER] : {00B7FF}Uzeli ste PD Opremu!");
  573.         }
  574.     else SendClientMessage(playerid,COLOR_WHITE,"[SERVER] : {00B7FF}Nisi Policajac!");
  575.     return 1;
  576. }
  577. CMD:pravila(playerid,params[])
  578. {
  579.     SendClientMessage(playerid,COLOR_WHITE,"=====Jiky CnR Pravila=====");
  580.     SendClientMessage(playerid,COLOR_WHITE,"1. {00B7FF}Postuj admina!");
  581.     SendClientMessage(playerid,COLOR_WHITE,"2. {00B7FF}Postuj druge igrace!");
  582.     SendClientMessage(playerid,COLOR_WHITE,"3. {00B7FF}Zabranjeno DManje/Random ubijanje!");
  583.     SendClientMessage(playerid,COLOR_WHITE,"4. {00B7FF}Zabranjeno citovanje/Bugovi!");
  584.     SendClientMessage(playerid,COLOR_WHITE,"5. {00B7FF}Policija nesme napadati nevine civile!");
  585.     SendClientMessage(playerid,COLOR_WHITE,"7. {00B7FF}Bez reklamiranja/spama");
  586.     SendClientMessage(playerid,COLOR_WHITE,"8. {00B7FF}Ne bjezite sa servera ukoliko ste je nadrljali :D");
  587.     SendClientMessage(playerid,COLOR_WHITE,"9. {00B7FF}Vozi ljepo");
  588.     SendClientMessage(playerid,COLOR_WHITE,"10. {00B7FF}Policija ne radi sa civilima");
  589.     return 1;
  590. }
  591. CMD:forum(playerid,params[])
  592. {
  593.     SendClientMessage(playerid,COLOR_WHITE,"[FORUM] : {00B7FF}www.uskoro.com");
  594.     return 1;
  595. }
  596. CMD:ts3(playerid,params[])
  597. {
  598.     SendClientMessage(playerid,COLOR_WHITE,"[TS3] : {00B7FF}ts3.uskoro.com");
  599.     return 1;
  600. }
  601. //==============================================================================
  602. forward SendMSG();
  603. public SendMSG()
  604. {
  605.     new randMSG = random(sizeof(RandomMSG));
  606.     SendClientMessageToAll(-1, RandomMSG[randMSG]);
  607. }
  608. //==============================================================================
  609. CMD:kill(playerid,params)
  610. {
  611.     SetPlayerHealth(playerid,0);
  612.     return 1;
  613. }
  614. //==============================================================================MUTE CMDS
  615. CMD:mute(playerid, params[])
  616. {
  617.     if(!IsPlayerAdmin(playerid)) return 0; // returns "SERVER: Unknown command." if the player is not an RCON admin
  618.     new giveplayerid, reason[50], string[120], minutes, pname1[MAX_PLAYER_NAME], pname2[MAX_PLAYER_NAME]; // declares a few new variables
  619.     if(sscanf(params, "uds[50]", giveplayerid, minutes, reason)) return SendClientMessage(playerid, 0xFFFFFFFF, "Correct usage: /mute [playerid/name] [time in minutes] [reason]"); // returns this message if the player typed an incorrect syntax
  620.     if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFFFFFFFF, "Player not connected."); // returns this message if the receiver player is not connected
  621.     GetPlayerName(playerid, pname1, sizeof(pname1)); // get the sender name
  622.     GetPlayerName(giveplayerid, pname2, sizeof(pname2)); // get the receiver name
  623.     format(string, sizeof(string), "%s (%d) was muted for %d minutes by admin %s (%d), reason: %s", pname2, giveplayerid, minutes, pname1, playerid, reason); // sets the string
  624.     SendClientMessageToAll(0xFFFFFFFF, string); // sends a global message
  625.     new calc = minutes*60; // calculates the seconds
  626.     Mute[giveplayerid] = calc; // sets the mute time to the calculated value
  627.     GameTextForPlayer(giveplayerid, "~r~muted~n~~w~check the chat", 5000, 6); // 5 second game text for the receiver that got the mute informing him to check the chat for information about the mute
  628.     return 1;
  629. }
  630. //==============================================================================MUTE CMDS
  631. CMD:unmute(playerid, params[])
  632. {
  633.  
  634.     if(!IsPlayerAdmin(playerid)) return 0;
  635.     new giveplayerid, reason[50], string[120]; // variables
  636.     if(sscanf(params, "us[50]", giveplayerid, reason)) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}Syntax: /unmute [playerid/name] [reason]"); // syntax check
  637.     if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}Player not connected."); // player not connected
  638.     new pname1[MAX_PLAYER_NAME], pname2[MAX_PLAYER_NAME]; // more variables
  639.     GetPlayerName(playerid, pname1, sizeof(pname1)); // gets the senders name
  640.     GetPlayerName(giveplayerid, pname2, sizeof(pname2)); // gets the receivers name
  641.     format(string, sizeof(string), "%s (%d) was unmuted by %s (%d), reason: %s", pname2, giveplayerid, pname1, playerid, reason); // sets the string
  642.     SendClientMessageToAll(0xFFFFFFFF, string); // sends everyone the message that was string'd
  643.     Mute[giveplayerid] = 0; // sets the mute of the other player to 0
  644.     GameTextForPlayer(giveplayerid, "~g~unmuted~n~~w~check the chat", 5000, 6); // game text for the other player informing them that his mute has been taken off him
  645.     return 1;
  646. }
  647. //==============================================================================MUTE CMDS
  648. CMD:mymute(playerid, params[])
  649. {
  650.     if(Mute[playerid] <= 0) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}You're not muted at the moment."); // checks if the player is muted, if not, it will return that message
  651.     new string[50]; // new variable
  652.     SendClientMessage(playerid, 0xFFFFFFFF, "|__________ My Mute __________|"); // sends a base message
  653.     format(string, sizeof(string), "%d seconds remain from your mute.", Mute[playerid]); // sets the string
  654.     SendClientMessage(playerid, 0xFFFFFFFF, string); // sends the string'd message
  655.     return 1;
  656. }
  657. //==============================================================================MUTE CMDS
  658. CMD:mutelist(playerid, params[])
  659. {
  660.     new iname[MAX_PLAYER_NAME], string[120], count; // new variables
  661.     for(new i = 0; i < MAX_PLAYERS; i++) // loops all the players
  662.     {
  663.         if(IsPlayerConnected(i)) // checks if the player is connected
  664.         {
  665.             if(Mute[i] >= 1) // checks if the looped player is muted at the moment
  666.             {
  667.                 GetPlayerName(i, iname, sizeof(iname)); // if they are, this retrieves the name
  668.                 format(string, sizeof(string), "%s (%d) - %d seconds remaining", iname, i, Mute[i]); // sets the string
  669.                 SendClientMessage(playerid, 0xFFFFFFFF, string); // sends the message
  670.                 count++; // puts the count to a ++ value, you'll see why further down
  671.             }
  672.         }
  673.     }
  674.     if(count == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "There are no muted players online."); // if there are no muted players online, it'll return this message
  675.     if(count == 1) return SendClientMessage(playerid, 0xFFFFFFFF, "There is 1 player who is muted online."); // if there's just 1 muted player online, it'll returns this message
  676.     if(count >= 2) // if there are more than 1 muted players online, the following will occur
  677.     {
  678.         format(string, sizeof(string), "There are %d amount of players who are online and muted.", count); // sets the string
  679.         SendClientMessage(playerid, 0xFFFFFFFF, string); // sends the message
  680.     }
  681.     return 1;
  682. }
  683. //==============================================================================MUTE CMDS
  684. CMD:unmuteall(playerid, params[])
  685. {
  686.     if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}Only admins can use this command."); // checks if the sender is an RCON logged in admin
  687.     new count, string[120]; // new variables
  688.     for(new i = 0; i < MAX_PLAYERS; i++) // loops all the players one-by-one
  689.     {
  690.         if(IsPlayerConnected(i)) // checks if the player is connected
  691.         {
  692.             if(Mute[i] >= 1) // if the looped player has a mute time more than 0
  693.             {
  694.                 count++; // the count will go up
  695.                 Mute[i] = 0; // and the mute time will be set to 0
  696.             }
  697.         }
  698.     }
  699.     new uname[MAX_PLAYER_NAME]; // this is the name of the sender
  700.     GetPlayerName(playerid, uname, sizeof(uname)); // this will get the playerid (sender)'s name
  701.     format(string, sizeof(string), "%d players have been admin-unmuted by %s (%d)", count, uname, playerid); // sets the string to say how many players were unmuted and by who
  702.     SendClientMessageToAll(0xFFFFFFFF, string); // sends this global message
  703.     return 1;
  704. }
  705. //==============================================================================MUTE CMDS
  706. CMD:mutecmds(playerid, params[])
  707. {
  708.     SendClientMessage(playerid, 0xFFFFFFFF, "/mute - Mute a player {FF0000}(ADMINS ONLY)");
  709.     SendClientMessage(playerid, 0xFFFFFFFF, "/unmute - Unmute a player {FF0000}(ADMINS ONLY)");
  710.     SendClientMessage(playerid, 0xFFFFFFFF, "/mymute - View your own mute time");
  711.     SendClientMessage(playerid, 0xFFFFFFFF, "/mutelist - View a global list of all the online players who are muted");
  712.     SendClientMessage(playerid, 0xFFFFFFFF, "/unmuteall - Unmute all the players on the server at once {FF0000}(ADMINS ONLY)");
  713.     return 1;
  714. }
  715. //==============================================================================MUTE CMDS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement