Quote:
Originally Posted by abdul-rehman
Time for suggestions
1- Code:
public client_putinserver(id) { g_bConnected[id] = true }
Since you have knowledge in bits you should try to use the following method for all booleans in ur plugin bcoz it will require less memory usage, which means ur plugin will be more effecient
Code:
// Using bits will be far more effecient new g_bitConnectedPlayers // This variable will allow us to use one var only to store all connected player's indexs' #define MarkUserConnected(%0) ( g_bitConnectedPlayers |= ( 1 << ( %0 & 31 ) ) ) #define ClearUserConnected(%0) ( g_bitConnectedPlayers &= ~( 1 << ( %0 & 31 ) ) ) #define IsUserConnected(%0) ( g_bitConnectedPlayers & ( 1 << ( %0 & 31 ) ) ) // Put this in thos forwards public client_connect(id) MarkUserConnected(id) public client_disconnect(id) ClearUserConnected(id) some_function( id ) { // To check if user is connected if ( IsUserConnected(id) ) { // ... } }
2- u should try to use static variables especially in FM_CmdStart
3-
Code:
public fw_PlayerPreThink(id) { if (!g_bAlive[id] || !g_bIsRage[id] || !g_bInRage[id]) &nb sp;return FMRES_IGNORED set_user_maxspeed(id, get_pcvar_float(cvar_maxspeed))
return FMRES_IGNORED }
It would be better to cache the speed cvar bcoz prethink is called very often
4-
Code:
replace_all(szMsg, 190, "!w", "^0")
I think you should remove this coz u know what it is supposed to do and it is in da wrong place 
|
1. I did have that idea. Kinda messy though hehe.
2. Will update tomorrow. Very late now.
3. I always forgotten that. Darn!
4. Still doesn't get into my brain.