How can I make people in class selection muted and unmuted when spawning?
#1

If anyone knows how please tell me..
I am using Lethal Admin script if it matters.
Reply
#2

I don`t know what do you mean.
Do you mean like this?

OnPlayerRequestClass or where u wan`t it
PlayerInfo[playerid[pMute] == 1;
On spawn
PlayerInfo[playerid[pMute] == 0;
Reply
#3

Quote:
Originally Posted by TzAkS.
Посмотреть сообщение
I don`t know what do you mean.
Do you mean like this?

OnPlayerRequestClass or where u wan`t it
PlayerInfo[playerid[pMute] == 1;
On spawn
PlayerInfo[playerid[pMute] == 0;
Will this keep the players muted while choosing skin, and unmuting them when they have spawned?
Reply
#4

Yes,but you will have a bug.
If you give to a player /mute he will have pMute == 1 and if he relogs will got pMute == 0.
Make a function exactly like pMute but with other name and use it just here.
Reply
#5

you mean something similiar to this

Код:
new bool:PlayerMuted[MAX_PLAYERS];

public OnPlayerRequestClass(playerid, classid)
{
    if(IsPlayerConnected(playerid))
        PlayerMuted[playerid] = true;
	return 1;
}

public OnPlayerSpawn(playerid)
{
    if(IsPlayerConnected(playerid))
        PlayerMuted[playerid] = false;
	return 1;
}

public OnPlayerText(playerid, text[])
{
    if(IsPlayerConnected(playerid))
        if(PlayerMuted[playerid] == true)
            return SendClientMessage(playerid, -1, "You must spawn before you chat");
	return 1;
}
I dont know if it works.. didnt test it
Reply
#6

Put the code of muting in OnPlayerRequestClass and put unmuting code in OnPlayerRequestSpawn.
Simple
Reply
#7

Quote:
Originally Posted by $$inSane
Посмотреть сообщение
Put the code of muting in OnPlayerRequestClass and put unmuting code in OnPlayerRequestSpawn.
Simple
Yes is very simple,but how i said in second post,if the player logout with Mute == 1 then when he relog`s will have mute == 0 ..so it`s bug.
The solution is to create a new function for mute.
Reply
#8

Quote:
Originally Posted by DR3AD
Посмотреть сообщение
you mean something similiar to this

Код:
new bool:PlayerMuted[MAX_PLAYERS];

public OnPlayerRequestClass(playerid, classid)
{
    if(IsPlayerConnected(playerid))
        PlayerMuted[playerid] = true;
	return 1;
}

public OnPlayerSpawn(playerid)
{
    if(IsPlayerConnected(playerid))
        PlayerMuted[playerid] = false;
	return 1;
}

public OnPlayerText(playerid, text[])
{
    if(IsPlayerConnected(playerid))
        if(PlayerMuted[playerid] == true)
            return SendClientMessage(playerid, -1, "You must spawn before you chat");
	return 1;
}
I dont know if it works.. didnt test it
It says that I have to spawn to talk but it still lets me talk.
Reply
#9

return 0 (zero) under OnPlayerText to stop there text reaching the chat.

pawn Код:
public OnPlayerText(playerid, text[])
{
    if(PlayerMuted[playerid] == true)
    {
        SendClientMessage(playerid, -1, "You must spawn before you chat");
        // Stop there text reaching the chat
        return 0;
    }
    // Allow them to chat when not muted
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)