Raised This Month: $ Target: $400
 0% 

Cvar function on/off help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Sav
Junior Member
Join Date: Dec 2006
Old 01-21-2007 , 15:00   Cvar function on/off help
Reply With Quote #1

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

Last edited by Sav; 01-21-2007 at 16:37.
Sav 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 22:21.


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