Jump to content
  • 0

Bug Mute


ToX1c

Question

4 answers to this question

Recommended Posts

Vezi cmd asta :

if(strcmp(cmd, "/mute", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /mute [playerid/PartOfName] [time(minutes)]");
				return 1;
			}
			new playa;
			new time;
			playa = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			time = strval(tmp);
			if (PlayerInfo[playerid][pAdmin] >= 1)
			{
			    if(IsPlayerConnected(playa))
			    {
			        if(playa != INVALID_PLAYER_ID)
			        {
					    GetPlayerName(playa, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						if(PlayerInfo[playa][pMuted] == 0)
						{
							PlayerInfo[playa][pMuted] = 1;
							PlayerInfo[playa][pMuteTime] = time*60;
							printf("AdmCmd: %s silenced %s for %d minutes",sendername,  giveplayer ,time);
							format(string, sizeof(string), "AdmCmd: %s was silenced by %s for %d minute(s)",giveplayer ,sendername,time);
							ABroadCast(COLOR_LIGHTRED,string,1);
							format(string, sizeof(string), "* You can watch how many minutes you have left by typing /mutetime");
							SendClientMessage(giveplayerid,COLOR_GREY, string);
						}
						else
						{
							PlayerInfo[playa][pMuted] = 0;
							PlayerInfo[playa][pMuteTime] = 0;
							printf("AdmCmd: %s unsilenced %s",sendername,  giveplayer);
							format(string, sizeof(string), "AdmCmd: %s was unsilenced by %s",giveplayer ,sendername);
							ABroadCast(COLOR_LIGHTRED,string,1);
						}
					}
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "   you are not authorized to use that command!");
			}
		}
		return 1;
	}

efe25e4426ff4ce1266705e.png
Link to comment
Share on other sites

Asa cum setezi un scor intr-un fisier, seteaza si ca are Mute, setezi cu Mute=1.

Iar cand se conecteaza dudb verifica daca are 1 adica true cea ce inseamna ca inc are mute sau daca are 0, false, adica nu are.

Si daca are Mute=1 in fisier sa setezi

PlayerInfo[playa][pMuted] = 1;

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.