Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- D:\Filip\Jiky Cops And Robbers\gamemodes\JCNR.pwn(710) : warning 203: symbol is never used: "OnPlayerText"
- Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
- 1 Warning.
- /*==============================================================================
- Jiky Cops And Robbers V1.0
- Owner:Jiky
- Scripter:Jiky
- Credits:Sad Goat Production
- ==============================================================================*/
- #include <a_samp>
- #include <zcmd>
- #include <sscanf2>
- //==============================================================================
- #define COLOR_GREY 0xAFAFAFAA
- #define COLOR_GREEN 0x33AA33AA
- #define COLOR_RED 0xFF0000FF
- #define COLOR_YELLOW 0xFFFF00AA
- #define COLOR_WHITE 0xFFFFFFAA //CIVIL
- #define COLOR_BLUE 0x0000BBAA //POLICE
- #define COLOR_LIGHTBLUE 0x33CCFFAA
- #define COLOR_ORANGE 0xFF9900AA
- #define COLOR_LIME 0x10F441AA
- #define COLOR_MAGENTA 0xFF00FFFF
- #define ZA3DTEXT 0x00F5FFFF
- //==============================================================================
- #define TEAM_COPS 1
- #define TEAM_CIVIL 2
- #define TEAM_COPS_COLOR 0x0000BBAA
- #define TEAM_CIVIL_COLOR 0xFFFFFFAA
- forward timer1();
- forward timer2(playerid);
- forward SendMSG();
- forward SecondTimer(); //MUTE SECOND BY SECOND TIMER
- //==============================================================================
- new gTeam[MAX_PLAYERS];
- new pClass[MAX_PLAYERS];
- new robpossible;
- new RandomMSG[][] =
- {
- "{37DB45}[{FFFFFF}INFO{37DB45}]: {FFFFFF}Zabranjeno koristenje citova ili modova koji vam daju prednost u igri{FF0000}(Kazna BAN){FFFFFF}!",
- "{37DB45}[{FFFFFF}INFO{37DB45}]: {FFFFFF}Zabranjeno iskoristavanje bagova{FF0000}(Kazna BAN){FFFFFF}!",
- "{37DB45}[{FFFFFF}INFO{37DB45}]: {FFFFFF}Postujte pravila {37DB45}/pravila!{FFFFFF}",
- "{37DB45}[{FFFFFF}INFO{37DB45}]: {FFFFFF}Posetite nas forum {37DB45}/forum!{FFFFFF}",
- "{37DB45}[{FFFFFF}INFO{37DB45}]: {FFFFFF}Posetite nas ts3 {37DB45}/ts3!{FFFFFF}",
- "{37DB45}[{FFFFFF}INFO{37DB45}]: {FFFFFF}Zabranjeno psovanje {FF0000}(Kazna JAIL/MUTE){FFFFFF}!"
- };
- new Float:RandomSpawns[][] =
- {
- {-2186.6382,-2442.7085,30.6250,231.0229},
- {-2153.2136,-2469.7542,30.6250,231.0229},
- {-2114.8606,-2466.5491,30.6250,47.6401},
- {-2110.5266,-2423.6584,30.6250,139.6565},
- {-2196.2129,-2260.4041,30.6532,142.0587},
- {-2107.1008,-2249.3411,30.6250,142.8943}
- };
- new Mute[MAX_PLAYERS]; //VARIJABLA 1s=1000ms
- //==============================================================================
- main()
- {
- print("\n----------------------------------");
- print(" Jiky Cops And Robbers V1.0 ");
- print("----------------------------------\n");
- }
- //==============================================================================
- public OnGameModeInit()
- {
- SetTimer("SecondTimer", 1000, true); // MUTE TIMER
- SetTimer("SendMSG", 30000, true);
- //////////////////////////////////////////////////////////////////////////////// MAPS
- //PD
- CreateObject(8615,-2171.8999000,-2366.6001000,32.3000000,0.0000000,0.0000000,231.0000000); //object(vgssstairs04_lvs) (1)
- CreateObject(1428,-2173.6001000,-2369.3000000,35.6000000,0.0000000,181.0000000,49.7500000); //object(dyn_ladder) (1)
- CreateObject(633,-2165.7000000,-2387.1001000,30.6000000,0.0000000,0.0000000,1.2500000); //object(veg_palmkb10) (2)
- CreateObject(970,-2161.8000000,-2388.0000000,30.2000000,0.0000000,0.0000000,48.7500000); //object(fencesmallb) (1)
- CreateObject(970,-2164.3000000,-2386.0000000,30.2000000,0.0000000,0.0000000,49.9920000); //object(fencesmallb) (5)
- CreateObject(633,-2162.6001000,-2389.5000000,30.6000000,0.0000000,0.0000000,1.2470000); //object(veg_palmkb10) (3)
- //PD END
- ////////////////////////////////////////////////////////////////////////////////
- DisableInteriorEnterExits();
- EnableStuntBonusForAll(0);
- robpossible = 1;
- ////////////////////////////////////////////////////////////////////////////////
- Create3DTextLabel("[Angel Pine]\nPolice Department",ZA3DTEXT,-2161.3452, -2384.7817, 30.8963, 8.0, 0); //PD
- Create3DTextLabel("[Angel Pine]\nRESTORANT",ZA3DTEXT,-2103.5950, -2342.0413, 30.6172, 8.0, -1); //RESTORANT
- Create3DTextLabel("[Angel Pine]\nCluckin'Bell",ZA3DTEXT,-2155.3176 ,-2460.1699, 30.8516, 8.0, -1); //CLUCKIN'BELL
- Create3DTextLabel("[POLICE]\n/gear",ZA3DTEXT,255.2108, 74.0874, 1003.6406, 8.0, 1); //PD GEAR
- ////////////////////////////////////////////////////////////////////////////////
- CreatePickup(1239,0,-2103.5950,-2342.0413,30.6172,-1); // RESTORAN
- CreatePickup(1247,0,-2161.3452,-2384.7817,30.8963,-1); // POLICIJA
- CreatePickup(1239,0,-2155.3176,-2460.1699,30.8516,-1); // CLUCKIN'BELL
- CreatePickup(1242,0,255.2108,74.0874,1003.6406,-1); // GEAR
- ////////////////////////////////////////////////////////////////////////////////
- SetGameModeText("Cops And Robbers by Jiky");
- AddPlayerClass(283,-2163.0229,-2386.9519,30.6250,141.1998,29,300,0,0,0,0); // PoliceSpawn1
- AddPlayerClass(280,-2163.0229,-2386.9519,30.6250,141.1998,29,300,0,0,0,0); // PoliceSpawn2
- AddPlayerClass(281,-2163.0229,-2386.9519,30.6250,141.1998,29,300,0,0,0,0); // PoliceSpawn3
- AddPlayerClass(282,-2163.0229,-2386.9519,30.6250,141.1998,29,300,0,0,0,0); // PoliceSpawn4
- AddPlayerClass(265,-2163.0229,-2386.9519,30.6250,141.1998,29,300,0,0,0,0); // PoliceSpawn5
- AddPlayerClass(20,-2195.9509,-2258.5076,30.6681,143.5614,22,50,0,0,0,0); // CivilSpawn1
- AddPlayerClass(46,-2195.9509,-2258.5076,30.6681,143.5614,22,50,0,0,0,0); // CivilSpawn2
- AddPlayerClass(47,-2195.9509,-2258.5076,30.6681,143.5614,22,50,0,0,0,0); // CivilSpawn3
- AddPlayerClass(48,-2195.9509,-2258.5076,30.6681,143.5614,22,50,0,0,0,0); // CivilSpawn4
- AddPlayerClass(66,-2195.9509,-2258.5076,30.6681,143.5614,22,50,0,0,0,0); // CivilSpawn5
- AddStaticVehicle(411,-2200.7744,-2270.3438,30.2713,52.0416,123,1); // Infernus
- return 1;
- }
- //==============================================================================
- public OnGameModeExit()
- {
- return 1;
- }
- //==============================================================================
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerPos(playerid, -1993.1256,-2388.0022,30.6250);
- SetPlayerFacingAngle(playerid, 313.2327);
- SetPlayerCameraPos(playerid, -1989.7252,-2384.7461,30.6250);
- SetPlayerCameraLookAt(playerid, -1993.1256,-2388.0022,30.6250);
- SetPlayerTeamFromClass(playerid,classid);
- pClass[playerid]=classid;
- switch(classid)
- {
- case 0:
- {
- GameTextForPlayer(playerid,"~b~ POLICIJA",10000,5);
- }
- case 1:
- {
- GameTextForPlayer(playerid,"~b~ POLICIJA",10000,5);
- }
- case 2:
- {
- GameTextForPlayer(playerid,"~b~ POLICIJA",10000,5);
- }
- case 3:
- {
- GameTextForPlayer(playerid,"~b~ POLICIJA",10000,5);
- }
- case 4:
- {
- GameTextForPlayer(playerid,"~b~ POLICIJA",10000,5);
- }
- case 5:
- {
- GameTextForPlayer(playerid,"~w~ CIVIL",10000,5);
- }
- case 6:
- {
- GameTextForPlayer(playerid,"~w~ CIVIL",10000,5);
- }
- case 7:
- {
- GameTextForPlayer(playerid,"~w~ CIVIL",10000,5);
- }
- case 8:
- {
- GameTextForPlayer(playerid,"~w~ CIVIL",10000,5);
- }
- case 9:
- {
- GameTextForPlayer(playerid,"~w~ CIVIL",10000,5);
- }
- }
- return 1;
- }
- //==============================================================================
- SetPlayerTeamFromClass(playerid,classid)
- {
- switch(classid)
- {
- case 0..4:
- {
- gTeam[playerid] = TEAM_COPS;
- }
- case 5..9:
- {
- gTeam[playerid] = TEAM_CIVIL;
- }
- }
- return 0;
- }
- //==============================================================================
- SetPlayerToTeamColor(playerid)
- {
- if(gTeam[playerid] == TEAM_COPS)
- {
- SetPlayerColor(playerid,TEAM_COPS_COLOR);
- }
- else return SetPlayerColor(playerid,TEAM_CIVIL_COLOR);
- return 1;
- }
- //==============================================================================
- public OnPlayerConnect(playerid)
- {
- ////////////////////////////////////////////////////////////////////////////////
- SetPlayerMapIcon(playerid, 1, -2161.3452, -2384.7817, 30.8963, 30, 0, MAPICON_LOCAL);
- SetPlayerMapIcon(playerid, 2, -2103.5950, -2342.0413, 30.6172, 50, 0, MAPICON_LOCAL);
- SetPlayerMapIcon(playerid, 3, -2155.3176,-2460.1699,30.8516, 14, 0, MAPICON_LOCAL);
- ////////////////////////////////////////////////////////////////////////////////
- return 1;
- }
- //==============================================================================
- public OnPlayerDisconnect(playerid, reason)
- {
- if(Mute[playerid] >= 1) // will check if the player was muted
- {
- new mutename[MAX_PLAYER_NAME], string[100]; // creates a few new public variables
- GetPlayerName(playerid, mutename, sizeof(mutename)); // retrieve the player name
- 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
- for(new i = 0; i <= MAX_PLAYERS; i ++) // again, loops all the players
- {
- if(IsPlayerConnected(i) && IsPlayerAdmin(i)) // check if the player is connected and if they're an RCON admin
- {
- SendClientMessage(i, 0xAFAFAFFF, string); // send the message to the player
- }
- }
- }
- 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
- return 1; // don't add this line if you've already got it at the bottom of your OnPlayerDisconnect
- }
- //==============================================================================
- public OnPlayerSpawn(playerid)
- {
- if(gTeam[playerid] == TEAM_CIVIL)
- {
- new RandSpawn = random(sizeof(RandomSpawns));
- SetPlayerPos(playerid,RandomSpawns[RandSpawn][0],RandomSpawns[RandSpawn][1],RandomSpawns[RandSpawn][2]);
- SetPlayerToTeamColor(playerid);
- }
- return 1;
- }
- //==============================================================================
- public OnPlayerDeath(playerid, killerid, reason)
- {
- GameTextForPlayer(playerid,"~r~~h~WASTED!",3500,0);
- if(gTeam[killerid] == TEAM_COPS)
- {
- if(gTeam[playerid] == TEAM_COPS)
- {
- SendClientMessage(killerid,COLOR_WHITE,"[SERVER]: {00B7FF}TEAM KILLING NIJE DOZVOLJEN, ODUZETA SU TI ORUZIJA!");
- ResetPlayerWeapons(killerid);
- }
- else
- {
- if(GetPlayerWantedLevel(playerid) == 0)
- {
- SendClientMessage(killerid,COLOR_WHITE,"[SERVER]{00B7FF}NISI OVLASCEN DA UBIJAS NEVINE LJUDE, ODUZETO TI JE ORUZIJE!");
- ResetPlayerWeapons(killerid);
- }
- else if(GetPlayerWantedLevel(playerid) == 3) return SendClientMessage(killerid,COLOR_WHITE,"[SERVER] : {00B7FF}NESMETE UBIJATI IGRACE ZA MANJIM WANTED LEVELOM!");
- else return GivePlayerMoney(killerid,3000);
- }
- }
- else
- {
- if(GetPlayerWantedLevel(killerid) == 0 || GetPlayerWantedLevel(killerid) == 3)
- {
- SetPlayerWantedLevel(killerid,6);
- SetPlayerColor(killerid,COLOR_RED);
- GivePlayerMoney(killerid,1500);
- SendClientMessage(killerid,COLOR_RED,"[SERVER]{FF0000}SADA IMATE NAJVECI WANTED LEVEL!");
- }
- else return GivePlayerMoney(killerid,1500);
- }
- return 1;
- }
- //=============================================================================
- public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
- {
- if(gTeam[playerid] == TEAM_CIVIL && GetPlayerWantedLevel(playerid) == 0)
- {
- SetPlayerWantedLevel(playerid,3);
- SetPlayerColor(playerid,COLOR_YELLOW);
- SendClientMessage(playerid,COLOR_WHITE,"[SERVER] : {FF0000}Pocinili ste zlocin: Napad na gradjana! (Prijavio:Nepoznat)");
- }
- return 1;
- }
- //==============================================================================
- public SecondTimer()
- {
- for(new i = 0; i < MAX_PLAYERS; i ++) // loops all the players
- {
- if(IsPlayerConnected(i)) // will check if the player is connected
- {
- if(Mute[i] >= 1) // will check if their mute time is equal or above to 1
- {
- Mute[i] --; // if it is, then it will minus the mute time by 1 second
- }
- }
- }
- return 1;
- }
- //==============================================================================
- public OnVehicleSpawn(vehicleid)
- {
- return 1;
- }
- //==============================================================================
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- //==============================================================================
- OnPlayerText(playerid, text[])
- {
- if(Mute[playerid] >= 1) // check if the player is muted
- {
- new string[50]; // creates a new variable
- format(string, sizeof(string), "You're muted for another %d seconds.", Mute[playerid]); // sets the string
- SendClientMessage(playerid, 0xFFFFFFFF, string); // sends the message
- return 0; // this is crucial, by returning 0 here it will stop the player from being able to talk
- }
- return 1; // don't put this here if you've already got it at the bottom of your OnPlayerText.
- }
- //==============================================================================
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- return 0;
- }
- //==============================================================================
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- return 1;
- }
- //==============================================================================
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- return 1;
- }
- //==============================================================================
- public OnPlayerEnterCheckpoint(playerid)
- {
- return 1;
- }
- //==============================================================================
- public OnPlayerLeaveCheckpoint(playerid)
- {
- return 1;
- }
- //==============================================================================
- public OnPlayerEnterRaceCheckpoint(playerid)
- {
- return 1;
- }
- //==============================================================================
- public OnPlayerLeaveRaceCheckpoint(playerid)
- {
- return 1;
- }
- //==============================================================================
- public OnRconCommand(cmd[])
- {
- return 1;
- }
- //==============================================================================
- public OnPlayerRequestSpawn(playerid)
- {
- return 1;
- }
- //==============================================================================
- public OnObjectMoved(objectid)
- {
- return 1;
- }
- //==============================================================================
- public OnPlayerObjectMoved(playerid, objectid)
- {
- return 1;
- }
- //==============================================================================
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- return 1;
- }
- //==============================================================================
- public OnVehicleMod(playerid, vehicleid, componentid)
- {
- return 1;
- }
- //==============================================================================
- public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
- {
- return 1;
- }
- //==============================================================================
- public OnVehicleRespray(playerid, vehicleid, color1, color2)
- {
- return 1;
- }
- //==============================================================================
- public OnPlayerSelectedMenuRow(playerid, row)
- {
- return 1;
- }
- //==============================================================================
- public OnPlayerExitedMenu(playerid)
- {
- return 1;
- }
- //==============================================================================
- public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- {
- return 1;
- }
- //==============================================================================
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(newkeys & KEY_SECONDARY_ATTACK)
- {
- if(IsPlayerInRangeOfPoint(playerid,2.0,-2103.5950,-2342.0413,30.6172))
- {
- SetPlayerVirtualWorld(playerid,1);
- SetPlayerInterior(playerid,17);
- SetPlayerPos(playerid,377.1211,-193.3042,1000.6328);
- SetCameraBehindPlayer(playerid);
- SendClientMessage(playerid,COLOR_WHITE,"[RESTORANT] : {00B7FF}Dobrodosli!");
- }
- else if(IsPlayerInRangeOfPoint(playerid,2.0,377.1211,-193.3042,1000.6328))
- {
- SetPlayerVirtualWorld(playerid,0);
- SetPlayerInterior(playerid,0);
- SetPlayerPos(playerid,-2103.5950,-2342.0413,30.6172);
- SetCameraBehindPlayer(playerid);
- SendClientMessage(playerid,COLOR_WHITE,"[RESTORANT] : {00B7FF}Dovidjenja!");
- } //////////
- if(IsPlayerInRangeOfPoint(playerid,2.0,-2155.3176,-2460.1699,30.8516))
- {
- SetPlayerVirtualWorld(playerid,1);
- SetPlayerInterior(playerid,9);
- SetPlayerPos(playerid,364.9119,-11.4115,1001.8516);
- SetCameraBehindPlayer(playerid);
- SendClientMessage(playerid,COLOR_WHITE,"[CLUCKIN'BELL] : {00B7FF}Dobrodosli!");
- }
- else if(IsPlayerInRangeOfPoint(playerid,2.0,364.9119,-11.4115,1001.8516))
- {
- SetPlayerVirtualWorld(playerid,0);
- SetPlayerInterior(playerid,0);
- SetPlayerPos(playerid,-2155.3176,-2460.1699,30.8516);
- SetCameraBehindPlayer(playerid);
- SendClientMessage(playerid,COLOR_WHITE,"[CLUCKIN'BELL] : {00B7FF}Dovidjenja!");
- } ///////////////
- if(IsPlayerInRangeOfPoint(playerid,2.0,-2161.3452,-2384.7817,30.8963))
- {
- SetPlayerVirtualWorld(playerid,1);
- SetPlayerInterior(playerid,6);
- SetPlayerPos(playerid,246.3966,63.2117,1003.6406);
- SetCameraBehindPlayer(playerid);
- SendClientMessage(playerid,COLOR_WHITE,"[POLICIJA] : {00B7FF}Dobrodosli!");
- }
- else if(IsPlayerInRangeOfPoint(playerid,2.0,246.3966,63.2117,1003.6406))
- {
- SetPlayerVirtualWorld(playerid,0);
- SetPlayerInterior(playerid,0);
- SetPlayerPos(playerid,-2161.3452,-2384.7817,30.8963);
- SetCameraBehindPlayer(playerid);
- SendClientMessage(playerid,COLOR_WHITE,"[POLICIJA] : {00B7FF}Dovidjenja!");
- }
- }
- return 1;
- }
- //==============================================================================
- public OnRconLoginAttempt(ip[], password[], success)
- {
- return 1;
- }
- //==============================================================================
- public OnPlayerUpdate(playerid)
- {
- return 1;
- }
- //==============================================================================
- public OnPlayerStreamIn(playerid, forplayerid)
- {
- return 1;
- }
- //==============================================================================
- public OnPlayerStreamOut(playerid, forplayerid)
- {
- return 1;
- }
- //==============================================================================
- public OnVehicleStreamIn(vehicleid, forplayerid)
- {
- return 1;
- }
- //==============================================================================
- public OnVehicleStreamOut(vehicleid, forplayerid)
- {
- return 1;
- }
- //==============================================================================
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- return 1;
- }
- //==============================================================================
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
- //==============================================================================
- CMD:rob(playerid,params[])
- {
- if(gTeam[playerid] == TEAM_CIVIL)
- {
- if(robpossible == 1)
- {
- if(IsPlayerInRangeOfPoint(playerid,5.0,380.7079,-190.5341,1000.6328)) // RESTORANT
- {
- robpossible = 0;
- SetTimer("timer1", 120000, false);
- SetTimer("timer2", 20000, false);
- SendClientMessage(playerid,COLOR_WHITE,"[SERVER] : {FF0000}Momentalno pljackas Restorant, policija je obavestena!");
- SendClientMessage(playerid,COLOR_WHITE,"[SERVER] : {FF0000}Sacekajte malo!");
- TogglePlayerControllable(playerid,0);
- }
- if(IsPlayerInRangeOfPoint(playerid,5.0,369.3565,-6.0164,1001.8516)) // CLUCKIN'BELL
- {
- robpossible = 0;
- SetTimer("timer1", 120000, false);
- SetTimer("timer2", 20000, false);
- SendClientMessage(playerid,COLOR_WHITE,"[SERVER] : {FF0000}Momentalno pljackas Cluckin'Bell, policija je obavestena!");
- SendClientMessage(playerid,COLOR_WHITE,"[SERVER] : {FF0000}Sacekajte malo!");
- TogglePlayerControllable(playerid,0);
- }
- else return SendClientMessage(playerid,-1,"[SERVER] : {00B7FF}Moras biti u nekoj trgovini!");
- }
- else return SendClientMessage(playerid,-1,"[SERVER] : {00B7FF}Trgovina se ne moze pljackati momentalno, pokusaj kasnije!");
- }
- else return SendClientMessage(playerid,-1,"[SERVER] : {00B7FF}Nisi civil!");
- return 1;
- }
- public timer1()
- {
- robpossible = 1;
- SendClientMessageToAll(COLOR_WHITE,"[SERVER] : {FF0000}Trgovina se moze opet pljackati!");
- }
- public timer2(playerid)
- {
- new msg[128];
- new money = random(10000);
- GivePlayerMoney(playerid,money);
- format(msg,sizeof(msg),"{FFFFFF}[SERVER] : {FF0000}Opljackali ste trgovinu i zaradili $%d!",money);
- SendClientMessage(playerid,COLOR_RED,msg);
- TogglePlayerControllable(playerid,1);
- SetPlayerWantedLevel(playerid,6);
- SetPlayerColor(playerid,COLOR_RED);
- }
- CMD:gear(playerid,params[])
- {
- if(gTeam[playerid] == TEAM_COPS)
- {
- if(!IsPlayerInRangeOfPoint(playerid,3.0,255.2108,74.0874,1003.6406)) return SendClientMessage(playerid,COLOR_WHITE,"[SERVER] : {00B7FF}Nisi kod Pickupa!");
- SetPlayerHealth(playerid,100);
- SetPlayerArmour(playerid,100);
- GivePlayerWeapon(playerid,22,100);
- GivePlayerWeapon(playerid,27,100);
- GivePlayerWeapon(playerid,29,350);
- GivePlayerWeapon(playerid,31,300);
- GivePlayerWeapon(playerid,3,1);
- SendClientMessage(playerid,COLOR_WHITE,"[SERVER] : {00B7FF}Uzeli ste PD Opremu!");
- }
- else SendClientMessage(playerid,COLOR_WHITE,"[SERVER] : {00B7FF}Nisi Policajac!");
- return 1;
- }
- CMD:pravila(playerid,params[])
- {
- SendClientMessage(playerid,COLOR_WHITE,"=====Jiky CnR Pravila=====");
- SendClientMessage(playerid,COLOR_WHITE,"1. {00B7FF}Postuj admina!");
- SendClientMessage(playerid,COLOR_WHITE,"2. {00B7FF}Postuj druge igrace!");
- SendClientMessage(playerid,COLOR_WHITE,"3. {00B7FF}Zabranjeno DManje/Random ubijanje!");
- SendClientMessage(playerid,COLOR_WHITE,"4. {00B7FF}Zabranjeno citovanje/Bugovi!");
- SendClientMessage(playerid,COLOR_WHITE,"5. {00B7FF}Policija nesme napadati nevine civile!");
- SendClientMessage(playerid,COLOR_WHITE,"7. {00B7FF}Bez reklamiranja/spama");
- SendClientMessage(playerid,COLOR_WHITE,"8. {00B7FF}Ne bjezite sa servera ukoliko ste je nadrljali :D");
- SendClientMessage(playerid,COLOR_WHITE,"9. {00B7FF}Vozi ljepo");
- SendClientMessage(playerid,COLOR_WHITE,"10. {00B7FF}Policija ne radi sa civilima");
- return 1;
- }
- CMD:forum(playerid,params[])
- {
- SendClientMessage(playerid,COLOR_WHITE,"[FORUM] : {00B7FF}www.uskoro.com");
- return 1;
- }
- CMD:ts3(playerid,params[])
- {
- SendClientMessage(playerid,COLOR_WHITE,"[TS3] : {00B7FF}ts3.uskoro.com");
- return 1;
- }
- //==============================================================================
- forward SendMSG();
- public SendMSG()
- {
- new randMSG = random(sizeof(RandomMSG));
- SendClientMessageToAll(-1, RandomMSG[randMSG]);
- }
- //==============================================================================
- CMD:kill(playerid,params)
- {
- SetPlayerHealth(playerid,0);
- return 1;
- }
- //==============================================================================MUTE CMDS
- CMD:mute(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return 0; // returns "SERVER: Unknown command." if the player is not an RCON admin
- new giveplayerid, reason[50], string[120], minutes, pname1[MAX_PLAYER_NAME], pname2[MAX_PLAYER_NAME]; // declares a few new variables
- 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
- if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFFFFFFFF, "Player not connected."); // returns this message if the receiver player is not connected
- GetPlayerName(playerid, pname1, sizeof(pname1)); // get the sender name
- GetPlayerName(giveplayerid, pname2, sizeof(pname2)); // get the receiver name
- 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
- SendClientMessageToAll(0xFFFFFFFF, string); // sends a global message
- new calc = minutes*60; // calculates the seconds
- Mute[giveplayerid] = calc; // sets the mute time to the calculated value
- 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
- return 1;
- }
- //==============================================================================MUTE CMDS
- CMD:unmute(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return 0;
- new giveplayerid, reason[50], string[120]; // variables
- if(sscanf(params, "us[50]", giveplayerid, reason)) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}Syntax: /unmute [playerid/name] [reason]"); // syntax check
- if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}Player not connected."); // player not connected
- new pname1[MAX_PLAYER_NAME], pname2[MAX_PLAYER_NAME]; // more variables
- GetPlayerName(playerid, pname1, sizeof(pname1)); // gets the senders name
- GetPlayerName(giveplayerid, pname2, sizeof(pname2)); // gets the receivers name
- format(string, sizeof(string), "%s (%d) was unmuted by %s (%d), reason: %s", pname2, giveplayerid, pname1, playerid, reason); // sets the string
- SendClientMessageToAll(0xFFFFFFFF, string); // sends everyone the message that was string'd
- Mute[giveplayerid] = 0; // sets the mute of the other player to 0
- 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
- return 1;
- }
- //==============================================================================MUTE CMDS
- CMD:mymute(playerid, params[])
- {
- 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
- new string[50]; // new variable
- SendClientMessage(playerid, 0xFFFFFFFF, "|__________ My Mute __________|"); // sends a base message
- format(string, sizeof(string), "%d seconds remain from your mute.", Mute[playerid]); // sets the string
- SendClientMessage(playerid, 0xFFFFFFFF, string); // sends the string'd message
- return 1;
- }
- //==============================================================================MUTE CMDS
- CMD:mutelist(playerid, params[])
- {
- new iname[MAX_PLAYER_NAME], string[120], count; // new variables
- for(new i = 0; i < MAX_PLAYERS; i++) // loops all the players
- {
- if(IsPlayerConnected(i)) // checks if the player is connected
- {
- if(Mute[i] >= 1) // checks if the looped player is muted at the moment
- {
- GetPlayerName(i, iname, sizeof(iname)); // if they are, this retrieves the name
- format(string, sizeof(string), "%s (%d) - %d seconds remaining", iname, i, Mute[i]); // sets the string
- SendClientMessage(playerid, 0xFFFFFFFF, string); // sends the message
- count++; // puts the count to a ++ value, you'll see why further down
- }
- }
- }
- 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
- 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
- if(count >= 2) // if there are more than 1 muted players online, the following will occur
- {
- format(string, sizeof(string), "There are %d amount of players who are online and muted.", count); // sets the string
- SendClientMessage(playerid, 0xFFFFFFFF, string); // sends the message
- }
- return 1;
- }
- //==============================================================================MUTE CMDS
- CMD:unmuteall(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "{FFFF00}Only admins can use this command."); // checks if the sender is an RCON logged in admin
- new count, string[120]; // new variables
- for(new i = 0; i < MAX_PLAYERS; i++) // loops all the players one-by-one
- {
- if(IsPlayerConnected(i)) // checks if the player is connected
- {
- if(Mute[i] >= 1) // if the looped player has a mute time more than 0
- {
- count++; // the count will go up
- Mute[i] = 0; // and the mute time will be set to 0
- }
- }
- }
- new uname[MAX_PLAYER_NAME]; // this is the name of the sender
- GetPlayerName(playerid, uname, sizeof(uname)); // this will get the playerid (sender)'s name
- 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
- SendClientMessageToAll(0xFFFFFFFF, string); // sends this global message
- return 1;
- }
- //==============================================================================MUTE CMDS
- CMD:mutecmds(playerid, params[])
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "/mute - Mute a player {FF0000}(ADMINS ONLY)");
- SendClientMessage(playerid, 0xFFFFFFFF, "/unmute - Unmute a player {FF0000}(ADMINS ONLY)");
- SendClientMessage(playerid, 0xFFFFFFFF, "/mymute - View your own mute time");
- SendClientMessage(playerid, 0xFFFFFFFF, "/mutelist - View a global list of all the online players who are muted");
- SendClientMessage(playerid, 0xFFFFFFFF, "/unmuteall - Unmute all the players on the server at once {FF0000}(ADMINS ONLY)");
- return 1;
- }
- //==============================================================================MUTE CMDS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement