OnIncomingConnection
From SA-MP Wiki
(Difference between revisions)
Revision as of 22:14, 21 April 2014 MP2 (Talk | contribs) ← Previous diff |
Revision as of 05:51, 22 April 2014 TopFuel (Talk | contribs) (lang link) Next diff → |
||
Line 33: | Line 33: | ||
[[es:OnIncomingConnection]] | [[es:OnIncomingConnection]] | ||
[[fr:OnIncomingConnection]] | [[fr:OnIncomingConnection]] | ||
+ | [[pt:OnIncomingConnection]] |
Revision as of 05:51, 22 April 2014
Description:
This callback is called when an IP address attempts a connection to the server. TO block incoming connections, use BlockIpAddress.
(playerid, ip_address[], port)
playerid | The ID of the player attempting to connect |
ip_address[] | The IP address of the player attempting to connect |
port | The port of the attempted connection |
Return Values:
This function does not return any specific values.
Example Usage:
public OnIncomingConnection(playerid, ip_address[], port) { printf("Incoming connection for player ID %i [IP/port: %s:%i]", playerid, ip_address, port); return 1; }
Related Callbacks
The following callbacks might be useful as well, as they are related to this callback in one way or another.
- OnPlayerConnect: Called when a player connects to the server.
- OnPlayerDisconnect: Called when a player leaves the server.
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- BlockIpAddress: Block an IP address from connecting to the server for a set amount of time.
- UnBlockIpAddress: Unblock an IP that was previously blocked.