Mute command.
#1

Код HTML:
CMD:mute(playerid,params[])
{
	if(PInfo[playerid][Level] >= 1) {
	new name[MAX_PLAYER_NAME],name2[MAX_PLAYER_NAME],string[128],id,reason[64],time;
	if(sscanf(params,"us[64]",id,reason)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /mute [playerid] [reason]");
    GetPlayerName(playerid,name, sizeof(name));
    GetPlayerName(id,name2, sizeof(name2));
    format(string, sizeof(string), "%s has been silenced by %s %s [Reason: %s]", name2, aLevel(playerid), name,reason);
    SendClientMessageToAll(COLOR_RED,string);
    PInfo[playerid][pMuted] = 1;
    }
        else //if he has not got the permissions
        {
            SendClientMessage(playerid, COLOR_RED, "You are not admin level 2."); //return this message
        }
    return 1;
}
Ok, so that code works /GREAT/, but at my onplayertext it lets my player use the chat even his muted?

Код HTML:
if(PInfo[playerid][pMuted] == 1) // your variable for logged players if(PInfo[playerid][Logged] == 1)
    {
        SendClientMessage(playerid,0x3FA63CFF," You are muted, not able to speak ICly.");
        return 0;
    }
Reply


Messages In This Thread
Mute command. - by HK - 10.02.2014, 01:07
Re: Mute command. - by HK - 10.02.2014, 01:31
Re: Mute command. - by DarkLored - 10.02.2014, 01:32
Re: Mute command. - by HK - 10.02.2014, 01:35
Re: Mute command. - by DarkLored - 10.02.2014, 01:37
Re: Mute command. - by HK - 10.02.2014, 01:39
Re: Mute command. - by DarkLored - 10.02.2014, 01:45
Re: Mute command. - by HK - 10.02.2014, 01:52
Re: Mute command. - by DarkLored - 10.02.2014, 02:01
Re: Mute command. - by HK - 10.02.2014, 02:07

Forum Jump:


Users browsing this thread: 1 Guest(s)