Scripting/Squirrel/Functions/Players/DrivebyAbility
From VC-MP Wiki
NOTE: This function has been added in VC:MP 0.3z r2. It will not work in previous versions.
This Player class property will toggle player's driveby ability. You can either get or set the value.
Syntax
bool Player.DrivebyAbility
Player.DrivebyAbility = bool bAbility
Arguments
- bAbility - Toggle the driveby ability to on (true) or off (false)
Example
This command will return if the player is able to Drive-By.
function onPlayerCommand( player, cmd, text ) { if ( cmd == "driveby" ) { if ( player.DrivebyAbility == false ) MessagePlayer( "You do not have the ability to drive-by.", player ); else if ( player.DrivebyAbility == true ) MessagePlayer( "You have ability to drive-by.", player ); } }
Notes
The function MessagePlayer and call onPlayerCommand were used in in this example. More info about them in corresponding pages.
Example 2
This command gives the player ability to drive-by when typing '/c drivebyon'.
function onPlayerCommand( player, cmd, text ) { if ( cmd == "drivebyon" ) { player.DrivebyAbility = true; MessagePlayer( "Driveby turned on", player ); } }
Notes
The function MessagePlayer and call onPlayerCommand were used in in this example. More info about them in corresponding pages.
Example 3
This command removes the player's ability to drive-by when typing '/c drivebyoff'.
function onPlayerCommand( player, cmd, text ) { if ( cmd == "drivebyoff" ) { player.DrivebyAbility = false; MessagePlayer( "Driveby turned off", player ); } }
Notes
The function MessagePlayer and call onPlayerCommand were used in in this example. More info about them in corresponding pages.
Related Functions
- FindPlayer
- Player.Angle
- Player.Armour
- Player.Cash
- Player.Class
- Player.DrivebyAbility
- Player.GetSpectating
- Player.GetSyncBlockedTo
- Player.Health
- Player.ID
- Player.IP
- Player.IsAdmin
- Player.IsFrozen
- Player.IsIgnoredBy
- Player.IsMuted
- Player.IsPassenger
- Player.IsSpawned
- Player.IsSyncBlocked
- Player.IsWeaponSyncBlocked
- Player.Keys
- Player.Name
- Player.Ping
- Player.Pos
- Player.RemoveLocalMarker
- Player.RemoveMarker
- Player.ResetGameSettings
- Player.Score
- Player.Seat
- Player.SetAnim
- Player.SetDrunkLevel
- Player.SetIgnoredBy
- Player.SetInterior
- Player.SetLocalMarker
- Player.SetMarker
- Player.SetSyncBlockedTo
- Player.WantedLevel
- Player.SetWeapon
- Player.Skin
- Player.SpawnPos
- Player.Team
- Player.Vehicle
- Player.Weapon
- Player.ShootInAir
- Player.StuntMode
- Player.Spikes
