Squirrel/Functions/Server/SetDrivebyEnabled

From VC-MP Wiki

Jump to: navigation, search

This functions toggles the drive-by sync.

Syntax

bool SetDrivebyEnabled( bool enabled )


Arguments

  • true - Enables Drive-by sync.
  • false - Disables Drive-by sync.

Example

If someone types '/c dbon' it will enable the Drive-by and Rockets in Hunter sync. If someone types '/c dboff' it will disable the Drive-by Rockets in Hunter sync.

function onPlayerCommand( player, cmd, text )
{
     if ( cmd == "dbon" )
     {
          SetDrivebyEnabled( true );
     }
}

or

function onPlayerCommand( player, cmd, text )
{
     if ( cmd == "dboff" )
     {
          SetDrivebyEnabled( false );
     }
}

Notes

The call onPlayerCommand was used in in this example. More info about it on its page.

Related Functions

squirrel scripting