Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Finch Real on May 26, 2016, 04:55 AM

Title: AdminChat
Post by: Finch Real on May 26, 2016, 04:55 AM
Well This is Command For AdminChat but when i type /adminchat it show index plr does not exist

else if ( cmd == "adminchat" )
{
  if ( GetLevel( player ) < 3 ) MessagePlayer("You are not allowed to use that command", player );
    else
    {
        for ( local i = 0; i <= GetMaxPlayers(); i++ )
            local plr = FindPlayer(i)
   if ( ( plr ) && ( GetLevel( plr ) >= 3  ) ) MessagePlayer("[Admin Chat] " + plr.Name + ": " + text + ".", player );
}
}
Title: Re: AdminChat
Post by: Xmair on May 26, 2016, 05:33 AM
You didn't put a bracket after the loop.
Fixed code:
else if ( cmd == "adminchat" )
{
  if ( GetLevel( player ) < 3 ) MessagePlayer("You are not allowed to use that command", player );
    else
    {
        for ( local i = 0; i <= GetMaxPlayers(); i++ )
{
            local plr = FindPlayer(i)
   if ( ( plr ) && ( GetLevel( plr ) >= 3  ) ) MessagePlayer("[Admin Chat] " + plr.Name + ": " + text + ".", plr );
   }
}
}
Still untested.
Title: Re: AdminChat
Post by: Finch Real on May 26, 2016, 06:08 AM
Thanks Xmair :D