Plugin remove player invis function + add one function in Water in Maps

В този раздел можете да подавате всякакви заявки за намиране, изработка или преработка на плъгини/модове.
Аватар
Infamous2018
Извън линия
Foreigner
Foreigner
Мнения: 522
Регистриран на: 08 Апр 2018, 16:56
Се отблагодари: 14 пъти
Получена благодарност: 21 пъти

Plugin remove player invis function + add one function in Water in Maps

Мнение от Infamous2018 » 12 Окт 2018, 20:07

Can anyone remove complete this invis about players and can add only this water function ??? THX

The other wish could anyone add auto water disabled??? So when players want have it active they need to say /water... it would be cool


Код за потвърждение: Избери целия код

/*	
@author Rafal "DarkGL" Wiecek 
@site www.darkgl.amxx.pl
*/

#include <amxmodx>
#include <cstrike>
#include <fakemeta>

const maxPlayer = 32;

new bool:g_bPlayerInvisible[ maxPlayer + 1 ],
	bool:g_bWaterInvisible[ maxPlayer + 1];
	
new Array: gWaterEntity;

new bHookVisible = 0;

public plugin_init( )
{
	register_plugin( "Invis", "1.0", "DarkGL");
	
	gWaterEntity = ArrayCreate( 1 , 1 );
	
	register_clcmd( "say /invis", "menuInvisDisplay" );
	register_clcmd( "say /water", "menuInvisDisplay" );
	register_clcmd( "say_team /invis" , "menuInvisDisplay" );
	
	register_menucmd( register_menuid( "" ), ( 1<<0 | 1<<1 | 1<<9  ) , "MenuInvis" );
	
	register_forward( FM_AddToFullPack, "fwdAddToFullPack_Pre" );
	register_forward( FM_AddToFullPack, "fwdAddToFullPack_Post" , 1 );
	
	register_forward( FM_CheckVisibility,"checkVisibility")
}

public plugin_cfg( )
{
	new iEnt = engfunc( EngFunc_FindEntityByString, -1, "classname", "func_water" );
	
	while( iEnt ){
		
		if( !pev_valid( iEnt ) ){
			continue;
		}
		
		ArrayPushCell( gWaterEntity , iEnt );
		
		iEnt = engfunc( EngFunc_FindEntityByString, iEnt, "classname", "func_water" );
	}
}

public checkVisibility(id,pset){
	if( !pev_valid( id ) ){
		return FMRES_IGNORED;
	}
	
	if( !bHookVisible ){
		return FMRES_IGNORED;
	}
	
	bHookVisible = false;
	
	forward_return( FMV_CELL , 0 );
	
	return FMRES_SUPERCEDE;
}

public fwdAddToFullPack_Pre( es_handle, e, ent, host, hostflags, player, pset ){
	if( player ){
		if(is_user_alive(host) && g_bPlayerInvisible[host] && host != ent && is_user_alive(ent) ){
			bHookVisible = true;
		}
	}
}

public fwdAddToFullPack_Post( es_handle, e, ent, host, hostflags, player, pset )
{
	if( is_user_alive( host ) && g_bWaterInvisible[host] && isEntWater( ent ) ){
		set_es( es_handle, ES_Effects, EF_NODRAW );
	}
}

public menuInvisDisplay( plr ){
	
	static menu[ 512 ];
	
	new len = 0;

	len += format( menu[len], sizeof menu - len, "\r2. \wWater: \y%s^n^n", ArraySize( gWaterEntity ) ? ( g_bWaterInvisible[plr] ? "Invisible" : "Visible" ) : "No water on the map" );
	
	len += format( menu[len], sizeof menu - len, "\r0. \wExit" );
	
	show_menu( plr, ( 1<<0 | 1<<1 | 1<<9 ), menu, -1 );
	
	return PLUGIN_HANDLED;
}

public MenuInvis( plr, key )
{
	switch( key )
	{
		case 0:
		{
			g_bPlayerInvisible[plr] = !g_bPlayerInvisible[plr];
			menuInvisDisplay( plr );
		}
		case 1:
		{
			g_bWaterInvisible[plr] = !g_bWaterInvisible[plr];
			menuInvisDisplay( plr );
		}
		default: show_menu( plr, 0, "" );
		}
}

public client_connect( plr )
{
	g_bPlayerInvisible[plr] = false;
	g_bWaterInvisible[plr] = false;
}  

bool: isEntWater( iEnt ){
	for( new iCurrent = 0 ; iCurrent < ArraySize( gWaterEntity ) ; iCurrent++ ){
		
		if( ArrayGetCell( gWaterEntity , iCurrent ) == iEnt ){
			return true;
		}
		
	}
	
	return false;
}

Аватар
Infamous2018
Извън линия
Foreigner
Foreigner
Мнения: 522
Регистриран на: 08 Апр 2018, 16:56
Се отблагодари: 14 пъти
Получена благодарност: 21 пъти

Plugin remove player invis function + add one function in Water in Maps

Мнение от Infamous2018 » 20 Окт 2018, 10:43

МНЕНИЕТО Е СКРИТО ОТ СТРАНА НА МОДЕРАТОР! ЦЪКНИ ВЪРХУ ЛЕНТАТА ЗА ДА ГО ПРЕГЛЕДАШ.
Последно промяна от OciXCrom на 20 Окт 2018, 14:54, променено общо 1 път.
Причина: Use the BUMP button when available. Don't bump with new comments!

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

Plugin remove player invis function + add one function in Water in Maps

Мнение от OciXCrom » 20 Окт 2018, 14:53

Is that the original code? I don't see any players option in the menu.

Аватар
Infamous2018
Извън линия
Foreigner
Foreigner
Мнения: 522
Регистриран на: 08 Апр 2018, 16:56
Се отблагодари: 14 пъти
Получена благодарност: 21 пъти

Plugin remove player invis function + add one function in Water in Maps

Мнение от Infamous2018 » 21 Окт 2018, 10:37

Yes this is the original code. I ffound it in an website...

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

Plugin remove player invis function + add one function in Water in Maps

Мнение от OciXCrom » 21 Окт 2018, 15:04

Did you compile it? Can you show an image of the thing you want to remove because I really don't see such a thing in the code?

Аватар
Infamous2018
Извън линия
Foreigner
Foreigner
Мнения: 522
Регистриран на: 08 Апр 2018, 16:56
Се отблагодари: 14 пъти
Получена благодарност: 21 пъти

Plugin remove player invis function + add one function in Water in Maps

Мнение от Infamous2018 » 21 Окт 2018, 18:46

when i try to add the code here then comes:

403
Forbidden
Access to this resource on the server is denied!

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

Plugin remove player invis function + add one function in Water in Maps

Мнение от OciXCrom » 21 Окт 2018, 20:13

Attach the .sma file in the post or use pastebin.com.

Аватар
Infamous2018
Извън линия
Foreigner
Foreigner
Мнения: 522
Регистриран на: 08 Апр 2018, 16:56
Се отблагодари: 14 пъти
Получена благодарност: 21 пъти

Plugin remove player invis function + add one function in Water in Maps

Мнение от Infamous2018 » 21 Окт 2018, 21:06


Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

Plugin remove player invis function + add one function in Water in Maps

Мнение от OciXCrom » 21 Окт 2018, 22:48


Аватар
Infamous2018
Извън линия
Foreigner
Foreigner
Мнения: 522
Регистриран на: 08 Апр 2018, 16:56
Се отблагодари: 14 пъти
Получена благодарност: 21 пъти

Plugin remove player invis function + add one function in Water in Maps

Мнение от Infamous2018 » 21 Окт 2018, 22:54

Its working but when i try to make visible nothing happens :/

Публикувай отговор
  • Подобни теми
    Отговори
    Преглеждания
     Последно мнение

Обратно към “Заявки за плъгини”

Кой е на линия

Потребители разглеждащи този форум: 0 регистрирани и 16 госта