SA-MP Forums Archive
Help with Mute command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help with Mute command (/showthread.php?tid=549410)



Help with Mute command - Stoyanov - 06.12.2014

If i mute player for 5 min, when he left the server and come back again after theese 5 minutes it's bugged. He is still muted. How to fix it?

Код:
CMD:mute(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= 2)
	{
	    new id, time, reason[128];
	    if(sscanf(params, "dds[128]", id, time, reason)) return SendClientMessage(playerid, WHITE, "USAGE:/mute (ID) (minutes) (reason)");
	    if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, RED, "Player not found!");
	    if(PlayerInfo[id][pMuted] == 1) return 1;
	    if(PlayerInfo[id][pAdmin] >= 5)
        {
            SendClientMessage(playerid, RED, "You cannot mute 5 level admin!");
		}
	    else
	    {
	    new adname[MAX_PLAYER_NAME], tt[MAX_PLAYER_NAME], str[250];
	    GetPlayerName(playerid, adname, sizeof(adname));
	    GetPlayerName(id, tt, sizeof(tt));
	    mtimer = SetTimerEx("UnMute",time*1000*60,0,"i",id);
	    PlayerInfo[id][pMuted] = 1;
	    format(str, sizeof(str), "ADMIN: %s is muted by admin %s за %d minutes. Reason: %s", tt, adname, time, reason);
	    SendClientMessageToAll(RED, str);
	    return 1;
	    }
 	}
	else return SendClientMessage(playerid, RED, "You are not an admin!");
	return 1;
}



Re: Help with Mute command - Ryz - 06.12.2014

add PlayerInfo[playerid][pMuted] = 0; under OnPlayerDisconnect


Re: Help with Mute command - Stoyanov - 06.12.2014

Then if player relog will be unmuted.


Re: Help with Mute command - Stoyanov - 06.12.2014

any ideas?


Re: Help with Mute command - Ryz - 06.12.2014

Quote:
Originally Posted by Stoyanov
Посмотреть сообщение
any ideas?
do you tested it? it will 100% work -__-


Re: Help with Mute command - Stoyanov - 06.12.2014

Ok i'll test it.


Re: Help with Mute command - Stoyanov - 06.12.2014

When i mute player for 10 minutes. If he leave the server before the time expire and join in the server after theese 10 minutes will not unmute him automatically.

Did u understand me now?


Re: Help with Mute command - Stoyanov - 07.12.2014

Quote:
Originally Posted by Ryz
Посмотреть сообщение
do you tested it? it will 100% work -__-
Doesn't work.


Re: Help with Mute command - Stoyanov - 08.12.2014

BUMP


Re: Help with Mute command - MD5 - 08.12.2014

You've done this a bit wrong.

Check this out: https://sampforum.blast.hk/showthread.php?tid=466064