AdminChat

Started by Finch Real, May 26, 2016, 04:55 AM

Previous topic - Next topic

Finch Real

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 );
}
}
My Snipet Showroom

http://pastebin.com/5KKuU5cg

Xmair

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.

Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD

Finch Real

My Snipet Showroom

http://pastebin.com/5KKuU5cg