Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Shovon^ on Oct 14, 2016, 09:23 AM

Title: SetServer Password Using CMD
Post by: Shovon^ on Oct 14, 2016, 09:23 AM
???does anyone know how to set server password using cmd??
Title: Re: SetServer Password Using CMD
Post by: Anik on Oct 14, 2016, 11:15 AM
Its too easy!
function onPlayerCommand( player, cmd, text )
{
     if ( cmd == "setpass" )
     {
          if ( text ) SetPassword( text );
          else MessagePlayer("How can you set password without texts ??",player);
     }
}
Title: Re: SetServer Password Using CMD
Post by: vito on Oct 14, 2016, 12:58 PM
Quote from: Anik on Oct 14, 2016, 11:15 AMHow can you set password without texts ?
SetPassword("");
Title: Re: SetServer Password Using CMD
Post by: Shovon^ on Oct 14, 2016, 03:17 PM
How can I remove the password later?? If I use the cmd it will ask for text ... ?
Title: Re: SetServer Password Using CMD
Post by: Mötley on Oct 14, 2016, 04:17 PM
IDK.. See what happens when you do this

function onPlayerCommand( player, cmd, text )
{
  if ( cmd == "setpass" )
  {
          if (!text)
          {
             Message("Open Lobby");
             SetPassword("");
             return true;
          }

          if (text)
          {
             Message("Locked Lobby");
             SetPassword(text);
          }
   }
}
Title: Re: SetServer Password Using CMD
Post by: Kewun on Oct 15, 2016, 05:47 AM
if you dont want password, try using /setpass none
Title: Re: SetServer Password Using CMD
Post by: KAKAN on Oct 15, 2016, 06:28 AM
Requirements: http://forum.vc-mp.org/?topic=738.msg4724#msg4724
Code: http://pastebin.com/Fk05vCag