net.Send
From GMod Wiki
| Function | |
| Syntax |
net.Send( Player OR Table recipients ) Where is this used? |
| Description: | |
| Dispatches current net message. | |
| Returns: | nil |
| Part of Library: | net |
| Realm: |
|
| BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Net.Send]Net.Send [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
| Description | Sends a packet to a player. |
|---|---|
| Used on | |
| Code | net.Start("my message") net.WriteString("some text") net.Send(ply) |
| Output | N/A |
| Description | Sends a packet to all players. |
|---|---|
| Used on | |
| Code | net.Start("my message") net.WriteString("some text") net.Send(player.GetAll()) |
| Output | N/A |
Additional Notes
- Unlike umsg.Start/umsg.End, calling this without arguments doesn't sent the packet at all.
- Instead of calling this to send to all players, consider using net.Broadcast instead.