Raised This Month: $ Target: $400
 0% 

enable/disable whole plugin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 03-12-2017 , 09:15   Re: enable/disable whole plugin
Reply With Quote #6

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 ...

Craxor is offline
Send a message via ICQ to Craxor
 



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