Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Banaqs on Dec 27, 2014, 07:40 PM

Title: /admins command
Post by: Banaqs on Dec 27, 2014, 07:40 PM
How to change /admin command to like a this

Admins online:
Player1 (Level 10)
Player2 (Level 3)

from

Admins online: Player1 (Level 10), Player2 (Level 3)

base on code from Warchief 2.0

else if ( ( cmd == "admin" ) || ( cmd == "admins" ) )
{
local plr, b;
for( local i = 0; i <= GetMaxPlayers(); i++ )
{
    plr = FindPlayer( i );
if ( ( plr ) && ( status[ plr.ID ].Level >= 5 ) )
    {
if ( b ) b = b + ", " + plr.Name + " (Level: " + status[ plr.ID ].Level + ")"
else b = plr.Name + " (Level: " + status[ plr.ID ].Level + ")"
    }
}
if ( b ) rMessage( "** Admins Online: [ " + b + " ]" );
else rMessage( "** No Admins Online." );
}
Title: Re: Help!
Post by: EK.IceFlake on Dec 28, 2014, 05:00 AM
Help! doesn't tell very much about what you are asking help for.
else if ( ( cmd == "admin" ) || ( cmd == "admins" ) )
 {
  rMessage("** Admins Online:");
  local plr, b;
  b=0;
  for( local i = 0; i <= GetMaxPlayers(); i++ )
  {
     plr = FindPlayer( i );
  if ( ( plr ) && ( status[ plr.ID ].Level >= 5 ) )
     {
     b=b+1;
  rMessage("plr.Name + " (Level: " + status[ plr.ID ].Level + ")");
     }
  }
  if(!b) rMessage( "** None." );
 }
Hope this helps.
If doesnt work change
  if(!b) rMessage( "** None." );
to
  if(b){}else rMessage( "** None." );
Title: Re: Help!
Post by: . on Dec 28, 2014, 05:06 AM
Quote from: NE.CrystalBlue on Dec 28, 2014, 05:00 AMHelp! doesn't tell very much about what you are asking help for.

Off: I've been telling them that for months now. Not to mention that other people wont find the thread when they encounter the same issue. And then they'll have to ask again with a title... well... as sh!tty as the one before it. It's all about manners and respect to the community and they lack it both.
Title: Re: /admins command
Post by: Banaqs on Dec 28, 2014, 11:15 PM
you create a small bug

rMessage("plr.Name + " (Level: " + status[ plr.ID ].Level + ")");
to

rMessage(plr.Name + " (Level: " + status[ plr.ID ].Level + ")");