Rust NPC turret use

Discussion in 'Plugin Requests' started by HISHNIK__, Dec 16, 2016.

  1. whether it is possible to make the NPC authorization in turrets
     
  2. HumnNPC Plugin - I assign the kits to the NPC as normal but they do not seem to be able to use the guns or wear the clothing.

    Is it possible to authorize NPC on turrets?
     
  3. Not really automatic, but possible, as they did get an ID and a Name by the NPC plugin config.

    But much simplier would be to exlude them only from being targeted by turrets.
     
  4. Thank you very much for your reply. How would one exclude them from turrets?
     
  5. Basix example. Returning anything else then "null" does stop aiming, as long the object is in range of the turret.
    Code:
            object OnTurretTarget(AutoTurret turret, BaseCombatEntity entity)
            {
                if (entity != null && entity is BasePlayer && (entity as BasePlayer).IsAdmin()) return true;
                return null;
            }
     
  6. What needs to be changed, to exclude NPCs from being targeted? I tried looking in HumanNPC for anything but I just get this

    Code:
    "Error while compiling: TurretConfig.cs(592,27): error CS0103: The name `npc' does not exist in the current context
    Error while compiling: TurretConfig.cs(592,27): error CS0103: The name `Humannpcs' does not exist in the current context
    Error while compiling: TurretConfig.cs(592,27): error CS0103: The name `npc' does not exist in the current context
    Error while compiling: TurretConfig.cs(592,27): error CS0103: The name `HumanPlayer' does not exist in the current"
     
  7. if you do the above checks and determine that entity is a BasePlayer,
    then you can do
    Code:
    if (entity.userID.IsSteamId())
    That'll differentiate between humanNPC and real human players.