OnAddIVNetworkEvent: Difference between revisions
Jump to navigation
Jump to search
(Created page with "{{ScriptItem2 |name = OnAddIVNetworkEvent |side = shared |type = event |games = iv |desc = when a built-in event is sent in GTA IV |arg1 = Client client The client that sent the event |arg2 = Int type The type of event sent |arg3 = String string The name of the client |arg4 = Integer data1 The 1st data arg |arg4 = Integer data2 The 2nd data arg |cancel = true |notes = See the IV events page for a list of event types }}") |
No edit summary |
||
| (One intermediate revision by the same user not shown) | |||
| Line 6: | Line 6: | ||
|desc = when a built-in event is sent in GTA IV | |desc = when a built-in event is sent in GTA IV | ||
|arg1 = Client client The client that sent the event | |arg1 = Client client The client that sent the event | ||
|arg2 = | |arg2 = Type integer The type of event sent | ||
|arg3 = | |arg3 = Name string The name of the client | ||
|arg4 = | |arg4 = Data1 integer The 1st data arg | ||
| | |arg5 = Data2 integer The 2nd data arg | ||
|cancel = true | |cancel = true | ||
|notes = See [[Resources/GTAIV/Events|the IV events page]] for a list of event types | |notes = See [[Resources/GTAIV/Events|the IV events page]] for a list of event types, and [[SyncDamageOnGTAIV|this page for an example on how to sync player damage]] | ||
|ExampleSSJS = addEventHandler("OnAddIVNetworkEvent", (event, fromClient, type, name, data1, data2) => { | |||
triggerNetworkEvent("iv-event", null, fromClient, type, name, data1, data2); // Use null as second arg to send to everybody | |||
}); | |||
}} | }} | ||
Latest revision as of 22:31, 22 March 2026
Event Server and Client ![]()
Online and Offline Cancellable
Available since Server 1.0.0, Client 1.0.0
OnAddIVNetworkEvent(Event event, Client client, Type integer, Name string, Data1 integer, Data2 integer)
The OnAddIVNetworkEvent event is invoked when when a built-in event is sent in GTA IV.
Parameters
| 1) | Event | event | The event object for this event. |
| 2) | Client | client | The client that sent the event. |
| 3) | Type | integer | The type of event sent. |
| 4) | Name | string | The name of the client. |
| 5) | Data1 | integer | The 1st data arg. |
| 6) | Data2 | integer | The 2nd data arg. |
Attributes
| cancellable | This event can be cancelled, by using event.preventDefault(). |
Notes
- See the IV events page for a list of event types, and this page for an example on how to sync player damage.
Examples
There aren't any examples for this event.
Compatibility
There isn't any compatibility information for this event.
Related
Server Related
OnAddIVNetworkEvent
OnRequestSession
Client Related
OnAddIVNetworkEvent