View Single Post
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 02-13-2010 , 15:56   Re: BOMB Ghosting Fix
Reply With Quote #10

Code:
    g_iMaxPlayers = clamp(get_maxplayers(), 1, 32);
Why force 1-32 when 1-32 is always the range anyway?

------
Code:
    register_message(get_user_msgid("ScoreAttrib"), "Message_ScoreAttrib");         g_iMsgScoreAttrib = get_user_msgid("ScoreAttrib");
No need to make 2 calls.

Code:
    g_iMsgScoreAttrib = get_user_msgid("ScoreAttrib");     register_message(g_iMsgScoreAttrib, "Message_ScoreAttrib");     // or     register_message((g_iMsgScoreAttrib=get_user_msgid("ScoreAttrib")), "Message_ScoreAttrib");

------

http://www.amxmodx.org/funcwiki.php?go=func&id=298
Quote:
You should NEVER send a message or use a command which sends a message while in a register_message hook.
It may be there so you don't have infinite loops in your plugin (register a message and send the same message).

Or it may be there because the server might crash because you are sending another message before your hooked message has finished.
However, I think register_message() is pre-hook, so the start of the message hasn't been sent.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline