Jump to content
Autentificarea cu Google și Facebook nu mai este disponibilă. ×
  • 0

Question

4 answers to this question

Recommended Posts

Posted

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
Posted

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;

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.