Raised This Month: $ Target: $400
 0% 

quick easy question


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Checkmarks
BANNED
Join Date: Sep 2007
Location: kentucky
Old 12-12-2007 , 17:23   quick easy question
Reply With Quote #1

How to make a cvar that let's you turn your whole plugin on and off?
Checkmarks is offline
Drak
Veteran Member
Join Date: Jul 2005
Old 12-12-2007 , 22:17   Re: quick easy question
Reply With Quote #2

A whole plugin on and off?
I think that can be done by another plugin.. Tho.. I'm not exactly sure.. But..
If you were to pause a plugin, you couldn't turn it back on.. Since it would be paused.. So it would need another plugin to do it for it.
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 12-13-2007 , 07:12   Re: quick easy question
Reply With Quote #3

...

Make an enabled CVAR, then in each function, check if the CVAR is enabled before doing anything...
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
Checkmarks
BANNED
Join Date: Sep 2007
Location: kentucky
Old 12-13-2007 , 14:59   Re: quick easy question
Reply With Quote #4

Eh, I won't worry about it..Atleast not yet, maybe in v2 or something ><
Checkmarks is offline
Lee
AlliedModders Donor
Join Date: Feb 2006
Old 12-14-2007 , 04:22   Re: quick easy question
Reply With Quote #5

It's really very simple..

Code:
new enabled; public plugin_init() {     enabled = register_cvar("pluginname_enabled", "1"); } doSomthing() {     if(!get_pcvar_num(enabled))     {         return;     }     doRealWork() } doSomthingElse() {     if(!get_pcvar_num(enabled))     {         return;     }     doOtherRealWork() }
Lee 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 11:11.


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