OnIncomingConnection function
#1

In 0.3z-R2-2 version there i see new function: OnIncomingConnection.

But now some questions:

Now i need to renew my includes?

And how to use this function?
Reply
#2

Updating your includes is something I do frequently. I suggest you doing that aswell - although I'm not quite sure what OnIncomingConnection means. It seems like it's a new callback.
Reply
#3

pawn Код:
public OnIncomingConnection(playerid, ip_address[], port)
{
    new playername[MAX_PLAYER_NAME], str[128];
    GetPlayerName(playerid, playername, sizeof playername);
    format(str, sizeof str, "Incoming connection for player %s (%i) [IP/port: %s:%i]", playername, playerid, ip_address, port);
    SendClientMessageToAll(str, 0xAAFFCCAA);
    printf("Incoming connection for player %s (%i) [IP/port: %s:%i]", playername, playerid, ip_address, port);
    return 1;
}
Reply
#4

And what different between OnPlayerConnect?
Reply
#5

the diffйrence is that OnIncomingConnection is called before a player connect and can join the server,
in short : you can get the name of the player that will connect befor he connect
Reply
#6

I test you can't get name.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)