ClickWithRaycast: Difference between revisions
(Created page with "{{ClientsideCsEvent}} {{CSharpContainer| to do }}") |
m (category) |
||
| (One intermediate revision by one other user not shown) | |||
| Line 2: | Line 2: | ||
{{CSharpContainer| | {{CSharpContainer| | ||
<syntaxhighlight lang="csharp"> | |||
public delegate void OnClickWithRaycastDelegate(int x, int y, bool up, bool right, float relativeX, float relativeY, Vector3 worldPos, int entityHandle); | |||
</syntaxhighlight> | |||
{{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 | |||
<syntaxhighlight lang="csharp"> | |||
Events.OnClickWithRaycast += OnClickWithRaycast; | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="csharp"> | |||
public void OnClickWithRaycast(int x, int y, bool up, bool right, float relativeX, float relativeY, RAGE.Vector3 worldPos, int entityHandle) | |||
{ | |||
//add something beast here | |||
} | |||
</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
}