Raised This Month: $ Target: $400
 0% 

client_putinserver and client_authorised order


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hnorgist
Junior Member
Join Date: Feb 2009
Location: Russia, Vladivostok
Old 04-10-2009 , 00:49   client_putinserver and client_authorised order
Reply With Quote #1

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..
hnorgist is offline
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 04-10-2009 , 02:01   Re: client_putinserver and client_authorised order
Reply With Quote #2

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

Community / No support through PM
danielkza is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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