SA-MP Forums Archive
OnIncomingConnection function - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnIncomingConnection function (/showthread.php?tid=508483)



OnIncomingConnection function - audriuxxx - 22.04.2014

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?


Re: OnIncomingConnection function - Leroytjuh - 22.04.2014

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.


Re: OnIncomingConnection function - iFarbod - 22.04.2014

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;
}



Re: OnIncomingConnection function - audriuxxx - 22.04.2014

And what different between OnPlayerConnect?


Re : OnIncomingConnection function - Ramoboss - 22.04.2014

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


Re: OnIncomingConnection function - audriuxxx - 22.04.2014

I test you can't get name.