/vmute bugged
#1

When ever I /vmute someone, it says I mute them but it doesn't mute them from VIP chat.

Код:
command(vmute, playerid, params[])
{
	new id, string[128];
	if(sscanf(params, "u", id))
	{
	    if(Player[playerid][AdminLevel] >= 1)
	    {
			SendClientMessage(playerid, WHITE, "SYNTAX: /vmute [playerid]");
			SendClientMessage(playerid, GREY, "This can be used to reverse the mute effect (effectively unmute).");
		}
	}
	else
	{
	    if(Player[playerid][AdminLevel] >= 1)
	    {
		    if(IsPlayerConnectedEx(id))
	    	{
	        	if(Player[id][vMuted] == 0)
	        	{
	        		format(string, sizeof(string), "You have muted %s from VIP chat.", GetName(id));
	    			Player[id][vMuted] = 1;
	    			SendClientMessage(playerid, WHITE, string);
	    		}
	    		else
	    		{
	        		format(string, sizeof(string), "You have unmuted %s from VIP chat.", GetName(id));
	    			Player[id][vMuted] = 0;
	    			SendClientMessage(playerid, WHITE, string);
	    		}
	    	}
    		else
	    	{
	    		SendClientMessage(playerid, WHITE, "That player is not connected or isn't logged in.");
	    	}
		}
	}
	return 1;
}
Reply
#2

Please post the code for the VIP chat (I'm guessing it's a command?)
Reply
#3

Код:
command(vip, playerid, params[])
{
	new message[128], string[128];
	if(sscanf(params, "z", message))
	{
		SendClientMessage(playerid, WHITE, "SYNTAX: /(v)ip [message]");
	}
	else
	{
	    if(VipEnabled == 1)
	    {
	        if(Player[playerid][CanUseVip] == 1 && Player[playerid][Authenticated] >= 1)
	        {
	            if(Player[playerid][vMuted] >= 1)
	            {
	                SendClientMessage(playerid, WHITE, "You have been muted from this channel by an admin.");
 	}
	else
	{
	    if(Player[playerid][VipRank] >= 1)
	    {
	        if(strlen(message) < 1)
	        {
	            SendClientMessage(playerid, WHITE, "SYNTAX: /(v)ip [message]");
	        }
	        else
	        {
	            format(string, sizeof(string), "[V] {D1C221}%s(%d): {FFFFFF}%s", GetName(playerid), Player[playerid][VipRank], message);

				for(new i = 0; i < MAX_PLAYERS; i++)
		        {
		            if(IsPlayerConnectedEx(i) && Player[i][VipRank] >= 1 && Player[i][ToggedVIP] == 0)
		            {
		                SendClientMessage(i, VIP_CHAT, string);
		            }
		        }
	        }
	    }
	}
	return 1;
}

command(v, playerid, params[])
{
	new message[128], string[128];
	if(sscanf(params, "z", message))
	{
		SendClientMessage(playerid, WHITE, "SYNTAX: /(v)ip [message]");
	}
	else
	{
	    if(Player[playerid][VipRank] >= 1)
	    {
	        if(strlen(message) < 1)
	        {
	            SendClientMessage(playerid, WHITE, "SYNTAX: /(v)ip [message]");
	        }
	        else
	        {
	            format(string, sizeof(string), "[V] {D1C221}%s(%d): {FFFFFF}%s", GetName(playerid), Player[playerid][VipRank], message);

				for(new i = 0; i < MAX_PLAYERS; i++)
		        {
		            if(IsPlayerConnectedEx(i) && Player[i][VipRank] >= 1 && Player[i][ToggedVIP] == 0)
		            {
		                SendClientMessage(i, VIP_CHAT, string);
		            }
		        }
	        }
	    }
	}
	return 1;
}
Reply
#4

Try this

pawn Код:
command(vip, playerid, params[])
{
    new message[128], string[128];
    if(sscanf(params, "z", message))
    {
        SendClientMessage(playerid, WHITE, "SYNTAX: /(v)ip [message]");
    }
    else
    {
        if(VipEnabled == 1)
        {
            if(Player[playerid][CanUseVip] == 1 && Player[playerid][Authenticated] >= 1)
            {
                if(Player[playerid][vMuted] == 1)
                {
                    SendClientMessage(playerid, WHITE, "You have been muted from this channel by an admin.");
                    return 1;
                }
            }
        }
    }
    else
    {
        if(Player[playerid][VipRank] >= 1)
        {
            if(strlen(message) < 1)
            {
                SendClientMessage(playerid, WHITE, "SYNTAX: /(v)ip [message]");
            }
            else
            {
                format(string, sizeof(string), "[V] {D1C221}%s(%d): {FFFFFF}%s", GetName(playerid), Player[playerid][VipRank], message);

                for(new i = 0; i < MAX_PLAYERS; i++)
                {
                    if(IsPlayerConnectedEx(i) && Player[i][VipRank] >= 1 && Player[i][ToggedVIP] == 0)
                    {
                        SendClientMessage(i, VIP_CHAT, string);
                    }
                }
            }
        }
    }
Reply
#5

Код:
error 029: invalid expression, assumed zero
Here is the line
[phpcode]else[/phpcode]

warning 209: function "cmd_vip" should return a value
Reply
#6

pawn Код:
command(vip, playerid, params[])
{
    new message[128], string[128];
    if(sscanf(params, "z", message))
    {
        SendClientMessage(playerid, WHITE, "SYNTAX: /(v)ip [message]");
    }
    else
    {
        if(VipEnabled == 1)
        {
            if(Player[playerid][CanUseVip] == 1 && Player[playerid][Authenticated] >= 1)
            {
                if(Player[playerid][vMuted] == 1)
                {
                    SendClientMessage(playerid, WHITE, "You have been muted from this channel by an admin.");
                    return 1;
                }
            }
        }
    }
    else
    {
        if(Player[playerid][VipRank] >= 1)
        {
            if(strlen(message) < 1)
            {
                SendClientMessage(playerid, WHITE, "SYNTAX: /(v)ip [message]");
            }
            else
            {
                format(string, sizeof(string), "[V] {D1C221}%s(%d): {FFFFFF}%s", GetName(playerid), Player[playerid][VipRank], message);

                for(new i = 0; i < MAX_PLAYERS; i++)
                {
                    if(IsPlayerConnectedEx(i) && Player[i][VipRank] >= 1 && Player[i][ToggedVIP] == 0)
                    {
                        SendClientMessage(i, VIP_CHAT, string);
                    }
                }
            }
        }
            return 1;
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)