Raised This Month: $ Target: $400
 0% 

[ES] Comando para desactivar/activar plugin.


  
 
 
Thread Tools Display Modes
Author Message
benamo6
Veteran Member
Join Date: Aug 2008
Location: NeverLand
Old 03-27-2010 , 22:56   [ES] Comando para desactivar/activar plugin.
#1

Intente hacer un comando para activar y desactivar el plugin pero no andubo. Que estoy haciendo mal?

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>
#include <hamsandwich>

new const VERSION[] = "0.7.0"
new bool:g_on true

const MAX_PLAYERS 32

new g_iPlayers[MAX_PLAYERS], g_iNumg_iPlayeri
new const g_szAliveFlags[] = "a"
#define RefreshPlayersList()    get_players(g_iPlayers, g_iNum, g_szAliveFlags)

public plugin_init()
{
    
register_plugin("Semiclip 2"VERSION"Soul Hunter")
    
register_clcmd("semiclip_on""cmdStatus"ADMIN_KICK);
    
register_clcmd("semiclip_off""cmdStatus2"ADMIN_KICK);
    
register_forward(FM_AddToFullPack"FM_client_AddToFullPack_Post"1)
    
RegisterHam(Ham_Player_PreThink"player""Ham_CBasePlayer_PreThink_Post"1)
}

public 
cmdStatus2(id)
{
    
g_on false
    client_print
(id,print_chat,"El semiclip esta apagado")
}

public 
cmdStatus(id)
{
    
g_on true
    client_print
(id,print_chat,"El semiclip esta prendido")
}

public 
FM_client_AddToFullPack_Post(eseiEntidhostflagsplayerpSet)
{
    if( 
player && id != iEnt && get_orig_retval() && is_user_alive(id) && g_on)
    {
        
set_es(esES_SolidSOLID_NOT)

        static 
Float:flDistance
        flDistance 
entity_range(idiEnt)
        if( 
flDistance 512.0 )
        {
            
set_es(esES_RenderModekRenderTransAlpha)
            
set_es(esES_RenderAmtfloatround(flDistance)/2)
        }
    }
}

public 
Ham_CBasePlayer_PreThink_Post(id)
{
    if( !
is_user_alive(id) && g_on)
    {
        return
    }

    
RefreshPlayersList()

    for(
0i<g_iNumi++)
    {
        
g_iPlayer g_iPlayers[i]
        if( 
id != g_iPlayer )
        {
            
set_pev(g_iPlayerpev_solidSOLID_NOT)
        }
    }
}

public 
client_PostThink(id)
{
    if( !
is_user_alive(id) && g_on)
    {
        return
    }

    
RefreshPlayersList()

    for(
0i<g_iNumi++)
    {
        
g_iPlayer g_iPlayers[i]
        if( 
g_iPlayer != id )
        {
            
set_pev(g_iPlayerpev_solidSOLID_SLIDEBOX)
        }
    }

__________________
Please help me with this Thread
I am 70% addicted to Counterstrike. What about you?
Ill make any spanish translation of a plugin. Just ask for it
benamo6 is offline
Send a message via MSN to benamo6
Old 03-27-2010, 23:03
procces
This message has been deleted by procces.
procces
Member
Join Date: Feb 2010
Old 03-27-2010 , 23:05   Re: [ES] Comando para desactivar/activar plugin.
#2

no se mucho pero no seria

PHP Code:
register_clcmd("say semiclip""cmdStatus"ADMIN_KICK); 
procces is offline
Zapdos1
BANNED
Join Date: Jul 2009
Location: Chile - La Serena
Old 03-27-2010 , 23:13   Re: [ES] Comando para desactivar/activar plugin.
#3

creas una variable

PHP Code:
new pcvar_enable 
luego en el plugin_init la registras

PHP Code:
public plugin_init()
{
    
pcvar_enable register_cvar("amx_enable""1")

luego cuando quieras que funcione, pones antes de tu code:

PHP Code:
public blabla(id)
{
    if(
get_pcvar_num(pcvar_enable))
    {
         
//tu code aquí
    
}

Zapdos1 is offline
ILUSION
Senior Member
Join Date: Oct 2006
Location: Argentina
Old 03-27-2010 , 23:27   Re: [ES] Comando para desactivar/activar plugin.
#4

Agregá al principio de todas las forwards

PHP Code:
if (!g_on) return FMRES_IGNORED 
ILUSION 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 08:38.


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