Mute OnPlayerRequestClass And Unmute OnPlayerSpawn
#1

Hi i want my players mute when they are OnPlayerRequestClass
And UnMute when they Spawn
But not only that i also want they will only mute when they gonna choose skin
Not When They Die Example:They Press F4 Then They Are Mute Again
Not Like That

Please Help me
Reply
#2

add this
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
SetPVarInt(playerid, "Muted", 1);
return 1;
}
public OnPlayerSpawn(playerid)
{
SetPVarInt(playerid, "Muted", 0);
return 1;
}
and this
pawn Код:
public OnPlayerText(playerid, text[])
{
if(GetPVarInt(playerid, "Muted") == 1)
    {
        SendClientMessage(playerid, red, "You are muted, you cannot talk.");
        return 0;
    }
    else if(GetPVarInt(playerid, "Muted") == 0)
    {
        new
            szText[128],
            szPlayerName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, szPlayerName, sizeof(szPlayerName));

        format(szText, sizeof(szText), "%s: {FFFFFF}%s", szPlayerName, text);
        SendClientMessageToAll(GetPlayerColor(playerid), szText);
        return 0;
    }
return 1;
}
write here if this doesnt work..
Reply
#3

Quote:
Originally Posted by emokidx111
Посмотреть сообщение
add this
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
SetPVarInt(playerid, "Muted", 1);
return 1;
}
public OnPlayerSpawn(playerid)
{
SetPVarInt(playerid, "Muted", 0);
return 1;
}
and this
pawn Код:
public OnPlayerText(playerid, text[])
{
if(GetPVarInt(playerid, "Muted") == 1)
    {
        SendClientMessage(playerid, red, "You are muted, you cannot talk.");
        return 0;
    }
    else if(GetPVarInt(playerid, "Muted") == 0)
    {
        new
            szText[128],
            szPlayerName[MAX_PLAYER_NAME];
        GetPlayerName(playerid, szPlayerName, sizeof(szPlayerName));

        format(szText, sizeof(szText), "%s: {FFFFFF}%s", szPlayerName, text);
        SendClientMessageToAll(GetPlayerColor(playerid), szText);
        return 0;
    }
return 1;
}
write here if this doesnt work..
Thanks it work!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)