/mute command
#10

That problem is fixed.

This is my new code:
PHP код:
// /mute[dcmd]
dcmd_mute(playeridparams[])
{
    new 
pIDtimereason[128];
    if(
adminlevel==0) return SendClientMessage(playeridCOLOR_WHITE"Server: Unrecognized command, type /commands to see the commands available for you.");
    if(
adminlevel<2) return SendClientMessage(playeridCOLOR_ADMINBLUE"ERROR: This command is unavailable for your admin rank.");
    if(
sscanf(params"uds"pIDtimereason)) return SendClientMessage(playeridCOLOR_ADMINBLUE"Correct usage: /mute [name/id] [seconds] [reason]");
    if(!
IsPlayerConnected(pID)) return SendClientMessage(playeridCOLOR_ADMINBLUE"ERROR: This player is not connected.");
    if(
playerid==pID) return SendClientMessage(playeridCOLOR_ADMINBLUE"ERROR: You cannot mute yourself.");
    new 
pIDadminlevel;
    
INI_ParseFile(UserPath(pID), "LoadUser_%s", .bExtra true, .extra pID);
    
pIDadminlevelPlayerInfo[pID][pAdmin];
    if(
pIDadminlevel>0)
    {
        if(
adminlevel==10)
        {
            
muted[pID] = 1;
            new 
amalmuteclient[128], amalmuteserver[128];
            
format(amalmuteclientsizeof(amalmuteclient), "You have been muted by the Senior Admin AmalM for %d seconds (Reason: %s)."timereason);
            
SendClientMessage(pIDCOLOR_BRIGHTREDamalmuteclient);
            new 
pName[128];
            
GetPlayerName(pIDpNamesizeof(pName));
            
format(amalmuteserversizeof(amalmuteserver), "Admin-mute: %s(%d) has been muted by the Senior Admin AmalM for %d seconds (Reason: %s)."pNamepIDtimereason);
            
SendClientMessageToAll(COLOR_BRIGHTREDamalmuteserver);
            
SetTimerEx("amalmute"time*1000false"is"pIDpName);
        }
        else
        {
            
muted[pID] = 1;
            new 
muteclient[128], muteserver[128];
            
format(muteclientsizeof(muteclient), "You have been muted by an admin for %d seconds (Reason: %s)."timereason);
            
SendClientMessage(pIDCOLOR_BRIGHTREDmuteclient);
            new 
pName[128];
            
GetPlayerName(pIDpNamesizeof(pName));
            
format(muteserversizeof(muteserver), "Admin-mute: %s(%d) has been muted for %d seconds (Reason: %s)."pNamepIDtimereason);
               
SendClientMessageToAll(COLOR_BRIGHTREDmuteserver);
            
SetTimerEx("mute"time*1000false"i"pIDpName);
        }
    }
    return 
1;
}
forward amalmute(pIDpName);
public 
amalmute(pIDpName)
{
    
muted[pID] = 0;
    
SendClientMessage(pIDCOLOR_BRIGHTRED"You have been auto-unmuted.");
    new 
unmuted[128];
    
format(unmutedsizeof(unmuted), "Auto-unmute: %s(%d) has been auto-unmuted.");
    
SendClientMessageToAll(COLOR_BRIGHTREDunmuted);
    return 
1;
}
forward mute(pIDpName);
public 
mute(pIDpName)
{
    
muted[pID] = 0;
    
SendClientMessage(pIDCOLOR_BRIGHTRED"You have been auto-unmuted.");
    new 
unmuted[128];
    
format(unmutedsizeof(unmuted), "Auto-unmute: %s(%d) has been auto-unmuted.");
    
SendClientMessageToAll(COLOR_BRIGHTREDunmuted);
    return 
1;

The problem is when I type '/mute 0 500 bye', it says me 'Correct usage: /mute [name/id] [seconds] [reason]'

Someone please help me.
Reply


Messages In This Thread
/mute command - by ATGOggy - 09.11.2014, 07:54
Re: /mute command - by dominik523 - 09.11.2014, 08:18
Re: /mute command - by ATGOggy - 09.11.2014, 08:21
Re: /mute command - by dominik523 - 09.11.2014, 08:23
Re: /mute command - by ATGOggy - 09.11.2014, 08:28
Re: /mute command - by Quickie - 09.11.2014, 08:34
Re: /mute command - by ATGOggy - 09.11.2014, 08:38
Re: /mute command - by Quickie - 09.11.2014, 08:42
Re: /mute command - by ATGOggy - 09.11.2014, 08:44
Re: /mute command - by ATGOggy - 12.11.2014, 13:08

Forum Jump:


Users browsing this thread: 1 Guest(s)