OnIncomingConnection

From SA-MP Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 19:45, 23 April 2014
Ikkentim (Talk | contribs)
(This is a callback(NoReturn>NoReturnCallback))
← Previous diff
Revision as of 12:40, 27 April 2014
Ikkentim (Talk | contribs)
(typo)
Next diff →
Line 3: Line 3:
{{AddedIn|0.3z|R2-2|callback}} {{AddedIn|0.3z|R2-2|callback}}
-{{Description|This callback is called when an IP address attempts a connection to the server. TO block incoming connections, use [[BlockIpAddress]].}}+{{Description|This callback is called when an IP address attempts a connection to the server. To block incoming connections, use [[BlockIpAddress]].}}
{{Parameters|playerid, ip_address[], port}} {{Parameters|playerid, ip_address[], port}}

Revision as of 12:40, 27 April 2014



This callback was added in SA-MP 0.3z R2-2 and will not work in earlier versions!


Description:

This callback is called when an IP address attempts a connection to the server. To block incoming connections, use BlockIpAddress.


Parameters:
(playerid, ip_address[], port)
playeridThe ID of the player attempting to connect
ip_address[]The IP address of the player attempting to connect
portThe port of the attempted connection


Return Values:

This callback does not handle returns.


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.


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.
In other languages