AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Spanish (https://forums.alliedmods.net/forumdisplay.php?f=135)
-   -   [ES] Bomb Cvar! [SOLUCIONADO] (https://forums.alliedmods.net/showthread.php?t=127352)

Helloween 05-20-2010 02:00

[ES] Bomb Cvar! [SOLUCIONADO]
 
hola! tengo estos codigos:

1:

PHP Code:

#include <amxmodx>
#include <fakemeta>

public plugin_init() {
    
register_plugin("PLUGIN""VERSION""AUTHOR")
    
set_task(2.0"DoMapStrips")
}

public 
DoMapStrips() {
    
RemoveEntityAll("func_bomb_target")
    
RemoveEntityAll("info_bomb_target")
}

stock RemoveEntityAll(name[])
{
    new 
ent engfunc(EngFunc_FindEntityByString0"classname"name)
    new 
temp
    
while (ent)
    {
        
temp engfunc(EngFunc_FindEntityByStringent"classname"name)
        
engfunc(EngFunc_RemoveEntityent)
        
ent temp
    
}


2:

PHP Code:

include <amxmodx>
#include <fakemeta>

#define VERSION "0.0.2"

public plugin_init()
{
    
register_plugin("No BombSites"VERSION"ConnorMcLeod")

    new 
iEntiTargetszTarget[32]
    while( (
iEnt engfunc(EngFunc_FindEntityByStringiEnt"classname""func_bomb_target")) )
    {
        
pev(iEntpev_targetszTargetcharsmax(szTarget))
        
iTarget 0

        
while( (iTarget engfunc(EngFunc_FindEntityByStringiTarget"targetname"szTarget)) )
        {
            
engfunc(EngFunc_RemoveEntityiTarget)
        }

        
engfunc(EngFunc_RemoveEntityiEnt)
    }

    while( (
iEnt engfunc(EngFunc_FindEntityByStringiEnt"classname""info_bomb_target")) )
    {
        
pev(iEntpev_targetszTargetcharsmax(szTarget))
        
iTarget 0

        
while( (iTarget engfunc(EngFunc_FindEntityByStringiTarget"targetname"szTarget)) )
        {
            
engfunc(EngFunc_RemoveEntityiTarget)
        }

        
engfunc(EngFunc_RemoveEntityiEnt)
    }


lo que quiero lograr es un cvar que al estar en 1 active este codigo y al estar en 0 esto este desactivado... lo he hecho con amx_pause_cfg y no funciona sigue el plugin funcionando :S como podria desactivarlo y activarlo? puede ser mediante cvars?

capostrike93 05-20-2010 02:10

Re: [ES] Bomb Cvar!
 
1

PHP Code:

#include <amxmodx>
#include <fakemeta>

new usa_mas_el_buscador

public plugin_init() {
    
register_plugin("PLUGIN""VERSION""AUTHOR")
    
    
usa_mas_el_buscador register_cvar("usa_el_buscador","1")

    if( 
get_pcvar_num(usa_mas_el_buscador) ) set_task(2.0"DoMapStrips")
}

public 
DoMapStrips() {
    
RemoveEntityAll("func_bomb_target")
    
RemoveEntityAll("info_bomb_target")
}

stock RemoveEntityAll(name[])
{
    new 
ent engfunc(EngFunc_FindEntityByString0"classname"name)
    new 
temp
    
while (ent)
    {
        
temp engfunc(EngFunc_FindEntityByStringent"classname"name)
        
engfunc(EngFunc_RemoveEntityent)
        
ent temp
    
}


2

PHP Code:

#include <fakemeta>

#define VERSION "0.0.2"

new usa_mas_el_buscador

public plugin_init()
{
    
register_plugin("No BombSites"VERSION"ConnorMcLeod")

    
usa_mas_el_buscador register_cvar("usa_el_buscador","1")

    if( !
get_pcvar_num(usa_mas_el_buscador) ) return;

    new 
iEntiTargetszTarget[32]
    while( (
iEnt engfunc(EngFunc_FindEntityByStringiEnt"classname""func_bomb_target")) )
    {
        
pev(iEntpev_targetszTargetcharsmax(szTarget))
        
iTarget 0

        
while( (iTarget engfunc(EngFunc_FindEntityByStringiTarget"targetname"szTarget)) )
        {
            
engfunc(EngFunc_RemoveEntityiTarget)
        }

        
engfunc(EngFunc_RemoveEntityiEnt)
    }

    while( (
iEnt engfunc(EngFunc_FindEntityByStringiEnt"classname""info_bomb_target")) )
    {
        
pev(iEntpev_targetszTargetcharsmax(szTarget))
        
iTarget 0

        
while( (iTarget engfunc(EngFunc_FindEntityByStringiTarget"targetname"szTarget)) )
        {
            
engfunc(EngFunc_RemoveEntityiTarget)
        }

        
engfunc(EngFunc_RemoveEntityiEnt)
    }


more info in http://forums.alliedmods.net/search.php

Helloween 05-20-2010 02:21

Re: [ES] Bomb Cvar!
 
lo probare ahora mismo yo mismo le habia creado las cvars pero al ponerla en 0 igual quedaba funcionando dejame probar rapidamente

Helloween 05-20-2010 02:34

Re: [ES] Bomb Cvar!
 
capo lo acabo de probar y sigue pasando lo mismo al llamar usa_el_buscador "0" no desactiva el codigo acabo de probar con amx_pause_cfg y tampoco se desactiva el codigo como podria hacer para que alejecutar el cvar en 0 desactive el plugin o el codigo que esta alli programado?

capostrike93 05-20-2010 02:37

Re: [ES] Bomb Cvar!
 
amxx.cfg

usa_el_buscador "0"

Helloween 05-20-2010 10:17

Re: [ES] Bomb Cvar!
 
1 Attachment(s)
capo sigue sin servir he puesto usa_el_buscador "0" en la cfg y no sirve!

como te dije ya yo habia hecho lo mismo que tu ponerlo con cvars y no me funciono no hay otra forma de hacer que este codigo se active y se desactive?

aqui puedes ver la imagen:

shinoda 05-20-2010 10:21

Re: [ES] Bomb Cvar!
 
Prueba :B

PHP Code:

#include <amxmodx>
#include <engine>

new const Classnames[][] = {
    
"func_bomb_target",
    
"info_bomb_target"
}

new 
MiCvar

public plugin_init() {
    
register_plugin("a""99999""b")
    
MiCvar register_cvar("amx_remove_classname""1")
    
    
Remover()
}

Remover() {
    
    if(
get_pcvar_num(MiCvar) != 1) return 1
    
    
for(new i=0i<sizeof Classnamesi++)
        
remove_entity_name(Classnames[i])
        
    return 
0



Helloween 05-20-2010 10:35

Re: [ES] Bomb Cvar!
 
hola shinoda :D tu codigo si quita la c4 pero al colocar amx_remove_classname "0" para que si aparezca la c4 no aparece sino que sigue eliminada :S que podra ser?

shinoda 05-20-2010 10:39

Re: [ES] Bomb Cvar!
 
Lo que entiendo es que tu quieres eliminar esos classnames, pero en cualquier momento que eligas quieres que aparezcan otra vez ???

Si es asi, no se puede ... o eso es lo que creo.

Helloween 05-20-2010 10:46

Re: [ES] Bomb Cvar!
 
si osea yo tabajo con varias cfgs que se activan en momentos del juego y ps quiero eliminar colocando x cvar en 0 y despues volviendo a activar en 1.

lo he hecho con amx_pause_cfg pero tampoco se pasusa el plugin!

de verdad no hay manera? yo creo que si la debe de haber xq he visto servidores que asi lo hacen pero ni idea de como logran activar y desactivar :(


All times are GMT -4. The time now is 06:45.

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