buycar sharecar getcar sellcar
elseif ($3 == buycar) {
    if ($FBS.lin($1, $2) == $null) vcmp.msg $1 $2 You must register to be able to use this command.
    elseif (!$4) vcmp.msg $1 $2 Error - Correct Syntax: ! $+ $3 <Car ID>
    elseif ($4 !isnum) vcmp.msg $1 $2 Error, Invalid Car ID
    elseif ($4 > $calc(%FBS.vehicles - 1)) vcmp.msg $1 $2 Error, Invalid Car ID
    elseif (. isin $4) || (, isin $4) || (- isin $4) vcmp.msg $1 $2 Error, No negative or decimal car id's
    elseif ($FBS.CarPrice($4) > $FBS.actcash($1, $2)) vcmp.msg $1 $2 Error, You do not have enough cash to buy this vehicle
    elseif ($FBS.CarOwner($4) != Sunshine Auto's)  vcmp.msg $1 $2 Error, This vehicle is already owned by $FBS.CarOwner($4)
    elseif ($vcmp.vehiclename($1, $vcmp.vehicle($1, $2)) == Unknown) vcmp.msg $1 $2 Error, This is an unknown vehiclw
    elseif (Sunshine !isin $FBS.Buildings($1, $2)) vcmp.msg $1 $2 Error, You must be located at Sunshine Auto's
    elseif ($vcmp.vehicle($1, $2) != $4) vcmp.msg $1 $2 Error, You must be in the car you want to buy
    elseif ($FBS.Mycars($1, $2) >= 2) vcmp.msg $1 $2 Error, You have reached your vehicle limit
    else {
      vcmp.say $1 ** Selling $vcmp.vehiclename($1, $vcmp.vehicle($1, $2)) (ID: $vcmp.vehicle($1, $2) $+ ) to $vcmp.name($1, $2)
      vcmp.msg $1 $2 Cost:[ $ $+ $FBS.Carprice($4) $chr(93) New Balance:[ $+ $fbs.actcash($1, $2) $chr(93)
      FBS.DecCash $1 $2 $FBS.Carprice($4)
      !remini -n FBS.carowners.ini OWNERS $vcmp.vehicle($1, $2)
      !writeini -n FBS.carowners.ini OWNERS $vcmp.vehicle($1, $2) $vcmp.name($1, $2)
      FBS.IncMyCars $1 $2 1
      !writeini -n FBS.mycarsinfo.ini INFO $vcmp.vehicle($1, $2) $vcmp.name($1, $2)
    }
  }
  elseif ($3 == sharecar) {
    if ($FBS.lin($1, $2) == $null) vcmp.msg $1 $2 You must register to be able to use this command.
    elseif (!$4) vcmp.msg $1 $2 Error - Correct Syntax: ! $+ $3 <Nick/ ID>
    elseif ($vcmp.name($1, $4) == Unknown) vcmp.msg $1 $2 Error, Invalid Nick or ID
    elseif ($FBS.CarOwner($vcmp.vehicle($1, $2)) != $vcmp.name($1, $2)) vcmp.msg $1 $2 Error, You do not own this vehicle
    elseif ($vcmp.vehiclename($1, $vcmp.vehicle($1, $2)) == Unknown) vcmp.msg $1 $2 Error, This is an unknown vehicle
    elseif ($FBS.CarShares($vcmp.vehicle($1, $2)) != None) vcmp.msg $1 $2 Error, This car has already been shared
    else {
      vcmp.msg $1 $2 You are now sharing your $vcmp.vehiclename($1, $vcmp.vehicle($1, $2)) (ID: $vcmp.vehicle($1, $2) $+ ) with $vcmp.name($1, $FBS.ID($4)) 
      vcmp.msg $1 $FBS.ID($4) $vcmp.name($1, $2) is now sharing there $vcmp.vehiclename($1, $vcmp.vehicle($1, $2)) (ID: $vcmp.vehicle($1, $2) $+ ) with you
      !writeini -n FBS.sharecarsinfo.ini SHARES $vcmp.vehicle($1, $2) $vcmp.name($1, $FBS.ID($4))
    }
  }
  elseif ($3 == delsharecar) {
    if ($FBS.lin($1, $2) == $null) vcmp.msg $1 $2 You must register to be able to use this command.
    elseif ($FBS.CarOwner($vcmp.vehicle($1, $2)) != $vcmp.name($1, $2))  vcmp.msg $1 $2 Error, You do not own this vehicle
    elseif ($vcmp.vehiclename($1, $vcmp.vehicle($1, $2)) == Unknown) vcmp.msg $1 $2 Error, This is an unknown vehicle
    elseif ($FBS.CarShares($vcmp.vehicle($1, $2)) == None) vcmp.msg $1 $2 Error, This vehicle has not been shared
    else {
      vcmp.msg $1 $2 You are no longer sharing your $vcmp.vehiclename($1, $vcmp.vehicle($1, $2)) (ID: $vcmp.vehicle($1, $2) $+ ) with $FBS.Carshares($vcmp.vehicle($1, $2)) 
      !remini -n FBS.sharecarsinfo.ini SHARES $vcmp.vehicle($1, $2)
    }
  }
  elseif ($3 == sellcar) {
    if ($FBS.lin($1, $2) == $null) vcmp.msg $1 $2 You must register to be able to use this command.
    elseif (!$4) vcmp.msg $1 $2 Error - Correct Syntax: ! $+ $3 <Car ID>
    elseif ($4 !isnum) vcmp.msg $1 $2 Error, Invalid Car ID
    elseif ($4 > $calc(%FBS.vehicles - 1)) vcmp.msg $1 $2 Error, Invalid Car ID
    elseif (. isin $4) || (, isin $4) || (- isin $4) vcmp.msg $1 $2 Error, No negative or decimal car id's
    elseif (Sunshine !isin $FBS.Buildings($1, $2)) vcmp.msg $1 $2 Error, You must be located at Sunshine Auto's
    elseif ($vcmp.vehicle($1, $2) != $4) vcmp.msg $1 $2 Error, You must be in the car you want to sell
    elseif ($FBS.carowner($vcmp.vehicle($1, $2)) != $vcmp.name($1, $2)) vcmp.msg $1 $2 Error, You do not own this vehicle 
    elseif ($vcmp.vehiclename($1, $vcmp.vehicle($1, $2)) == Unknown) vcmp.msg $1 $2 Error, This is an unknown vehiclw  
    elseif ($FBS.Carshares($vcmp.vehicle($1, $2)) != None) vcmp.msg $1 $2 You must remove the share of this car first
    else {
      vcmp.say $1 ** $vcmp.name($1, $2) has sold there $vcmp.vehiclename($1, $vcmp.vehicle($1, $2)) (ID: $vcmp.vehicle($1, $2) $+ )
      vcmp.msg $1 $2 Cash Return:[ $ $+ $calc($FBS.Carprice($4) /2) $chr(93) New Balance:[ $ $+ $fbs.actcash($1, $2) $chr(93)
      FBS.IncCash $1 $2 $calc($FBS.Carprice($4) /2)
      !remini -n FBS.carowners.ini OWNERS $vcmp.vehicle($1, $2)
      !writeini -n FBS.carowners.ini OWNERS $vcmp.vehicle($1, $2) Sunshine Auto's
      FBS.DecMyCars $1 $2 1
      !remini -n FBS.mycarsinfo.ini INFO $vcmp.vehicle($1, $2)
    }
  }
  elseif ($3 == getcar) {
    if ($FBS.lin($1, $2) == $null) vcmp.msg $1 $2 You must register to be able to use this command.
    elseif (!$4) vcmp.msg $1 $2 Error - Correct Syntax: ! $+ $3 <Car ID>
    elseif ($4 !isnum) vcmp.msg $1 $2 Error, Invalid Car ID
    elseif (. isin $4) || (, isin $4) || (- isin $4) vcmp.msg $1 $2 Error, No negative or decimal car id's
    elseif ($4 > $calc(%FBS.vehicles - 1)) vcmp.msg $1 $2 Error, Invalid Car ID
    elseif ($FBS.rwarstatus($2) == 1) vcmp.msg $1 $2 You cannot get a vehicle, your are in a minigame
    elseif ($vcmp.vehicle($1, $2) != 0) vcmp.msg $1 $2 Error, You must be on foot to use this command
    elseif ($FBS.carowner($4) == $vcmp.name($1, $2)) { 
      vcmp.setvehicleloc $1 $4 $calc($vcmp.location($1, $2).x + 2) $vcmp.location($1, $2).y $calc($vcmp.location($1, $2).z - 1.12)
      vcmp.msg $1 $2 Getting Vehicle:[ $hget(VehicleNames,$4) $chr(93)
    }    
    elseif ($FBS.carshares($4) == $vcmp.name($1, $2)) { 
      vcmp.setvehicleloc $1 $4 $calc($vcmp.location($1, $2).x + 2) $vcmp.location($1, $2).y $calc($vcmp.location($1, $2).z - 1.12)
      vcmp.msg $1 $2 Getting Vehicle:[ $hget(VehicleNames,$4) $chr(93)
    }
    else {
      vcmp.msg $1 $2 You do not own or share this vehicle
    }
  }