Raised This Month: $ Target: $400
 0% 

enable/disable whole plugin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
notahacker
Member
Join Date: Jan 2015
Old 03-12-2017 , 11:31   Re: enable/disable whole plugin
Reply With Quote #8

Quote:
Originally Posted by Craxor View Post
1. You declare a global variables, example 'g_Cvar'
PHP Code:
new g_Cvar 
2. You register in plugin_init() and assign it's id.
PHP Code:
g_Cvar register_cvar"cvar_name""1" ); // '1' means it's value 
3. You check in a public if is On/Off using an if() condition with the native get_pcvar_num() wich return the 'value' of the cvar.
PHP Code:
if( get_pcvar_numg_Cvar ) )
{
      
// If the cvar have a pozitive value .. ( a pozitive value means bigger than 0, so 1 , 2 , 3 .. etc.
}
else
{
     
// If the cvar have a negative value ...



so i should just use an if() condition in all the publics i have in the plugin?
notahacker 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 17:54.


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