/mute Command
#1

Hey, I need to add so I can set a timer to my mute command. Could I have some help please?

Code:
if(strcmp("/mute", cmd, true) == 0)
        {
                new tmp[256], tmp2[256], cmdid;

                tmp = strtok(cmdtext, idx);
                tmp2 = strtok(cmdtext, idx);
                if(PlayerInfo[playerid][AdminLevel] < 1) return 0;
                if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_RED, "/mute [id] [reason]");
                                  if(IsPlayerConnected(strval(tmp)) == 0) return SendClientMessage(playerid, COLOR_RED, "That player is not connected");
                if(!strlen(tmp2)) return SendClientMessage(playerid, COLOR_RED, "/mute [id] [reason]");
                cmdid = strval(tmp);
      if(PlayerInfo[cmdid][AdminLevel] > PlayerInfo[playerid][AdminLevel]) return SendClientMessage(playerid,COLOR_ORED,"You cant use this command against a higher level admin!");
                new pname[MAX_PLAYER_NAME];
                GetPlayerName(playerid, pname, sizeof(pname));

                new oname[MAX_PLAYER_NAME];
                GetPlayerName(cmdid, oname, sizeof(oname));

                new string[256];

                if(cmdid >= 0 && cmdid <= 9)
                {
                        format(string, sizeof(string), "~ %s has been muted for '%s' ", oname, cmdtext[7]);
                }
                else if(cmdid >= 10 && cmdid <= 99)
                {
                        format(string, sizeof(string), "~ %s has been muted for '%s' ", oname, cmdtext[8]);

			   }
                else if(cmdid >= 100 && cmdid <= 150)
                {
                        format(string, sizeof(string), "~ %s has been muted for '%s' ", oname, cmdtext[9]);
			    }

                SendClientMessageToAll(COLOR_YELLOW, string);
				muted[cmdid] = 1;
                printf(string);
                return 1;
        }
Reply


Messages In This Thread
/mute Command - by MikeMike1997 - 06.12.2012, 19:33
Re: /mute Command - by LarzI - 06.12.2012, 19:39
Re: /mute Command - by MikeMike1997 - 06.12.2012, 19:47
Re: /mute Command - by Konstantinos - 06.12.2012, 19:49
Re: /mute Command - by MikeMike1997 - 06.12.2012, 20:54
Re: /mute Command - by LarzI - 06.12.2012, 21:27
Re: /mute Command - by MikeMike1997 - 07.12.2012, 14:46

Forum Jump:


Users browsing this thread: 1 Guest(s)