AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   enabled (https://forums.alliedmods.net/showthread.php?t=121807)

zombieplague 03-20-2010 05:11

enabled
 
How do i enabled this ?

PHP Code:

#include < amxmodx >
#include < amxmisc >

new g_PluginEnabled
new toggle

public plugin_init( )
{
    if ( !
g_PluginEnabled ) return;
    
register_plugin"PLUGIN" "VERSION""AUTHOR" )
    
register_concmd"lol_toggle""Toggle"_"< 1 | 0 > - Enable | Disable lol")
}

public 
plugin_precache( )
{
    
cvar_toggle register_cvar"sd_on""1" )
    if ( !
get_pcvar_numtoggle ) ) return;
    
g_PluginEnabled true
}

public 
Toggleidlevelcid )
{
    if ( !
cmd_accessidlevelcid) )
    {
        return 
PLUGIN_HANDLED
    
}
 
    new 
arg]
    
read_argv1argcharsmaxarg ) )
 
    if ( 
str_to_numarg ) == g_PluginEnabled )
             return 
PLUGIN_HANDLED;
 
    
set_pcvar_numtogglestr_to_numarg ) )
 
    new 
mapname32 ]
    
get_mapnamemapnamecharsmaxmapname ) )
 
    
server_cmd"changelevel %s"mapname )
 
    return 
PLUGIN_HANDLED;


I want to type lol_toogle to on and off how ?

dFF 03-20-2010 08:52

Re: enabled
 
PHP Code:

if ( str_to_numarg ) == g_PluginEnabled )
             return 
PLUGIN_HANDLED

Try to remove this.

zombieplague 03-20-2010 11:40

Re: enabled
 
Quote:

Originally Posted by dFF (Post 1123231)
PHP Code:

if ( str_to_numarg ) == g_PluginEnabled )
             return 
PLUGIN_HANDLED

Try to remove this.

Thanks, how do make if the plugin have enabled and you type lol_toggle don't have any effect. instead of enabled then lol_toggle passes again


All times are GMT -4. The time now is 08:37.

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