Senior Member
05-26-2018
, 18:22
Semiclip
#1
Hello bros,
I have a problem about semiclip. And I searched but i didn't find anything to fix it.
The problem I wanna fix is that I cannot see any teammate's name while semiclip is on.
*Why I am using this semiclip?
=Because while i am using other semiclip plugins, people are doing bug and door doesn't open.
Door opens by dint of this semiclip but while it's on, i cannot see any teammate's name.
I want you to fix this problem. Thanks for helping.
Spoiler
PHP Code:
#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <hamsandwich>
#define IsPlayer(%1) (1 <= %1 <= get_maxplayers())
new players [ 32 ], inum , semiclip_cvar , mp_friendlyfire
new iTeams [ 33 ] = {- 1 , ...};
public plugin_init () {
register_plugin ( "Semiclip" , "1.1" , "Crusher918" ) // Edited by PurposeLess
RegisterHam ( Ham_Player_PreThink , "player" , "FwdHamPlayerPreThink" , true )
RegisterHam ( Ham_Killed , "player" , "FwdHamPlayerKilled" , true )
register_forward ( FM_ShouldCollide , "FwdShouldCollide" )
register_forward ( FM_AddToFullPack , "FwdAddToFullPack" , true )
semiclip_cvar = register_cvar ( "semiclip" , "0" )
mp_friendlyfire = register_cvar ( "mp_friendlyfire" , "0" )
}
public FwdHamPlayerPreThink (const id ) {
if( get_pcvar_num ( semiclip_cvar )) {
Semiclip ( id , SOLID_NOT )
}
}
public client_PostThink ( id ) {
if( get_pcvar_num ( semiclip_cvar )) {
Semiclip ( id , SOLID_SLIDEBOX )
}
}
public FwdHamPlayerKilled () {
if( get_pcvar_num ( semiclip_cvar )) {
get_players ( players , inum , "ae" )
for(new i = 0 ; i < inum ; i ++) {
entity_set_int ( players [ i ], EV_INT_solid , SOLID_SLIDEBOX )
}
}
}
public FwdShouldCollide (const touched , const other ) {
if( get_pcvar_num ( mp_friendlyfire ))
return FMRES_IGNORED ;
if( get_pcvar_num ( semiclip_cvar )) {
if( IsPlayer ( touched ) && IsPlayer ( other )) {
iTeams [ touched ] = get_user_team ( touched );
iTeams [ other ] = get_user_team ( other );
if( iTeams [ touched ] == iTeams [ other ]) {
forward_return ( FMV_CELL , 0 )
return FMRES_SUPERCEDE ;
}
}
}
return FMRES_IGNORED ;
}
public FwdAddToFullPack ( es , e , iEnt , id , hostflags , player , pSet ) {
if( get_pcvar_num ( semiclip_cvar )) {
if( player && id != iEnt && get_orig_retval ()) {
iTeams [ id ] = get_user_team ( id );
iTeams [ iEnt ] = get_user_team ( iEnt );
if( iTeams [ id ] == iTeams [ iEnt ]) {
set_es ( es , ES_Solid , SOLID_NOT );
set_es ( es , ES_RenderMode , kRenderTransAlpha );
set_es ( es , ES_RenderAmt , 100 );
}
}
}
}
Semiclip (const id , const solid ) {
if( get_pcvar_num ( semiclip_cvar )) {
if(! is_user_alive ( id ))
return
get_players ( players , inum , "a" )
for(new i = 0 ; i < inum ; i ++) {
if( id != players [ i ]) {
iTeams [ id ] = get_user_team ( id );
iTeams [ players [ i ]] = get_user_team ( players [ i ]);
if( iTeams [ id ] == iTeams [ players [ i ]])
entity_set_int ( players [ i ], EV_INT_solid , solid )
}
}
}
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1055\\ f0\\ fs16 \n\\ par }
*/