/invis plugin

Started by joel
08/04/2008 13:34
Page 2 of 2
stask0 Tournament #212/04/2008 01:21

just copy the code then click the right button at the mouse :P New -> Shortcut rename it to asdasdas.sma and compile :D

skyjur12/04/2008 12:31(edited 12/04/2008 12:38)

Originally posted by stask0
just copy the code then click the right button at the mouse :P New -> Shortcut rename it to asdasdas.sma and compile :D


I think most of people who sees this word "compile" are thinking WTF :D

You can try my /invis: http://skyjur.ampaste.net/160089

BTW scripters, if you are using 1~2 function from fm util, you could copy it into your code. It would be 10 times easer for peoples to compile it.

StormZz13/04/2008 02:26

thx i got it now :]

ichirou14/04/2008 19:47

I use the plugin schlumpf first posted, had some problems compiling but got it to work. It works as it should...

But this plugin disables our "transparency" in our semiclip plugin somehow, any fix ideas? :)

I have this on our insilio server and I'd rather have transparency than /invis if I had to chose. But there must be a fix to this :)

SchlumPF14/04/2008 20:16

your plugin does set transparency with set_rendering which is quite the same as fm_set_rendering since both change the same cs values. you could try using
fm_set_entity_visibility( ent, 1 );
for the first fm_set_rendering and
fm_set_entity_visibility( ent, 0 );
for the second.

cannot test how to use the set_es command exactly since they do not work for me even if i use some plugin which should work like the code skyjur posted

skyjur14/04/2008 20:30

do you register AddToFullPack correctly?

register_forward(FM_AddToFullPack, "addToFullPack", 1)

ichirou14/04/2008 20:33

I tried skyjur's plugin and it seems that one doesn't interfere with our transparency :)

SchlumPF15/04/2008 16:49(edited 15/04/2008 17:50)

no i didnt :S did not know that i need to register the post foward -.-

edit: this is working now without effecting semiclip ichirou

did just test this in my kz plugin in which it is a bit modified

#include
#include

#pragma semicolon 1

new bool:g_bPlayerInvisible[33], bool:g_bWaterInvisible[33];

public plugin_init( )
{
register_plugin( "Invisible", "1.3", "SchlumPF*" );

register_clcmd( "say /invis", "menuInvisDisplay" );

register_forward( FM_AddToFullPack, "fwdAddToFullPack", 1 );

register_menucmd( register_menuid( "\rInvisibility - SchlumPF^n^n" ), 1023, "menuInvisAction" );
}

public fwdAddToFullPack( es_handle, e, ent, host, hostflags, player, pset )
{
if( is_user_alive( ent ) && is_user_alive( host ) )
if( g_bPlayerInvisible[host] )
set_es( es_handle, ES_Effects, EF_NODRAW );

if( pev_valid( ent ) )
{
static classname[32];
pev( ent, pev_classname, classname, sizeof classname - 1 );

// need to remove the string comapring here to save much cpu
if( equali( classname, "func_water" ) )
if( g_bWaterInvisible[host] )
set_es( es_handle, ES_Effects, EF_NODRAW );
}

return PLUGIN_HANDLED;
}

public menuInvisDisplay( plr )
{
static menu[2048];
new keys = ( 1<<0 | 1<<1 | 1<<9 );

new player[3], water[3];
format( player, sizeof player - 1, "%s", g_bPlayerInvisible[plr] ? "\d" : "\w" );
format( water, sizeof water - 1, "%s", g_bWaterInvisible[plr] ? "\d" : "\w" );

new len = format( menu, sizeof menu - 1, "\rInvisibility - SchlumPF^n^n" );

len += format( menu[len], sizeof menu - len, "\r01. %sPlayers^n", player );
len += format( menu[len], sizeof menu - len, "\r02. %sWater^n^n", water );
len += format( menu[len], sizeof menu - len, "\r00. \wExit" );

show_menu( plr, keys, menu, -1 );

return PLUGIN_HANDLED;
}

public menuInvisAction( plr, key )
{
static message[192];

switch( key )
{
case 0:
{
g_bPlayerInvisible[plr] = g_bPlayerInvisible[plr] ? false : true;

message[0] = 0x04;
format( message[1], sizeof message - 2, "[XJ] ^x01All players are now %s.", g_bPlayerInvisible[plr] ? "visible" : "invisible" );

menuInvisDisplay( plr );
}
case 1:
{
g_bWaterInvisible[plr] = g_bWaterInvisible[plr] ? false : true;

message[0] = 0x04;
format( message[1], sizeof message - 2, "[XJ] ^x01Water is now %s.", g_bWaterInvisible[plr] ? "visible" : "invisible" )

menuInvisDisplay( plr );
}
case 9: show_menu( plr, 0, "" );
}

return PLUGIN_HANDLED;
}

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

Fatalis18/04/2008 12:36

skyjur's method is the best. It can be improved one more way:
Only register the addtofullpack forward when someone is using /invis
When no players are using /invis, unregister the forward

Alucard^01/05/2008 03:59(edited 01/05/2008 04:05)

but the skyjur plugin dont have water-invis.. and the menu of the SchlumPF* plugin.. :$ somebody can implement it?

(i cant compile the plugin of SchlumPF*)

[blockquote]Welcome to the AMX Mod X 1.76-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

/home/groups/amxmodx/tmp3/textoPbRJO.sma(81) : error 001: expected token: ";", but found "-identifier-"

1 Error.
Could not locate output file /home/groups/amxmodx/public_html/websc3/textoPbRJO.amx (compile failed).[/blockquote]

edit: sry for revive the thread, i didnt see the date

Page 2 of 2

Please log in to post replies.