User
Pass
2FA
 
 

PLUGIN /INVIS

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Freakz Forum Index -> Trash Bin -> Trash
Author Message269
MafyzzZ
[Banned user]


Banned


Status: Offline
(since 28-01-2014 19:04)
Joined: 28 Jan 2014
Posts: 6, Topics: 4
Location: Romania

Reputation: 31.2
Votes: 1

Post Posted: 28-01-2014, 21:04:24 | Translate post to: ... (Click for more languages)

#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <hamsandwich>

#define MAX_ENTITYS 900+15*32 // (900+15*SERVER_SLOTS) is the calculation cs uses but it can be bypassed by the "-num_edicts <x>"-parameter

new bool:g_bPlayerInvisible[33];

new g_iSpectatedId[33];

public plugin_init( )
{
register_plugin( "Invis", "2.0", "SchlumPF" );

register_clcmd( "say /invis", "menuInvisDisplay" );
register_menucmd( register_menuid( "\rMeniu Invi\w( faci jucatorii invizibili )^n^n" ), 1023, "menuInvisAction" );

register_forward( FM_AddToFullPack, "fwdAddToFullPack_Post", 1 );
RegisterHam( Ham_Spawn, "player", "hamSpawnPlayer_Post", 1 );

register_event( "SpecHealth2", "eventSpecHealth2", "bd" );
}

public fwdAddToFullPack_Post( es_handle, e, ent, host, hostflags, player, pset )
{
if( player && g_bPlayerInvisible[host] && host != ent && ent != g_iSpectatedId[host] && get_user_team(host) == get_user_team(ent) )
{
static const Float:corner[8][3] =
{
{ -4096.0, -4096.0, -4096.0 },
{ -4096.0, -4096.0, 4096.0 },
{ -4096.0, 4096.0, -4096.0 },
{ -4096.0, 4096.0, 4096.0 },
{ 4096.0, -4096.0, -4096.0 },
{ 4096.0, -4096.0, 4096.0 },
{ 4096.0, 4096.0, -4096.0 },
{ 4096.0, 4096.0, 4096.0 }
};

// rounded; distance from the map's center to the corners; sqrt( 4096^2 + 4096^2 + 4096^2 )
static const Float:map_distance = 7094.480108;

static Float:origin[3];
get_es( es_handle, ES_Origin, origin );

static i;
while( get_distance_f( origin, corner[i] ) > map_distance )
{
if( ++i >= sizeof( corner ) )
{
// better to nullify the varibale now then doing it each time before the loop
i = 0;
}
}

set_es( es_handle, ES_Origin, corner[i] );
set_es( es_handle, ES_Effects, get_es( es_handle, ES_Effects ) | EF_NODRAW );
}

}

public hamSpawnPlayer_Post( id )
{
g_iSpectatedId[id] = 0;
}

// thanks to xPaw who told me about this event
public eventSpecHealth2( id )
{
g_iSpectatedId[id] = read_data( 2 );
}

public menuInvisDisplay( id )
{
static menu[256];

new len = formatex( menu, 255, "\rMeniu Invi\w( faci jucatorii invizibili )^n^n" );

len += formatex( menu[len], 255 - len, "\r1. \wJucatori: %s^n", g_bPlayerInvisible[id] ? "Invizibili" : "Vizibili" );

len += formatex( menu[len], 255 - len, "^n\r0. \wIesire" );

show_menu( id, ( 1<<0 | 1<<9 ), menu, -1 );

return PLUGIN_HANDLED;
}

public menuInvisAction( id, key )
{
switch( key )
{
case 0:
{
g_bPlayerInvisible[id] = !g_bPlayerInvisible[id];
menuInvisDisplay( id );
}
case 9: show_menu( id, 0, "" );
}
}

public client_connect( id )
{
g_bPlayerInvisible[id] = false;
g_iSpectatedId[id] = 0;
}

0 0
  
Back to top
View user's profile Send private message
-bebeto-

[Freakz * -carmen-]



Status: Offline
(since 19-03-2018 19:51)
Joined: 13 Oct 2010
Posts: 18754, Topics: 117
Location: Militari

Reputation: 2887.8
Votes: 296

 
Post Posted: 29-01-2014, 10:26:57 | Translate post to: ... (Click for more languages)

Limites dai tc are contrul blocat.


Y!M bebeto_cristi
0 0
  
Back to top
View user's profile Send private message
LimiTLesS.

[Account disabled]



Status: Offline
(since 03-02-2014 17:42)
Joined: 23 Feb 2013
Posts: 950, Topics: 19
Location: Jamaica

Reputation: -191.9
Votes: 75

Post Posted: 29-01-2014, 10:46:38 | Translate post to: ... (Click for more languages)

T/C


0 0
  
Back to top
View user's profile Send private message

  Topic locked


Topic is closed, you cannot post any messages in it anymore

Locked by LimiTLesS., 29 January 2014 08:46



 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Freakz Forum Index -> Trash Bin -> Trash  


The time now is 23-02-2025, 04:21:38
Copyright info

Based on phpBB ro/com
B

 
 
 







I forgot my password


This message appears only once, so
like us now until it's too late ! :D
x