Mute at request spawn
#1

Hey i wanna make that if you are requesting spawn you are muted and if you spawn you get unmuted pls help i dont know how

Like:

OnPlayerRequestSpawn(playerid)
Mute[playerid] == 1;



and if you try send text while request spawn then he needs to say Spawn first!
Reply
#2

Hey,

Add this:
pawn Код:
new Muted[MAX_PLAYERS];
At the top of your gamemode,
then add this:
pawn Код:
Muted[playerid] = 1;
On 'OnPlayerRequestSpawn',
then add:
pawn Код:
if(Muted[playerid] == 1)
    {
        return 0;
    }
On 'OnPlayerText'
Then add:
pawn Код:
Muted[playerid] = 0;
On 'OnPlayerSpawn'.

I hope it works, it was fast made though.
Reply
#3

pawn Код:
new pMuted[MAX_PLAYERS] = 0;

public OnPlayerRequestSpawn(playerid)
{
    pMuted[playerid] = 1;
    return true;
}

public OnPlayerSpawn(playerid)
{
    pMuted[playerid] = 0;
    return true;
}

public OnPlayerText(playerid,text[])
{
    if(pMuted[playerid] == 1) return 0;
    }
}
Reply
#4

Код:
new pMuted[MAX_PLAYERS] = 0;

public OnPlayerRequestSpawn(playerid)
{
    pMuted[playerid] = 1;
    return true;
}

public OnPlayerSpawn(playerid)
{
    pMuted[playerid] = 0;
    return true;
}

public OnPlayerText(playerid,text[])
{
    if(pMuted[playerid] == 1) return 0;
}
It's Works..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)