Hey guys i was makeing a plugin that displays the motds for
recruit /recrut
main motd /motd
rules /rules
wat i need to do is have
amx_motd 1|2
and have it turn it off.. if any of you want to post ither the cvar check for it or a function to turn off and on. thank you.
please post it with comments explaining what it does (learning)
heres my code
Code:
#include <amxmodx>
#include <amxmisc>
new g_Switch;
public plugin_init()
{
register_plugin("Show Motd", "1.0", "SavSin/Raphero");
register_clcmd("say /motd", "motd");
register_clcmd("say /recruit", "recruit");
register_clcmd("say /rules", "rules");
g_Switch = register_cvar("amx_motd","1");
}
public motd(id)
{
if(get_pcvar_num(g_Switch))
{
show_motd(id, "czero/motd.txt", "Motd");
return;
}
}
public recruit(id)
{
if(get_pcvar_num(g_Switch))
{
show_motd ( id, "recruit.txt");
return;
}
}
public rules(id)
{
if(get_pcvar_num(g_Switch))
{
show_motd ( id, "rules.txt");
return;
}
}
Got it updated code above