Jump to content

'None-invocable member 'Entity.Heading' cannot be used like a method.'


KDenv01

Recommended Posts

I'm trying to get into code with c# but already I have hit a bump. I managed to get the whole way through the code then when coming to test it there was a lot of errors and warnings. Most I managed to fix but most I couldn't find the rest of them so I decided to start again doing it the same way I had done last time but only testing the code as I go along instead of at the finish. 

 

This time it gave me an error saying 'None-invocable member 'Entity.Heading' cannot be used like a method.' with a warning saying 'There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "RagePluginHookSDK, Version=0.0.0.0, Culture=neutral, processorArchitecture=AMD64", "AMD64". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.'

 

Game.LogTrivial("Spawning Cop and cop vehicle");
                Ped RogueOfficer = new Ped("s_f_y_cop01", Game.LocalPlayer.Character.GetOffsetPositionFront(10f),Game.LocalPlayer.Character.Heading(180f));
                Vehicle RogueOfficerCar = new Vehicle("FBI", Game.LocalPlayer.Character.GetOffsetPositionFront(15f),Game.LocalPlayer.Character.Heading(180f));
                Game.LogTrivial("Spawn successful");
            });
        }
    }
} 

         

KDenv01

Link to comment
Share on other sites

Game.LocalPlayer.Character.Heading(180f));

Cannot be used as a method, as the error states.

It can only Get or Set a value.

 

 

You could calculate the heading yourself  or use

public override void Face(
	Vector3 position
)

Where posistion is Game.LocalPlayer.Character

Edited by epicmrjuan

Thank you

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...