NetworkEvents: Difference between revisions

Jump to navigation Jump to search
no edit summary
(Created page with "{{DISPLAYTITLE:Network Events}} == What are Network Events? == Custom scripted events between server and client. They allow a server to tell a client something and vice verse. Useful for providing extra sync, calling functions, or simply sending data between the server and clients. == How do I use them? == Network events are universal, regardless of which side is sending and receiving (server or client). On the "sender" side, use triggerNetworkEvent|triggerNetworkEve...")
 
No edit summary
Line 5: Line 5:


== How do I use them? ==
== How do I use them? ==
Network events are universal, regardless of which side is sending and receiving (server or client). On the "sender" side, use [[triggerNetworkEvent|triggerNetworkEvent]], and on the receiver side use a [[addNetworkHandler|network event handler]] to run code when receiving it.
Network events are universal, regardless of which side is sending and receiving (server or client). On the "sender" side, use [[triggerNetworkEvent|triggerNetworkEvent]], and on the receiver side use a [[addNetworkHandler|network event handler]] to run code when receiving it. The only difference is when receiving a network event on the server, a ''client'' object will be the first arg in the handler function.


== What are some examples? ==
== What are some examples? ==
* [[ScriptingExamples/PlayerSetPositionNativeMP|Set Own Player's Position (GTA IV, Native MP Mode)]]
* [[ScriptingExamples/PlayerSetPositionNativeMP|Set Own Player's Position (GTA IV, Native MP Mode)]]
2,756

edits

Navigation menu