WantsToViewVehicle how to use?

Discussion in 'Plugins' started by Script, Jun 1, 2017.

  1. Script

    Script Registered

    Joined:
    Sep 6, 2014
    Messages:
    26
    Likes Received:
    0
    I have a problem with WantsToViewVehicle function.

    My code changes only the type of camera, but not the player.
    This is my code:
    i call the function with in UpdateScoring:
    Code:
    CameraControlInfoV01 a;
                    a.mID = vinfo.mID;
                    a.mCameraType = 4;
                    int uu = WantsToViewVehicle(a);
    Code:
    unsigned char ExampleInternalsPlugin::WantsToViewVehicle(CameraControlInfoV01& camControl)
    {
        
        if (camControl.mID == -1) {
            return(false);
        }
        else {
    
           /* long id = camControl.mID;
            long cam = camControl.mCameraType;
            camControl.mID = id;
            camControl.mCameraType = 0;*/
            return (true);
        }
        
        
    }
     
  2. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    7,407
    Likes Received:
    3,096
    I'm slightly confused, why do you have code calling WantsToViewVehicle() ? The game will call that function, and it's up to you to decide if you want to do something, set the incoming .mID and mCameraType, and return true (or return false if you don't want to change anything).
     

Share This Page