1. Hiya,

    I'm looking for the entity name for the chinook for use in OnEntitySpawned:

    Code:
    if (entity is BaseHelicopter) {        string serverEvent = "huey";} else if (entity is BradleyAPC) {        string serverEvent = "bradley";}
    Anyone know?

    Thanks in advance.
     
  2. You can check by partical name

    Ex:
    Code:
    if (entity.shirtname.Contains"ch.47") // AFK, code can be wrong
    {
    bla bla bla
    }
    ==============================
    Code:
    if (entity is BaseHelicopter) {        string serverEvent = "huey";} else if (entity is BradleyAPC) {        string serverEvent = "bradley";}
    Better way of your code

    Code:
    if (entity is BaseHelicopter)
    {
    //Magic
    return;
    }if (entity is BradleyAPC)
    {
    //Magic
    return;
    }if (entity is <chinook class?>)
    {
    //Magic
    return;
    }
    ==============================
    But i think switch on shortnames will be better?
     
    Last edited by a moderator: Jun 7, 2018
  3. Code:
    void OnEntitySpawned(BaseEntity entity)
    {
        if (entity is BaseHelicopterVehicle)
            Puts("Gets called once");
        if (entity is CH47Helicopter)
            Puts("Gets called once");
        if (entity.name.Contains("ch47.entity"))
            Puts("Gets called once");
        if (entity.name.Contains("ch47"))
            Puts("Gets called twice");
    }
     
  4. Thanks, I'll play about with what's here and see if I can get my code working :)
     
  5. I think that's how you check clothing skins. =)
     
  6. lol, i cant change it now :D