To do something to the player during the connection to the server you can use the command getconnstate.
I put the example here from the documentation and a script you can use:
Documentation:
Code:
getconnstate ( void )
{
Gets state of player's connection.
Example:
Code:
local.connection_state = $player[1] getconnstate
or
local.connection_state = $player[1] getconnstate( )
Result:
Code:
Returns integer value:
0 = CS_FREE - given player slot is free
1 = CS_ZOMBIE - given player slot is in zombie state (his data is still kept after he disconnected or lost connection)
2 = CS_CONNECTED - player has connected to server, but he's not yet in the game
3 = CS_PRIMED - player has passed through authorization checks and finished downloading any missing files
4 = CS_ACTIVE - player is in game and can start playing
}
Script
while(1)
{
wait 0.02
for(local.i = 1;local.i <= $player.size;local.i++)
{
local.player = $player[local.i]
if(local.player == NULL)
end
local.connection_state = local.player getconnstate
if(local.connection_state == 2)
{
//do something
}
}
}