Raised This Month: $ Target: $400
 0% 

[SOLVED] How make a automatic enable / disable plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GalegO
Member
Join Date: May 2010
Location: Brazil
Old 05-04-2010 , 14:42   Re: How make a automatic enable / disable plugin
Reply With Quote #1

Yes, I compiled and tested now...

It pause, but no unpause

This is parts of my code:

Code:
new cvar_automatic;
new iAdmins;

public plugin_init()
{
    cvar_automatic                = register_cvar("gal_automatic", "1");
}

public client_disconnect(id)
{
    if( is_user_admin( id ) && get_pcvar_num(cvar_automatic) == 1 )
        {
            if( --iAdmins < 1 )
            {
                    unpause( "a" );
            }
        }
}

public client_putinserver(id)
{
    if( is_user_admin( id ) && get_pcvar_num(cvar_automatic) == 1 )
        {
            iAdmins++;
            pause( "a" );
        }
}
In attachments, my modified source...

PS: Search for //AUTOMATIC in the source, I put this to find more quicky my modifications...

Quote:
Originally Posted by Bugsy
The only issue I see is whether or not the plugin will be able to unpause itself while in a paused state.
Hahaha... IS true!!! If stoped he doen't work more!!! hahaah... I'll make a new plugin to pause and unpause this plugin... Is the only way...

This is my second modification in a plugin, the first I only translated the KnifeDuel to Pt_Br...
Attached Files
File Type: sma Get Plugin or Get Source (galileo.sma - 551 views - 76.4 KB)

Last edited by GalegO; 05-04-2010 at 15:30.
GalegO 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 03:52.


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