Raised This Month: $ Target: $400
 0% 

Cvar function on/off help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dutchmeat
Senior Member
Join Date: Sep 2006
Old 01-22-2007 , 05:29   Re: Cvar function on/off help
Reply With Quote #1

Code:
new g_Switch; //First we create a socalled variable.   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"); //fill in the variable we made before... g_Switch = register_cvar("amx_motd","1"); } public motd(id) { //If we have recieved a positive value(either 1 or higher) if(get_pcvar_num(g_Switch)) { show_motd(id, "czero/motd.txt", "Motd"); return; } }
__________________
before you criticize someone, you should walk a mile in their shoes. that way, when you criticize them, you're a mile away and you have their shoes.

Last edited by dutchmeat; 01-22-2007 at 05:29. Reason: forgot to close a bracket
dutchmeat is offline
Reply



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