Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: KAKAN on Aug 01, 2015, 05:28 PM

Title: Mute cmd problem
Post by: KAKAN on Aug 01, 2015, 05:28 PM
Everything is fine, but the thing "plr.IsMuted = (true or false)" isn't find
At that line (in mute and unmute) it shows "Member variable not found"
MUTE:-
else if ( cmd == "!mute" )
{
if ( level < 3 ) EchoNotice( user,"Error - Your level is not high enough to use that command." );
        else if ( !text ) EchoNotice( user,"Error - Syntax: " + cmd + " <Nick/ID> <Reason> ");
    else
{
            local plr = GetPlayer( GetTok( text, " ", 1 ) );
          if (!plr) EchoNotice( user, " Error - Unknown player" );
    else
    {
local msg = GetTok( text, " ", 2, NumTok( text, " " ) );
    if ( !msg ) EchoNotice( user, "Error - Invalid format." );
                else
{
local plr = GetPlayer( GetTok( text, " ", 1 ) ); msg = GetTok( text, " ", 2, NumTok( text, " " ) );
                    EchoMessage( "Muted Player:[ "  + plr.Name +  " ]. Reason:[ " + msg + " ]" );
Message( "Admin " + user + " has muted [ "  + plr.Name +  " ]. Reason: " + msg + "." );
                    plr.IsMuted = true;
                }
}
}
}


UNMUTE:-
else if ( cmd == "!unmute" )
    {
    if ( level < 3 ) EchoNotice( user,"Error - Your level is not high enough to use that command." );
    else if ( !text ) EchoNotice( user," Error - Syntax: !unmute <Nick/ID>" );
    else
        {
            local plr = GetPlayer( GetTok( text, " ", 1 ) );
          if (!plr) EchoNotice( user, " Error - Unknown Player" );
else
{
plr.IsMuted = false;
                EchoMessage( " Admin " + user + " has un-muted Player " + plr.Name + "." );
    Message( "Admin " + user + " has un-muted " + plr.Name + "." );
          }
}
}
Title: Re: Mute cmd problem
Post by: Thijn on Aug 01, 2015, 05:58 PM
.IsMuted isn't in 0.4
Save whether the player is muted somewhere else, then return 0; on the onPlayerChat event.
Title: Re: Mute cmd problem
Post by: MacTavish on Aug 01, 2015, 06:50 PM
class PlayerStats
{
IsMute = false;
}

status[plr.ID].IsMute = true; // use true/false toggle instead plr.IsMute
Title: Re: Mute cmd problem
Post by: KAKAN on Aug 02, 2015, 03:36 AM
I already did it with the help of Mashreq, he told me to make array as .ismuted doesn't exist in 0.4, SO, its now solved