/mute and /unmute
#1

with sscanf+zcmd plz.
Reply
#2

better move this to script request thread.
Reply
#3

pawn Код:
new mute[MAX_PLAYERS];
command(mute, playerid, params[])
{
    new ID;
    if(sscanf(params, "is", ID, reason)) SendClientMessage(playerid, BLANCO, "USAGE: /mute [id]");
    else if(IsPlayerConnected(ID) == 0) SendClientMessage(playerid, ROJO, "Player is not connected");
    else
    {
        if(mute[ID]==0)
        {
            mute[ID]=1;
            SendClientMessage(ID, 0xFF0000AA, "You have been muted.");
        }
        else SendClientMessage(playerid, 0xFF0000AA, "ERROR: Player already muted.");
    }
    return 1;
}
pawn Код:
command(unmute, playerid, params[])
{
    new ID;
    if(sscanf(params, "is", ID, reason)) SendClientMessage(playerid, BLANCO, "USAGE: /mute [id]");
    else if(IsPlayerConnected(ID) == 0) SendClientMessage(playerid, ROJO, "Player is not connected");
    else
    {
        if(mute[ID]==1)
        {
            SendClientMessage(ID, 0xFF0000AA, "You have been unmuted.");
            mute[ID]=0;
        }
        else SendClientMessage(playerid, 0xFF0000AA, "ERROR: Player isn't muted.");      
    }
    return 1;
}
pawn Код:
public OnPlayerText(playerid, text[])
{
    if(mute[playerid]==1)
    {
        SendClientMessage(playerid, 0xC0C0C0FF, "You are muted and cannot talk.");
        return 0;
    }
    return 1;
}
Reply
#4

C:\Users\intel\Desktop\New Folder\Roleplay Base Script\gamemodes\lfgr.pwn(1375) : error 017: undefined symbol "reason"
C:\Users\intel\Desktop\New Folder\Roleplay Base Script\gamemodes\lfgr.pwn(1375) : error 017: undefined symbol "BLANCO"
C:\Users\intel\Desktop\New Folder\Roleplay Base Script\gamemodes\lfgr.pwn(1376) : error 017: undefined symbol "ROJO"
C:\Users\intel\Desktop\New Folder\Roleplay Base Script\gamemodes\lfgr.pwn(1391) : error 017: undefined symbol "reason"
C:\Users\intel\Desktop\New Folder\Roleplay Base Script\gamemodes\lfgr.pwn(1391) : error 017: undefined symbol "BLANCO"
C:\Users\intel\Desktop\New Folder\Roleplay Base Script\gamemodes\lfgr.pwn(1392) : error 017: undefined symbol "ROJO"
Reply
#5

Код:
CMD:mute(playerid,params[])
{
                if(IsPlayerAdmin(playerid))
                {
					new Msg[128], Name[24], OtherPlayer;
					if (sscanf(params, "u", OtherPlayer)) return SCM(playerid, CRVENA, "usage: /mute [playerid");
					GetPlayerName(OtherPlayer, Name, sizeof(Name));
					SetPVarInt(OtherPlayer,"Muted",1);
					format(Msg, 128, "player %s is muted.", Name);
					SCMTA(-1, Msg);
				}
				else SCM(playerid, -1, "you arent admin !");
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)