SA-MP Forums Archive
Mute OnPlayerRequestClass And Unmute OnPlayerSpawn - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Mute OnPlayerRequestClass And Unmute OnPlayerSpawn (/showthread.php?tid=276303)



Mute OnPlayerRequestClass And Unmute OnPlayerSpawn - lyrics - 13.08.2011

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


Re: Mute OnPlayerRequestClass And Unmute OnPlayerSpawn - emokidx - 13.08.2011

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..


Re: Mute OnPlayerRequestClass And Unmute OnPlayerSpawn - lyrics - 13.08.2011

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!