- | Afiseaza codul
#include <amxmodx> #include <engine> /* Tirant Zombie Base Builder or Veco Zombie Base Builder */ #define USE_TIRANT_ZBB #if defined USE_TIRANT_ZBB #include <basebuilder> #define IsBuildPhase() bb_is_build_phase() #endif #if defined USE_VECO_ZBB #include <vzbb_mod> #define IsBuildPhase() user_can_build() #endif new bool:g_bHook[ 33 ]; new gHookOrigins[ 33 ][ 3 ]; new g_iHook; new const g_szPrefix[ ] = "HOOK"; public plugin_init( ) { register_plugin( "Hook", "1.0", "One Above All" ); register_clcmd( "+hook", "hook_on" ); register_clcmd( "-hook", "hook_off" ); } public plugin_precache( ) { g_iHook = precache_model( "sprites/hook.spr" ); } public hook_on( id ) { if ( !(get_user_flags( id ) & ADMIN_RCON) && !IsBuildPhase( ) ) { ColorMessage( id, "Numai^3 in timpul de constructie poti folosi HOOK." ); return PLUGIN_HANDLED; } if ( get_user_team( id ) != 2 ) { ColorMessage( id, "Numai^3 Echipa CT poate folosi HOOK " ); return PLUGIN_HANDLED; } if ( IsBuildPhase() || get_user_flags( id ) & ADMIN_RCON && !IsBuildPhase()) { get_user_origin( id, gHookOrigins[ id ], 3 ); g_bHook[ id ] = true; set_task( 0.1, "hook_task", id, "", 0, "ab" ); hook_task( id ); } return PLUGIN_HANDLED; } public hook_off( id ) { remove_hook( id ); return PLUGIN_HANDLED; } public hook_task( id ) { if( !is_user_connected( id ) || !is_user_alive( id ) ) remove_hook( id ); remove_beam( id ); draw_hook( id ); new iOrigin[ 3 ], Float:fVelocity[ 3 ]; get_user_origin( id, iOrigin ); new iDistance = get_distance( gHookOrigins[ id ], iOrigin); if ( iDistance > 25 ) { fVelocity[ 0 ] = ( gHookOrigins[ id ][ 0 ] - iOrigin[ 0 ] ) * ( 2.0 * 300 / iDistance ); fVelocity[ 1 ] = ( gHookOrigins[ id ][ 1 ] - iOrigin[ 1 ] ) * ( 2.0 * 300 / iDistance ); fVelocity[ 2 ] = ( gHookOrigins[ id ][ 2 ] - iOrigin[ 2 ] ) * ( 2.0 * 300 / iDistance ); entity_set_vector( id, EV_VEC_velocity, fVelocity ); } else { entity_set_vector( id, EV_VEC_velocity, Float:{0.0,0.0,0.0} ); remove_hook( id ); } } public draw_hook( id ) { message_begin( MSG_BROADCAST, SVC_TEMPENTITY ); write_byte( 1 ); // TE_BEAMENTPOINT write_short( id ); // Entity index write_coord( gHookOrigins[ id ][ 0 ] ); // Origin write_coord( gHookOrigins[ id ][ 1 ] ); // Origin write_coord( gHookOrigins[ id ][ 2 ] ); // Origin write_short( g_iHook ); // Sprite index write_byte( 0 ); // Start frame write_byte( 0 ); // Framerate write_byte( 100 ); // Life write_byte( 10 ); // Width write_byte( 0 ); // Noise write_byte( random_num(0, 255) ); // Red write_byte( random_num(0, 255) ); // Green write_byte( random_num(0, 255) ); // Blue write_byte( 250 ); // Brightness write_byte( 1 ); // Speed message_end( ); } public remove_hook( id ) { if( task_exists( id ) ) remove_task( id ); remove_beam(id); g_bHook[ id ] = false; } public remove_beam(id) { message_begin( MSG_BROADCAST, SVC_TEMPENTITY ); write_byte( 99 ); write_short( id ); message_end( ); } stock ColorMessage( const id, const input[ ], any:... ) { new iCount = 1, iPlayers[ 32 ]; static szMessage[ 191 ]; new iLen = formatex( szMessage, 190, "^4[%s]^1 ", g_szPrefix ); vformat( szMessage[ iLen ], 190-iLen, input, 3 ); if ( id ) iPlayers[ 0 ] = id; else get_players( iPlayers , iCount , "ch" ); for ( new i = 0; i < iCount; i++ ) { if ( is_user_connected( iPlayers[ i ] ) ) { message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, iPlayers[ i ] ); write_byte( iPlayers[ i ] ); write_string( szMessage ); message_end( ); } } }
Modificare plugin HOOK
Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com
-
- Membru, skill 0
- Posts: 89
- Joined: 13 Aug 2018, 20:19
- Detinator Steam: Da
- CS Status: Citesc forumul eXtreamCS.com...!
- Detinator server CS: NU
- Fond eXtream: 0
- Has thanked: 5 times
- Been thanked: 1 time
- Contact:
Salut Extreamcs doresc si eu o modificare al un plugin de hook pentru base builder, as vrea sa-mi fie scos accesul de ADMIN_RCON sa nu mai poata nimeni folosii hook, sa se poata nu mai in IsBuildPhase() user_can_build()
-
- Scripter eXtreamCS
- Posts: 918
- Joined: 02 Nov 2020, 01:57
- Detinator Steam: Da
- Fond eXtream: 0
- Discord: lexzor#0630
- Has thanked: 71 times
- Been thanked: 136 times
?? nu am inteles ce vrei, cum adica sa nu-l mai foloseasca nimeni ? asa scoti pluginul. nu am inteles exact ce vrei sa faci, dar incearca-l pe asta
Code: Select all
/* Tirant Zombie Base Builder or Veco Zombie Base Builder */
#define USE_TIRANT_ZBB
#if defined USE_TIRANT_ZBB
#include <basebuilder>
#define IsBuildPhase() bb_is_build_phase()
#endif
#if defined USE_VECO_ZBB
#include <vzbb_mod>
#define IsBuildPhase() user_can_build()
#endif
new bool:g_bHook[ 33 ];
new gHookOrigins[ 33 ][ 3 ];
new g_iHook;
new const g_szPrefix[ ] = "HOOK";
public plugin_init( )
{
register_plugin( "Hook", "1.0", "One Above All" );
register_clcmd( "+hook", "hook_on" );
register_clcmd( "-hook", "hook_off" );
}
public plugin_precache( )
{
g_iHook = precache_model( "sprites/hook.spr" );
}
public hook_on( id )
{
if ( !IsBuildPhase( ) )
{
ColorMessage( id, "Numai^3 in timpul de constructie poti folosi HOOK." );
return PLUGIN_HANDLED;
}
if ( get_user_team( id ) != 2 )
{
ColorMessage( id, "Numai^3 Echipa CT poate folosi HOOK " );
return PLUGIN_HANDLED;
}
if ( IsBuildPhase() )
{
get_user_origin( id, gHookOrigins[ id ], 3 );
g_bHook[ id ] = true;
set_task( 0.1, "hook_task", id, "", 0, "ab" );
hook_task( id );
}
return PLUGIN_HANDLED;
}
public hook_off( id )
{
remove_hook( id );
return PLUGIN_HANDLED;
}
public hook_task( id )
{
if( !is_user_connected( id ) || !is_user_alive( id ) )
remove_hook( id );
remove_beam( id );
draw_hook( id );
new iOrigin[ 3 ], Float:fVelocity[ 3 ];
get_user_origin( id, iOrigin );
new iDistance = get_distance( gHookOrigins[ id ], iOrigin);
if ( iDistance > 25 )
{
fVelocity[ 0 ] = ( gHookOrigins[ id ][ 0 ] - iOrigin[ 0 ] ) * ( 2.0 * 300 / iDistance );
fVelocity[ 1 ] = ( gHookOrigins[ id ][ 1 ] - iOrigin[ 1 ] ) * ( 2.0 * 300 / iDistance );
fVelocity[ 2 ] = ( gHookOrigins[ id ][ 2 ] - iOrigin[ 2 ] ) * ( 2.0 * 300 / iDistance );
entity_set_vector( id, EV_VEC_velocity, fVelocity );
}
else
{
entity_set_vector( id, EV_VEC_velocity, Float:{0.0,0.0,0.0} );
remove_hook( id );
}
}
public draw_hook( id )
{
message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
write_byte( 1 ); // TE_BEAMENTPOINT
write_short( id ); // Entity index
write_coord( gHookOrigins[ id ][ 0 ] ); // Origin
write_coord( gHookOrigins[ id ][ 1 ] ); // Origin
write_coord( gHookOrigins[ id ][ 2 ] ); // Origin
write_short( g_iHook ); // Sprite index
write_byte( 0 ); // Start frame
write_byte( 0 ); // Framerate
write_byte( 100 ); // Life
write_byte( 10 ); // Width
write_byte( 0 ); // Noise
write_byte( random_num(0, 255) ); // Red
write_byte( random_num(0, 255) ); // Green
write_byte( random_num(0, 255) ); // Blue
write_byte( 250 ); // Brightness
write_byte( 1 ); // Speed
message_end( );
}
public remove_hook( id )
{
if( task_exists( id ) )
remove_task( id );
remove_beam(id);
g_bHook[ id ] = false;
}
public remove_beam(id)
{
message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
write_byte( 99 );
write_short( id );
message_end( );
}
stock ColorMessage( const id, const input[ ], any:... )
{
new iCount = 1, iPlayers[ 32 ];
static szMessage[ 191 ];
new iLen = formatex( szMessage, 190, "^4[%s]^1 ", g_szPrefix );
vformat( szMessage[ iLen ], 190-iLen, input, 3 );
if ( id ) iPlayers[ 0 ] = id;
else get_players( iPlayers , iCount , "ch" );
for ( new i = 0; i < iCount; i++ )
{
if ( is_user_connected( iPlayers[ i ] ) )
{
message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, iPlayers[ i ] );
write_byte( iPlayers[ i ] );
write_string( szMessage );
message_end( );
}
}
}
-
- Membru, skill 0
- Posts: 89
- Joined: 13 Aug 2018, 20:19
- Detinator Steam: Da
- CS Status: Citesc forumul eXtreamCS.com...!
- Detinator server CS: NU
- Fond eXtream: 0
- Has thanked: 5 times
- Been thanked: 1 time
- Contact:
Adică să nu mai fie folosit de ADMIN_RCON să fie exact la toțilexz wrote: ↑02 Feb 2021, 17:05?? nu am inteles ce vrei, cum adica sa nu-l mai foloseasca nimeni ? asa scoti pluginul. nu am inteles exact ce vrei sa faci, dar incearca-l pe astaCode: Select all
/* Tirant Zombie Base Builder or Veco Zombie Base Builder */ #define USE_TIRANT_ZBB #if defined USE_TIRANT_ZBB #include <basebuilder> #define IsBuildPhase() bb_is_build_phase() #endif #if defined USE_VECO_ZBB #include <vzbb_mod> #define IsBuildPhase() user_can_build() #endif new bool:g_bHook[ 33 ]; new gHookOrigins[ 33 ][ 3 ]; new g_iHook; new const g_szPrefix[ ] = "HOOK"; public plugin_init( ) { register_plugin( "Hook", "1.0", "One Above All" ); register_clcmd( "+hook", "hook_on" ); register_clcmd( "-hook", "hook_off" ); } public plugin_precache( ) { g_iHook = precache_model( "sprites/hook.spr" ); } public hook_on( id ) { if ( !IsBuildPhase( ) ) { ColorMessage( id, "Numai^3 in timpul de constructie poti folosi HOOK." ); return PLUGIN_HANDLED; } if ( get_user_team( id ) != 2 ) { ColorMessage( id, "Numai^3 Echipa CT poate folosi HOOK " ); return PLUGIN_HANDLED; } if ( IsBuildPhase() ) { get_user_origin( id, gHookOrigins[ id ], 3 ); g_bHook[ id ] = true; set_task( 0.1, "hook_task", id, "", 0, "ab" ); hook_task( id ); } return PLUGIN_HANDLED; } public hook_off( id ) { remove_hook( id ); return PLUGIN_HANDLED; } public hook_task( id ) { if( !is_user_connected( id ) || !is_user_alive( id ) ) remove_hook( id ); remove_beam( id ); draw_hook( id ); new iOrigin[ 3 ], Float:fVelocity[ 3 ]; get_user_origin( id, iOrigin ); new iDistance = get_distance( gHookOrigins[ id ], iOrigin); if ( iDistance > 25 ) { fVelocity[ 0 ] = ( gHookOrigins[ id ][ 0 ] - iOrigin[ 0 ] ) * ( 2.0 * 300 / iDistance ); fVelocity[ 1 ] = ( gHookOrigins[ id ][ 1 ] - iOrigin[ 1 ] ) * ( 2.0 * 300 / iDistance ); fVelocity[ 2 ] = ( gHookOrigins[ id ][ 2 ] - iOrigin[ 2 ] ) * ( 2.0 * 300 / iDistance ); entity_set_vector( id, EV_VEC_velocity, fVelocity ); } else { entity_set_vector( id, EV_VEC_velocity, Float:{0.0,0.0,0.0} ); remove_hook( id ); } } public draw_hook( id ) { message_begin( MSG_BROADCAST, SVC_TEMPENTITY ); write_byte( 1 ); // TE_BEAMENTPOINT write_short( id ); // Entity index write_coord( gHookOrigins[ id ][ 0 ] ); // Origin write_coord( gHookOrigins[ id ][ 1 ] ); // Origin write_coord( gHookOrigins[ id ][ 2 ] ); // Origin write_short( g_iHook ); // Sprite index write_byte( 0 ); // Start frame write_byte( 0 ); // Framerate write_byte( 100 ); // Life write_byte( 10 ); // Width write_byte( 0 ); // Noise write_byte( random_num(0, 255) ); // Red write_byte( random_num(0, 255) ); // Green write_byte( random_num(0, 255) ); // Blue write_byte( 250 ); // Brightness write_byte( 1 ); // Speed message_end( ); } public remove_hook( id ) { if( task_exists( id ) ) remove_task( id ); remove_beam(id); g_bHook[ id ] = false; } public remove_beam(id) { message_begin( MSG_BROADCAST, SVC_TEMPENTITY ); write_byte( 99 ); write_short( id ); message_end( ); } stock ColorMessage( const id, const input[ ], any:... ) { new iCount = 1, iPlayers[ 32 ]; static szMessage[ 191 ]; new iLen = formatex( szMessage, 190, "^4[%s]^1 ", g_szPrefix ); vformat( szMessage[ iLen ], 190-iLen, input, 3 ); if ( id ) iPlayers[ 0 ] = id; else get_players( iPlayers , iCount , "ch" ); for ( new i = 0; i < iCount; i++ ) { if ( is_user_connected( iPlayers[ i ] ) ) { message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, iPlayers[ i ] ); write_byte( iPlayers[ i ] ); write_string( szMessage ); message_end( ); } } }
-
- Scripter eXtreamCS
- Posts: 918
- Joined: 02 Nov 2020, 01:57
- Detinator Steam: Da
- Fond eXtream: 0
- Discord: lexzor#0630
- Has thanked: 71 times
- Been thanked: 136 times
asa ti l-am modificat. daca vrei sa fie si la echipa T stergi linia asta
Code: Select all
if ( get_user_team( id ) != 2 )
{
ColorMessage( id, "Numai^3 Echipa CT poate folosi HOOK " );
return PLUGIN_HANDLED;
}
-
- Membru, skill 0
- Posts: 89
- Joined: 13 Aug 2018, 20:19
- Detinator Steam: Da
- CS Status: Citesc forumul eXtreamCS.com...!
- Detinator server CS: NU
- Fond eXtream: 0
- Has thanked: 5 times
- Been thanked: 1 time
- Contact:
X-D3$[T]Ro! wrote: ↑03 Feb 2021, 08:08Adică să nu mai fie folosit de ADMIN_RCON să fie exact la toțilexz wrote: ↑02 Feb 2021, 17:05?? nu am inteles ce vrei, cum adica sa nu-l mai foloseasca nimeni ? asa scoti pluginul. nu am inteles exact ce vrei sa faci, dar incearca-l pe astaCode: Select all
/* Tirant Zombie Base Builder or Veco Zombie Base Builder */ #define USE_TIRANT_ZBB #if defined USE_TIRANT_ZBB #include <basebuilder> #define IsBuildPhase() bb_is_build_phase() #endif #if defined USE_VECO_ZBB #include <vzbb_mod> #define IsBuildPhase() user_can_build() #endif new bool:g_bHook[ 33 ]; new gHookOrigins[ 33 ][ 3 ]; new g_iHook; new const g_szPrefix[ ] = "HOOK"; public plugin_init( ) { register_plugin( "Hook", "1.0", "One Above All" ); register_clcmd( "+hook", "hook_on" ); register_clcmd( "-hook", "hook_off" ); } public plugin_precache( ) { g_iHook = precache_model( "sprites/hook.spr" ); } public hook_on( id ) { if ( !IsBuildPhase( ) ) { ColorMessage( id, "Numai^3 in timpul de constructie poti folosi HOOK." ); return PLUGIN_HANDLED; } if ( get_user_team( id ) != 2 ) { ColorMessage( id, "Numai^3 Echipa CT poate folosi HOOK " ); return PLUGIN_HANDLED; } if ( IsBuildPhase() ) { get_user_origin( id, gHookOrigins[ id ], 3 ); g_bHook[ id ] = true; set_task( 0.1, "hook_task", id, "", 0, "ab" ); hook_task( id ); } return PLUGIN_HANDLED; } public hook_off( id ) { remove_hook( id ); return PLUGIN_HANDLED; } public hook_task( id ) { if( !is_user_connected( id ) || !is_user_alive( id ) ) remove_hook( id ); remove_beam( id ); draw_hook( id ); new iOrigin[ 3 ], Float:fVelocity[ 3 ]; get_user_origin( id, iOrigin ); new iDistance = get_distance( gHookOrigins[ id ], iOrigin); if ( iDistance > 25 ) { fVelocity[ 0 ] = ( gHookOrigins[ id ][ 0 ] - iOrigin[ 0 ] ) * ( 2.0 * 300 / iDistance ); fVelocity[ 1 ] = ( gHookOrigins[ id ][ 1 ] - iOrigin[ 1 ] ) * ( 2.0 * 300 / iDistance ); fVelocity[ 2 ] = ( gHookOrigins[ id ][ 2 ] - iOrigin[ 2 ] ) * ( 2.0 * 300 / iDistance ); entity_set_vector( id, EV_VEC_velocity, fVelocity ); } else { entity_set_vector( id, EV_VEC_velocity, Float:{0.0,0.0,0.0} ); remove_hook( id ); } } public draw_hook( id ) { message_begin( MSG_BROADCAST, SVC_TEMPENTITY ); write_byte( 1 ); // TE_BEAMENTPOINT write_short( id ); // Entity index write_coord( gHookOrigins[ id ][ 0 ] ); // Origin write_coord( gHookOrigins[ id ][ 1 ] ); // Origin write_coord( gHookOrigins[ id ][ 2 ] ); // Origin write_short( g_iHook ); // Sprite index write_byte( 0 ); // Start frame write_byte( 0 ); // Framerate write_byte( 100 ); // Life write_byte( 10 ); // Width write_byte( 0 ); // Noise write_byte( random_num(0, 255) ); // Red write_byte( random_num(0, 255) ); // Green write_byte( random_num(0, 255) ); // Blue write_byte( 250 ); // Brightness write_byte( 1 ); // Speed message_end( ); } public remove_hook( id ) { if( task_exists( id ) ) remove_task( id ); remove_beam(id); g_bHook[ id ] = false; } public remove_beam(id) { message_begin( MSG_BROADCAST, SVC_TEMPENTITY ); write_byte( 99 ); write_short( id ); message_end( ); } stock ColorMessage( const id, const input[ ], any:... ) { new iCount = 1, iPlayers[ 32 ]; static szMessage[ 191 ]; new iLen = formatex( szMessage, 190, "^4[%s]^1 ", g_szPrefix ); vformat( szMessage[ iLen ], 190-iLen, input, 3 ); if ( id ) iPlayers[ 0 ] = id; else get_players( iPlayers , iCount , "ch" ); for ( new i = 0; i < iCount; i++ ) { if ( is_user_connected( iPlayers[ i ] ) ) { message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, iPlayers[ i ] ); write_byte( iPlayers[ i ] ); write_string( szMessage ); message_end( ); } } }
- CyBer[N]eTicK
- Membru, skill +1
- Posts: 190
- Joined: 29 May 2020, 05:35
- Detinator Steam: Da
- CS Status: Strong & Original
- Detinator server CS: BB.BLACKGAMES.RO
- SteamID: /id/cybernetick_cbk/
- Fond eXtream: 0
- Location: Albania, tirana
- Discord: cybernetick_cbk
- Has thanked: 21 times
- Been thanked: 18 times
- Contact:
-
- Scripter eXtreamCS
- Posts: 918
- Joined: 02 Nov 2020, 01:57
- Detinator Steam: Da
- Fond eXtream: 0
- Discord: lexzor#0630
- Has thanked: 71 times
- Been thanked: 136 times
Code: Select all
/* Tirant Zombie Base Builder or Veco Zombie Base Builder */
#define USE_TIRANT_ZBB
#include <amxmodx>
#include <engine>
#if defined USE_TIRANT_ZBB
#include <basebuilder>
#define IsBuildPhase() bb_is_build_phase()
#endif
#if defined USE_VECO_ZBB
#include <vzbb_mod>
#define IsBuildPhase() user_can_build()
#endif
new bool:g_bHook[ 33 ];
new gHookOrigins[ 33 ][ 3 ];
new g_iHook;
new const g_szPrefix[ ] = "HOOK";
public plugin_init( )
{
register_plugin( "Hook", "1.0", "One Above All" );
register_clcmd( "+hook", "hook_on" );
register_clcmd( "-hook", "hook_off" );
}
public plugin_precache( )
{
g_iHook = precache_model( "sprites/hook.spr" );
}
public hook_on( id )
{
if ( !IsBuildPhase( ) )
{
ColorMessage( id, "Numai^3 in timpul de constructie poti folosi HOOK." );
return PLUGIN_HANDLED;
}
if ( get_user_team( id ) != 2 )
{
ColorMessage( id, "Numai^3 Echipa CT poate folosi HOOK " );
return PLUGIN_HANDLED;
}
if ( IsBuildPhase() )
{
get_user_origin( id, gHookOrigins[ id ], 3 );
g_bHook[ id ] = true;
set_task( 0.1, "hook_task", id, "", 0, "ab" );
hook_task( id );
}
return PLUGIN_HANDLED;
}
public hook_off( id )
{
remove_hook( id );
return PLUGIN_HANDLED;
}
public hook_task( id )
{
if( !is_user_connected( id ) || !is_user_alive( id ) )
remove_hook( id );
remove_beam( id );
draw_hook( id );
new iOrigin[ 3 ], Float:fVelocity[ 3 ];
get_user_origin( id, iOrigin );
new iDistance = get_distance( gHookOrigins[ id ], iOrigin);
if ( iDistance > 25 )
{
fVelocity[ 0 ] = ( gHookOrigins[ id ][ 0 ] - iOrigin[ 0 ] ) * ( 2.0 * 300 / iDistance );
fVelocity[ 1 ] = ( gHookOrigins[ id ][ 1 ] - iOrigin[ 1 ] ) * ( 2.0 * 300 / iDistance );
fVelocity[ 2 ] = ( gHookOrigins[ id ][ 2 ] - iOrigin[ 2 ] ) * ( 2.0 * 300 / iDistance );
entity_set_vector( id, EV_VEC_velocity, fVelocity );
}
else
{
entity_set_vector( id, EV_VEC_velocity, Float:{0.0,0.0,0.0} );
remove_hook( id );
}
}
public draw_hook( id )
{
message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
write_byte( 1 ); // TE_BEAMENTPOINT
write_short( id ); // Entity index
write_coord( gHookOrigins[ id ][ 0 ] ); // Origin
write_coord( gHookOrigins[ id ][ 1 ] ); // Origin
write_coord( gHookOrigins[ id ][ 2 ] ); // Origin
write_short( g_iHook ); // Sprite index
write_byte( 0 ); // Start frame
write_byte( 0 ); // Framerate
write_byte( 100 ); // Life
write_byte( 10 ); // Width
write_byte( 0 ); // Noise
write_byte( random_num(0, 255) ); // Red
write_byte( random_num(0, 255) ); // Green
write_byte( random_num(0, 255) ); // Blue
write_byte( 250 ); // Brightness
write_byte( 1 ); // Speed
message_end( );
}
public remove_hook( id )
{
if( task_exists( id ) )
remove_task( id );
remove_beam(id);
g_bHook[ id ] = false;
}
public remove_beam(id)
{
message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
write_byte( 99 );
write_short( id );
message_end( );
}
stock ColorMessage( const id, const input[ ], any:... )
{
new iCount = 1, iPlayers[ 32 ];
static szMessage[ 191 ];
new iLen = formatex( szMessage, 190, "^4[%s]^1 ", g_szPrefix );
vformat( szMessage[ iLen ], 190-iLen, input, 3 );
if ( id ) iPlayers[ 0 ] = id;
else get_players( iPlayers , iCount , "ch" );
for ( new i = 0; i < iCount; i++ )
{
if ( is_user_connected( iPlayers[ i ] ) )
{
message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, iPlayers[ i ] );
write_byte( iPlayers[ i ] );
write_string( szMessage );
message_end( );
}
}
}
-
- Membru, skill 0
- Posts: 89
- Joined: 13 Aug 2018, 20:19
- Detinator Steam: Da
- CS Status: Citesc forumul eXtreamCS.com...!
- Detinator server CS: NU
- Fond eXtream: 0
- Has thanked: 5 times
- Been thanked: 1 time
- Contact:
Multumesc merge +1lexz wrote: ↑11 Feb 2021, 00:15trebuie sa ai fisierul basebuilder.inc in fisierul include al compilerului ca sa il poti compila.Code: Select all
/* Tirant Zombie Base Builder or Veco Zombie Base Builder */ #define USE_TIRANT_ZBB #include <amxmodx> #include <engine> #if defined USE_TIRANT_ZBB #include <basebuilder> #define IsBuildPhase() bb_is_build_phase() #endif #if defined USE_VECO_ZBB #include <vzbb_mod> #define IsBuildPhase() user_can_build() #endif new bool:g_bHook[ 33 ]; new gHookOrigins[ 33 ][ 3 ]; new g_iHook; new const g_szPrefix[ ] = "HOOK"; public plugin_init( ) { register_plugin( "Hook", "1.0", "One Above All" ); register_clcmd( "+hook", "hook_on" ); register_clcmd( "-hook", "hook_off" ); } public plugin_precache( ) { g_iHook = precache_model( "sprites/hook.spr" ); } public hook_on( id ) { if ( !IsBuildPhase( ) ) { ColorMessage( id, "Numai^3 in timpul de constructie poti folosi HOOK." ); return PLUGIN_HANDLED; } if ( get_user_team( id ) != 2 ) { ColorMessage( id, "Numai^3 Echipa CT poate folosi HOOK " ); return PLUGIN_HANDLED; } if ( IsBuildPhase() ) { get_user_origin( id, gHookOrigins[ id ], 3 ); g_bHook[ id ] = true; set_task( 0.1, "hook_task", id, "", 0, "ab" ); hook_task( id ); } return PLUGIN_HANDLED; } public hook_off( id ) { remove_hook( id ); return PLUGIN_HANDLED; } public hook_task( id ) { if( !is_user_connected( id ) || !is_user_alive( id ) ) remove_hook( id ); remove_beam( id ); draw_hook( id ); new iOrigin[ 3 ], Float:fVelocity[ 3 ]; get_user_origin( id, iOrigin ); new iDistance = get_distance( gHookOrigins[ id ], iOrigin); if ( iDistance > 25 ) { fVelocity[ 0 ] = ( gHookOrigins[ id ][ 0 ] - iOrigin[ 0 ] ) * ( 2.0 * 300 / iDistance ); fVelocity[ 1 ] = ( gHookOrigins[ id ][ 1 ] - iOrigin[ 1 ] ) * ( 2.0 * 300 / iDistance ); fVelocity[ 2 ] = ( gHookOrigins[ id ][ 2 ] - iOrigin[ 2 ] ) * ( 2.0 * 300 / iDistance ); entity_set_vector( id, EV_VEC_velocity, fVelocity ); } else { entity_set_vector( id, EV_VEC_velocity, Float:{0.0,0.0,0.0} ); remove_hook( id ); } } public draw_hook( id ) { message_begin( MSG_BROADCAST, SVC_TEMPENTITY ); write_byte( 1 ); // TE_BEAMENTPOINT write_short( id ); // Entity index write_coord( gHookOrigins[ id ][ 0 ] ); // Origin write_coord( gHookOrigins[ id ][ 1 ] ); // Origin write_coord( gHookOrigins[ id ][ 2 ] ); // Origin write_short( g_iHook ); // Sprite index write_byte( 0 ); // Start frame write_byte( 0 ); // Framerate write_byte( 100 ); // Life write_byte( 10 ); // Width write_byte( 0 ); // Noise write_byte( random_num(0, 255) ); // Red write_byte( random_num(0, 255) ); // Green write_byte( random_num(0, 255) ); // Blue write_byte( 250 ); // Brightness write_byte( 1 ); // Speed message_end( ); } public remove_hook( id ) { if( task_exists( id ) ) remove_task( id ); remove_beam(id); g_bHook[ id ] = false; } public remove_beam(id) { message_begin( MSG_BROADCAST, SVC_TEMPENTITY ); write_byte( 99 ); write_short( id ); message_end( ); } stock ColorMessage( const id, const input[ ], any:... ) { new iCount = 1, iPlayers[ 32 ]; static szMessage[ 191 ]; new iLen = formatex( szMessage, 190, "^4[%s]^1 ", g_szPrefix ); vformat( szMessage[ iLen ], 190-iLen, input, 3 ); if ( id ) iPlayers[ 0 ] = id; else get_players( iPlayers , iCount , "ch" ); for ( new i = 0; i < iCount; i++ ) { if ( is_user_connected( iPlayers[ i ] ) ) { message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, iPlayers[ i ] ); write_byte( iPlayers[ i ] ); write_string( szMessage ); message_end( ); } } }