AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   client_putinserver and client_authorised order (https://forums.alliedmods.net/showthread.php?t=89738)

hnorgist 04-10-2009 00:49

client_putinserver and client_authorised order
 
I am afraid to use client_putinserver, because read in some old topics that it can be sometimes called before client_authorised... others say there is no such problem...
so, what situation about it now..

danielkza 04-10-2009 02:01

Re: client_putinserver and client_authorised order
 
I remind reading the calling order is not guaranteed by the engine. A simple way is to hook both functions, and check if a flag was already set on one of them, like this:

Code:

new g_iConnectCheck[33]
public client_putinserver(id)
{
    if(!(g_iConnectCheck[id] ^= 1))
        client_ingame(id)
}

public client_authorized(id)
{
    if(!(g_iConnectCheck[id] ^= 1)) 
        client_ingame(id)
}

public client_disconnect(id)
{
    g_iConnectCheck[id] = 0
}



All times are GMT -4. The time now is 02:22.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.