How to make /listen
#3

here you go
PHP код:
enum PlayerInfo
{
     
bool:Listening
}
new 
pInfo[MAX_PLAYERS][PlayerInfo];

CMD:listen(playeridparams[])
{
    if(
pInfo[playerid][Listening] == false)
    {
        
pInfo[playerid][Listening] = true;
        
SendClientMessage(playerid, -1"You have started listening to commands.");
    }
    else
    {
        
pInfo[playerid][Listening] = false;
        
SendClientMessage(playerid, -1"You have stopped listening to commands.");
    }
    return 
1;
}

public 
OnPlayerCommandReceived(playeridcmdtext[])
{
    if (!
IsPlayerConnected2(playerid)) return 0;
    new 
cstring[100],playerids[MAX_PLAYER_NAME];
    
GetPlayerName(playeridplayeridssizeof(playerids));
    
format(cstringsizeof(cstring), "[cmd] [%s]: %s"playeridscmdtext);
    foreach(new 
iPlayer)
    {
        if(
adminvariable >= && Listen(i) == 1)
        {
            if(
adminvariable <= adminvariable)
            {
                  if(
!= playeridSendClientMessage(i, -1cstring);
            }
        }
    }
return 
1;
}
forward Listen(playerid);
public 
Listen(playerid)
{
    return 
pInfo[playerid][Listening];

Reply


Messages In This Thread
How to make /listen - by MIDO007 - 06.09.2018, 06:12
Re: How to make /listen - by MIDO007 - 06.09.2018, 06:29
Re: How to make /listen - by CaptainBoi - 06.09.2018, 06:29
Re: How to make /listen - by MIDO007 - 06.09.2018, 06:41
Re: How to make /listen - by CaptainBoi - 06.09.2018, 12:08
Re: How to make /listen - by v1k1nG - 06.09.2018, 13:08

Forum Jump:


Users browsing this thread: 1 Guest(s)