ClickWithRaycast: Difference between revisions
No edit summary |
m (category) |
||
| Line 2: | Line 2: | ||
{{CSharpContainer| | {{CSharpContainer| | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="csharp"> | ||
public delegate void OnClickWithRaycastDelegate(int x, int y, bool up, bool right, float relativeX, float relativeY, Vector3 worldPos, int entityHandle); | public delegate void OnClickWithRaycastDelegate(int x, int y, bool up, bool right, float relativeX, float relativeY, Vector3 worldPos, int entityHandle); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 18: | Line 18: | ||
The example below does nothing on invoke of event | The example below does nothing on invoke of event | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="csharp"> | ||
Events.OnClickWithRaycast += OnClickWithRaycast; | Events.OnClickWithRaycast += OnClickWithRaycast; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="csharp"> | ||
public void OnClickWithRaycast(int x, int y, bool up, bool right, float relativeX, float relativeY, RAGE.Vector3 worldPos, int entityHandle) | public void OnClickWithRaycast(int x, int y, bool up, bool right, float relativeX, float relativeY, RAGE.Vector3 worldPos, int entityHandle) | ||
{ | { | ||
| Line 28: | Line 28: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
}} | }} | ||
[[Category:Client-side Event]] | |||
Latest revision as of 14:03, 24 May 2019
Client-Side Event
C# Syntax
public delegate void OnClickWithRaycastDelegate(int x, int y, bool up, bool right, float relativeX, float relativeY, Vector3 worldPos, int entityHandle);
Parameters
- x - expects System.Int32
- y - expects System.Int32
- up - expects System.Boolean
- right - expects System.Boolean
- relativeX - expects System.Single
- relativeY - expects System.Single
- worldPos - the position in the world, expects RAGE.Vector3
- entityHandle - the handle of the entity, expects System.Int32
Example
The example below does nothing on invoke of event
Events.OnClickWithRaycast += OnClickWithRaycast;
public void OnClickWithRaycast(int x, int y, bool up, bool right, float relativeX, float relativeY, RAGE.Vector3 worldPos, int entityHandle)
{
//add something beast here
}