Skocz do zawartości

  • Zaloguj korzystając z Facebooka Zaloguj korzystając z Twittera Zaloguj przez Steam Zaloguj poprzez Google      Logowanie »   
  • Rejestracja

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.

  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

Noclip z touchem dla bytu - mozliwe ?


Najlepsza odpowiedź grankee, 31.03.2015 03:17

MOVETYPE_TOSS + SOLID_TRIGGER mi działał

Przejdź do postu


  • Nie możesz napisać tematu
  • Zaloguj się, aby dodać odpowiedź
3 odpowiedzi w tym temacie

#1 NoLiFeR

    Wszechobecny

  • Użytkownik

Reputacja: 103
Zaawansowany

  • Postów:483
  • GG:
  • Imię:Adrian
  • Lokalizacja:Sosnowiec
Offline

Napisano 30.03.2015 23:54

Chcialbym mojemu bytowi ustawic taką kombinacje movetype oraz solid'a aby wykrywalo toucha, ale jednoczesnie nie kolidowalo z otoczeniem (noclip i trigger nie dzialaja.)


Jest to mozliwe ?


Użytkownik NoLiFeR edytował ten post 31.03.2015 00:06

  • +
  • -
  • 0

#2 grankee

    Godlike

  • Support Team

Reputacja: 507
Wszechwiedzący

  • Postów:1500
  • Lokalizacja:Radom
Offline

Napisano 31.03.2015 03:17   Najlepsza odpowiedź

MOVETYPE_TOSS + SOLID_TRIGGER mi działał


  • +
  • -
  • 1

#3 Misiaczek ;c

    /dev/null

  • Moderator

Reputacja: 1662
Godlike

  • Postów:2495
  • GG:
  • Steam:steam
  • Imię:Michał
  • Lokalizacja:Halemba
Offline

Napisano 31.03.2015 07:20

#define SHOW_NAMES_WHEN_AIM
#define ENABLE_SHOTS_DAMAGE
 
#define SEMICLIP_RENDERING_RADIUS 400.0
 
// /* DON'T EDIT BELOW */
 
#include < amxmodx >
#include < engine >
#include < fakemeta >
#include < hamsandwich >
 
#pragma semicolon 1
 
#define PLUGIN "Team SemiClip"
#define AUTHORS "ConnorMcLeod"
new const VERSION[] = "0.4.0";
 
const Float:SEMICLIP_RADIUS = SEMICLIP_RENDERING_RADIUS;
 
const m_iTeam = 114;
 
const GROUP_OP_NAND = 1;
#define ENGINE_SETGROUPMASK(%0,%1)	engfunc(EngFunc_SetGroupMask, %0, %1)
 
const groupNone = 0;
 
new const CLASS_PLAYER[] = "player";
 
new g_iMaxPlayers;
#define IsPlayer(%0)	( 1 <= (%0) <= g_iMaxPlayers )
 
#define MaskEnt(%0)	( 1<<(%0 & 31) )
 
new g_bitIsPlayerInSphere;
#define MarkPlayerInSphere(%0)	g_bitIsPlayerInSphere |= MaskEnt(%0)
#define IsPlayerInSphere(%0)	( g_bitIsPlayerInSphere & MaskEnt(%0) )
 
new g_bitIsPlayerInTeam;
#define MarkPlayerInTeam(%0)	g_bitIsPlayerInTeam |= MaskEnt(%0)
#define IsPlayerInTeam(%0)	( g_bitIsPlayerInTeam & MaskEnt(%0) )
 
new g_bitIsPlayerAlive;
#define MarkPlayerAlive(%0)	g_bitIsPlayerAlive |= MaskEnt(%0)
#define IsPlayerAlive(%0)	( g_bitIsPlayerAlive & MaskEnt(%0) )
 
new g_bitBots;
#define MarkPlayerBot(%0)	g_bitBots |= MaskEnt(%0)
#define ClearPlayerBot(%0)	g_bitBots &= ~MaskEnt(%0)
#define IsUserBot(%0)		( g_bitBots & MaskEnt(%0) )
 
new g_bitSeeingPlayers;
#define MarkPlayerSee(%0)		g_bitSeeingPlayers |= MaskEnt(%0)
#define ClearPlayerSee(%0)		g_bitSeeingPlayers &= ~MaskEnt(%0)
#define IsPlayerSeeing(%0)		( g_bitSeeingPlayers & MaskEnt(%0) )
#define TogglePlayerSeeing(%0)	g_bitSeeingPlayers ^= MaskEnt(%0)
 
new g_iPlayers[32], g_iNum;
 
new g_iLastPlayerIndex;
 
new g_iFhAddToFullPackPost;
 
new bool:g_bReadPackets;
new bool:g_bClientMessages;
 
#if defined SHOW_NAMES_WHEN_AIM
	new HamHook:g_iHhPreThink, HamHook:g_iHhPreThinkPost, bool:g_bPreThinkHooked;
#endif
 
#if defined ENABLE_SHOTS_DAMAGE
	new HamHook:g_iHhPostThink, HamHook:g_iHhPostThinkPost, bool:g_bPostThinkHooked;
#endif
 
public plugin_init()
{
	register_plugin( PLUGIN, VERSION, AUTHORS );
 
	register_forward(FM_CmdStart, "OnCmdStart_P", true);
 
#if defined SHOW_NAMES_WHEN_AIM
	DisableHamForward( g_iHhPreThink = RegisterHam(Ham_Player_PreThink, CLASS_PLAYER, "OnCBasePlayer_PreThink", false) );
	DisableHamForward( g_iHhPreThinkPost = RegisterHam(Ham_Player_PreThink, CLASS_PLAYER, "OnCBasePlayer_PreThink_P", true) );
#endif
	
#if defined ENABLE_SHOTS_DAMAGE
	DisableHamForward( g_iHhPostThink = RegisterHam(Ham_Player_PostThink, CLASS_PLAYER, "OnCBasePlayer_PostThink", false) );
	DisableHamForward( g_iHhPostThinkPost = RegisterHam(Ham_Player_PostThink, CLASS_PLAYER, "OnCBasePlayer_PostThink_P", true) );
#endif
 
	RegisterHam(Ham_Spawn, CLASS_PLAYER, "OnCBasePlayer_Spawn_P", true);
	RegisterHam(Ham_Killed, CLASS_PLAYER, "OnCBasePlayer_Killed_P", true);
 
	register_forward(FM_UpdateClientData, "OnUpdateClientData_P", true);
 
	g_iMaxPlayers = get_maxplayers();
}
 
public client_putinserver(id)
{
	if( is_user_bot(id) )
	{
		MarkPlayerBot(id);
	}
	else
	{
		ClearPlayerBot(id);
	}
	MarkPlayerSee(id);
}
 
public OnCmdStart_P(id)
{
	if( !g_bReadPackets )
	{
		g_bReadPackets = true;
 
		static plr;
		get_players g_iPlayers, g_iNum, "a" ;
		for(--g_iNum; g_iNum>=0; g_iNum--)
		{
			plr = g_iPlayers[ g_iNum ];
			entity_set_int plr, EV_INT_groupinfo, get_pdata_int(plr, m_iTeam) ;
		}
		g_iLastPlayerIndex = 0;
	}
 
	if( g_iLastPlayerIndex && is_user_alive(g_iLastPlayerIndex) )
	{
		entity_set_int g_iLastPlayerIndex, EV_INT_groupinfo, get_pdata_int(g_iLastPlayerIndex, m_iTeam) ;
	}
 
	if( is_user_alive(id) )
	{
		static group;
		group = get_pdata_int(id, m_iTeam);
		entity_set_int id, EV_INT_groupinfo, group ;
		ENGINE_SETGROUPMASK(group, GROUP_OP_NAND);
		if( IsPlayerSeeing(id) )
		{
#if defined SHOW_NAMES_WHEN_AIM
			if( !g_bPreThinkHooked )
			{
				EnableHamForward g_iHhPreThink ;
				EnableHamForward g_iHhPreThinkPost ;
				g_bPreThinkHooked = true;
			}
#endif
#if defined ENABLE_SHOTS_DAMAGE
			if( !g_bPostThinkHooked )
			{
				EnableHamForward g_iHhPostThink ;
				EnableHamForward g_iHhPostThinkPost ;
				g_bPostThinkHooked = true;
			}
#endif
		}
		else // empty statement when nothing is defined ?
		{
#if defined SHOW_NAMES_WHEN_AIM
			if( g_bPreThinkHooked )
			{
				DisableHamForward g_iHhPreThink ;
				DisableHamForward g_iHhPreThinkPost ;
				g_bPreThinkHooked = false;
			}
#endif
#if defined ENABLE_SHOTS_DAMAGE
			if( g_bPostThinkHooked )
			{
				DisableHamForward g_iHhPostThink ;
				DisableHamForward g_iHhPostThinkPost ;
				g_bPostThinkHooked = false;
			}
#endif
		}
	}
	else
	{
		entity_set_int id, EV_INT_groupinfo, groupNone ;
		g_iLastPlayerIndex = id;
#if defined SHOW_NAMES_WHEN_AIM
		if( g_bPreThinkHooked )
		{
			DisableHamForward g_iHhPreThink ;
			DisableHamForward g_iHhPreThinkPost ;
			g_bPreThinkHooked = false;
		}
#endif
#if defined ENABLE_SHOTS_DAMAGE
		if( g_bPostThinkHooked )
		{
			DisableHamForward g_iHhPostThink ;
			DisableHamForward g_iHhPostThinkPost ;
			g_bPostThinkHooked = false;
		}
#endif
	}
 
	return FMRES_IGNORED;
}
 
public OnCBasePlayer_PreThink(id)
{
	entity_set_int id, EV_INT_groupinfo, groupNone ;
 
	return HAM_IGNORED;
}
 
public OnCBasePlayer_PreThink_P(id)
{
	entity_set_int id, EV_INT_groupinfo, get_pdata_int(id, m_iTeam) ;
 
	return HAM_IGNORED;
}
 
public OnCBasePlayer_PostThink(id)
{
	entity_set_int id, EV_INT_groupinfo, groupNone ;
 
	return HAM_IGNORED;
}
 
public OnCBasePlayer_PostThink_P(id)
{
	entity_set_int id, EV_INT_groupinfo, get_pdata_int(id, m_iTeam) ;
 
	return HAM_IGNORED;
}
 
public OnCBasePlayer_Spawn_P(id)
{
	if( is_user_alive(id) )
	{
		entity_set_int id, EV_INT_groupinfo, get_pdata_int(id, m_iTeam) ;
	}
 
	return HAM_IGNORED;
}
 
public OnCBasePlayer_Killed_P(id)
{
	if( !is_user_alive(id) )
	{
		entity_set_int id, EV_INT_groupinfo, groupNone ;
	}
 
	return HAM_IGNORED;
}
 
// maybe this could be moved to first UpdateClientData ??
// in any ways, SV_Physics gonna be executed with clipping players
public server_frame()
{
	g_iLastPlayerIndex = 0;
	g_bReadPackets = false;
	g_bClientMessages = false;
 
	static id;
	get_players g_iPlayers, g_iNum, "a" ;
	for(--g_iNum; g_iNum>=0; g_iNum--)
	{
		id = g_iPlayers[ g_iNum ];
		entity_set_int id, EV_INT_groupinfo, 0 ;
	}
 
	return FMRES_IGNORED;
}
 
public OnUpdateClientData_P(id, sendweapons, cd)
{
	if( IsUserBot(id) )
	{
		return FMRES_IGNORED;
	}
 
	if( !g_bClientMessages )
	{
		g_bClientMessages = true;
 
		g_bitIsPlayerAlive = 0;
		get_players g_iPlayers, g_iNum, "a" ;
		for(--g_iNum; g_iNum>=0; g_iNum--)
		{
			MarkPlayerAlive( g_iPlayers[ g_iNum ] ); // safe to cache alive players here because nobody can die/spawn during rendering
		}
	}
 
	if( IsPlayerAlive(id) )
	{
		if( IsPlayerSeeing(id) )
		{
			static player;
 
			g_bitIsPlayerInTeam = 0;
 
			get_players g_iPlayers, g_iNum, "ae", get_pdata_int(id, m_iTeam) == 1 ? "TERRORIST" : "CT" ;
 
			for(--g_iNum; g_iNum>=0; g_iNum--)
			{
				player = g_iPlayers[ g_iNum ];
				if( player != id )
				{
					MarkPlayerInTeam( player );
				}
			}
			g_iNum = find_sphere_class(id, CLASS_PLAYER, SEMICLIP_RADIUS, g_iPlayers, g_iMaxPlayers);
			
			g_bitIsPlayerInSphere = 0;
			for(--g_iNum; g_iNum>=0; g_iNum--)
			{
				player = g_iPlayers[ g_iNum ];
				if( player != id && IsPlayerInTeam( player ) )
				{
					MarkPlayerInSphere( player );
				}
			}
			if( g_bitIsPlayerInSphere )
			{
				if( !g_iFhAddToFullPackPost )
				{
					g_iFhAddToFullPackPost = register_forward(FM_AddToFullPack, "OnAddToFullPack_P", true);
				}
			}
			else if( g_iFhAddToFullPackPost )
			{
				unregister_forward FM_AddToFullPack, g_iFhAddToFullPackPost, true ;
				g_iFhAddToFullPackPost = 0;
			}
		}
		else if( g_iFhAddToFullPackPost )
		{
			unregister_forward FM_AddToFullPack, g_iFhAddToFullPackPost, true ;
			g_iFhAddToFullPackPost = 0;
		}
	}
 
	return FMRES_IGNORED;
}
 
public OnAddToFullPack_P(es, e, ent, id, hostflags, player, pSet)
{
	if( player )
	{
		if( IsPlayerAlive(ent) && IsPlayerInSphere(ent) )
		{
			set_es es, ES_Solid, SOLID_NOT ;
			set_es es, ES_RenderMode, kRenderTransAlpha ;
			set_es es, ES_RenderAmt, floatround(entity_range(id, ent) * 255.0 / SEMICLIP_RADIUS, floatround_floor) ;
		}
	}
	else
	{
		unregister_forward FM_AddToFullPack, g_iFhAddToFullPackPost, true ;
		g_iFhAddToFullPackPost = 0;
	}
}


  • +
  • -
  • 1

#4 NoLiFeR

    Wszechobecny

  • Autor tematu
  • Użytkownik

Reputacja: 103
Zaawansowany

  • Postów:483
  • GG:
  • Imię:Adrian
  • Lokalizacja:Sosnowiec
Offline

Napisano 31.03.2015 11:17

To ma dzialac na enty, ale wykorzystam powyzszy kod do czegos innego. grankee dzięki dziala. Mozna zamknac.


  • +
  • -
  • 0




Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych