Raised This Month: $ Target: $400
 0% 

client_PreThink for one client only


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 11-12-2006 , 12:26   Re: client_PreThink for one client only
Reply With Quote #10

Code:
#include <amxmodx> #include <fakemeta> new forward_PreThink new bool:g_prethink[32] public client_authorized(id) {         g_prethink[id] = false;         if ( /* check here: steamid, admin flags, etcetera */ ) {         g_prethink[id] = true;         forward_PreThink = register_forward(FM_PlayerPreThink, "FM_Prethink")     } } public FM_Prethink(id) {     if ( ! g_prethink[id] )         return         // your code here } public client_disconnect(id) {     if ( ! g_prethink[id] )         return         if ( none_left() )         unregister_forward(FM_PlayerPreThink, forward_PreThink, 1) } stock none_left() {         for ( new i = 0 ; i < 32 ; i++ ) {              if ( g_prethink[i] )             return 0     }         return 1 }

I win.

Last edited by [ --<-@ ] Black Rose; 11-12-2006 at 15:55.
[ --<-@ ] Black Rose is offline
 



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 06:54.


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