Command not working
#1

Hello,
I need help with a little command. When i type /muteall and the time I want the players too be muted it just sends the message and has no action... help!
Код:
CMD:muteall ( playerid,params[] )
{
	new time;
    if(PlayerInfo[playerid][LoggedIn] == 0) return SendClientMessage(playerid,-1,""RED"ERROR:"GREY" You must logg in!");
	if(PlayerInfo[playerid][Admin] < 4) return SendClientMessage( playerid, -1, ""RED"ERROR:"GREY" You are not authorized to use this command.");
	if(sscanf(params,"i",time)) return SendClientMessage(playerid,-1,"{F07F1D}USAGE:{BBFF00} /muteall <Time>");
	new ttime = time*60;
	for(new i; i<MAX_PLAYERS;i++)
	{
			PlayerInfo[i][Muted] == ttime;
			new str[128];
			format(str,sizeof(str),"Administrator %s(%d) has muted all players.", GetName(playerid),playerid);
			SendClientMessageToAll(-1,str);
			return 1;
	}
	return 1;
}
Reply
#2

return 1 stops loop after id 0

pawn Код:
CMD:muteall ( playerid,params[] )
{
    new time;
    if(PlayerInfo[playerid][LoggedIn] == 0) SendClientMessage(playerid,-1,""RED"ERROR:"GREY" You must logg in!");
    else if(PlayerInfo[playerid][Admin] < 4) SendClientMessage( playerid, -1, ""RED"ERROR:"GREY" You are not authorized to use this command.");
    else if(sscanf(params,"i",time)) SendClientMessage(playerid,-1,"{F07F1D}USAGE:{BBFF00} /muteall <Time>");
    else{
        time *= 60;
        for(new i=0; i<MAX_PLAYERS;i++)
            PlayerInfo[i][Muted] = time;

        new str[128];
        format(str,sizeof(str),"Administrator %s(%d) has muted all players.", GetName(playerid),playerid);
        SendClientMessageToAll(-1,str);
    }
    return 1;
}
Reply
#3

Thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)