Help with Mute command
#1

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;
}
Reply
#2

add PlayerInfo[playerid][pMuted] = 0; under OnPlayerDisconnect
Reply
#3

Then if player relog will be unmuted.
Reply
#4

any ideas?
Reply
#5

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

Ok i'll test it.
Reply
#7

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?
Reply
#8

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

BUMP
Reply
#10

You've done this a bit wrong.

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


Forum Jump:


Users browsing this thread: 6 Guest(s)