Im new to scripting for amxx but not totaly new to programming/scripting.
I want to try to make a plugin that gags the player so he or she canīt use the chat or team chat.
I have found plugins that already does this so I tried to learn from them. But there is a part I donīt really understand.
Code:
public block_gagged(id){ // This function is what check the say / team_say messages & block them if the client is blocked.
if(!g_GagPlayers[id]) return PLUGIN_CONTINUE // Is true if the client is NOT blocked.
new cmd[5]
read_argv(0,cmd,4)
if ( cmd[3] == '_' )
{
if (g_GagPlayers[id] & 2){
#if GagReason == 1
client_print(id,print_chat,"* You are Gagged For The Following Reason: %s",gs_GagReason[id])
#else
client_print(id,print_chat,"* You Have Been Gagged")
#endif
#if PlaySound == 1
client_cmd(id,"spk barney/youtalkmuch")
#endif
return PLUGIN_HANDLED
}
}
else if (g_GagPlayers[id] & 1) {
#if GagReason == 1
client_print(id,print_chat,"* You Are Gagged For The Following Reason: %s",gs_GagReason[id])
#else
client_print(id,print_chat,"* You Have Been Gagged")
#endif
#if PlaySound == 1
client_cmd(id,"spk barney/youtalkmuch")
#endif
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
(Taken from :
http://forums.alliedmods.net/showpos...&postcount=271 )
This part is suposed to block the player when the player says something. But I donīt really get how this part actully blocks the player. Only that it tells the player that heīs gaged. Can someone please tell me if Im looking at the wrong part or if Im missing to se something.
Question two is that I also wounder which way is the best to save the gaged players. I have found nVault which seems to be able to do this. But how will it effect the server if it has to do lots of writing?
The way I want my plugin to work is that when a admin gags a player the plugin remeber the player by heīs steam id so he canīt change name to get away. And that it also saves the gag until an admin removes it. So the plugin has to remember the steam id after map changes and etc until its removed.
If there is any questions with what I mean please ask and I will try to explain it better.
And the reason why Im asking is becasue I want to learn. So please donīt tell me to use someone eles plugin. I want to learn by making my own.