Raised This Month: $32 Target: $400
 8% 

Help Plugin slayteam


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Hytman
Member
Join Date: Oct 2013
Old 01-14-2018 , 17:11   Help Plugin slayteam
Reply With Quote #1

I have found this plugin slayteam and i want if is possible to make it to slay only normal players without admins,because now is working but is slaying all players incliding admins,can someone add in this .sma the exception to not slay the admins please!?

Quote:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "CFG SlayTeam"
#define VERSION "1.0"
#define AUTHOR "aNNakin"

// - - - - - - - -
new const g_Command[ ] = "amx_slayteam";
new const g_Arguments[ 3 ][ ] = { "@All", "@T", "@CT" };
new const g_Names[ 3 ][ 32 ] = { "All players", "Terrorists", "Counter-Terrorists" };

new const thunder_sound[] = "ambience/thunder_clap.wav";

#define EXPLODE
// - - - - - - - -

new g_CommandHelp[ 64 ];
new g_MaxPlayers, g_MsgSayText, g_MsgClCorpse, g_CvarPointer;
new g_Lightning, g_Smoke;

public plugin_init ( )
{
register_plugin ( PLUGIN, VERSION, AUTHOR );

for ( new i; i < 3; i++ )
( g_CommandHelp[ 0 ] )
?
format ( g_CommandHelp, charsmax ( g_CommandHelp ), "%s/%s", g_CommandHelp, g_Arguments[ i ] )
:
copy ( g_CommandHelp, charsmax ( g_CommandHelp ), g_Arguments[ i ] );

register_concmd ( g_Command, "slayteam_cmd", ADMIN_SLAY, g_CommandHelp );
format ( g_CommandHelp, charsmax ( g_CommandHelp ), "%s %s", g_Command, g_CommandHelp );

g_CvarPointer = get_cvar_pointer ( "amx_show_activity" );
g_MsgClCorpse = get_user_msgid ( "ClCorpse" );
g_MsgSayText = get_user_msgid ( "SayText" );
g_MaxPlayers = get_maxplayers ( );
}

public plugin_precache ( )
{
precache_sound ( thunder_sound );
g_Lightning = precache_model ( "sprites/lgtning.spr" );
g_Smoke = precache_model ( "sprites/steam1.spr" );
}

public slayteam_cmd ( id, level, cid )
{
if ( ! cmd_access ( id, level, cid, 2 ) )
return PLUGIN_HANDLED;

new s_Arg[ 5 ], i_Param;
read_argv ( 1, s_Arg, charsmax ( s_Arg ) );

for ( i_Param = 0; i_Param < 3; i_Param++ )
if ( equali ( s_Arg, g_Arguments[ i_Param ] ) )
break;

if ( i_Param == 3 )
{
console_print ( id, "Usage: %s", g_CommandHelp );
return PLUGIN_HANDLED;
}

set_msg_block ( g_MsgClCorpse, BLOCK_SET );

new i_Origin[ 3 ], i_Pos[ 3 ], i_Done;

for ( new i_Index = 1; i_Index <= g_MaxPlayers; i_Index++ )
{
if ( ! is_user_alive ( i_Index ) )
continue;
if ( i_Index == id )
continue;
if ( i_Param && get_user_team ( i_Index ) != i_Param )
continue;

#if defined EXPLODE
get_user_origin ( i_Index, i_Origin );
i_Origin[ 2 ] -= 26;
i_Pos[ 0 ] = i_Origin[ 0 ] + 150;
i_Pos[ 1 ] = i_Origin[ 1 ] + 150;
i_Pos[ 2 ] = i_Origin[ 2 ] + 800;



Thunder ( i_Pos, i_Origin );
Smoke ( i_Origin, 10, 10 );
Blood ( i_Origin );
#endif

user_silentkill ( i_Index );
i_Done = 1;
}

set_msg_block ( g_MsgClCorpse, BLOCK_NOT );

i_Done
?
ShowActivity ( id, g_Names[ i_Param ] )
:
console_print ( id, "No players in team %s", g_Names[ i_Param ] );

return PLUGIN_HANDLED;
}

Blood ( iorigin[ 3 ] )
{
message_begin ( MSG_BROADCAST, SVC_TEMPENTITY );
write_byte ( TE_LAVASPLASH );
write_coord ( iorigin[ 0 ] );
write_coord ( iorigin[ 1 ] );
write_coord ( iorigin[ 2 ] );
message_end ( );
}

Smoke ( iorigin[ 3 ], scale, framerate )
{
message_begin ( MSG_BROADCAST, SVC_TEMPENTITY );
write_byte ( TE_SMOKE );
write_coord ( iorigin[ 0 ] );
write_coord ( iorigin[ 1 ] );
write_coord ( iorigin[ 2 ] );
write_short ( g_Smoke );
write_byte ( scale );
write_byte ( framerate );
message_end ( );
}

Thunder ( start[ 3 ], end[ 3 ] )
{
message_begin ( MSG_BROADCAST, SVC_TEMPENTITY );
write_byte ( TE_BEAMPOINTS );
write_coord ( start[ 0 ] );
write_coord ( start[ 1 ] );
write_coord ( start[ 2 ] );
write_coord ( end[ 0 ] );
write_coord ( end[ 1 ] );
write_coord ( end[ 2 ] );
write_short ( g_Lightning );
write_byte ( 1 );
write_byte ( 5 );
write_byte ( 7 );
write_byte ( 20 );
write_byte ( 30 );
write_byte ( 200 );
write_byte ( 200 );
write_byte ( 200 );
write_byte ( 200 );
write_byte ( 200 );
message_end ( );

message_begin ( MSG_PVS, SVC_TEMPENTITY, end );
write_byte ( TE_SPARKS );
write_coord ( end[ 0 ] );
write_coord ( end[ 1 ]);
write_coord ( end[ 2 ] );
message_end ( );

emit_sound ( 0 ,CHAN_ITEM, thunder_sound, 1.0, ATTN_NORM, 0, PITCH_NORM );
}

ShowActivity ( e_Admin, s_Argument[ ] )
{
new i_Value = get_pcvar_num ( g_CvarPointer );
if ( ! i_Value )
return 0;

new s_Buffer[ 128 ], s_AdminName[ 32 ];
get_user_name ( e_Admin, s_AdminName, 31 );

formatex ( s_Buffer, charsmax ( s_Buffer ), "ADMIN %s: Slay %s", ( i_Value == 1 ) ? "" : s_AdminName, s_Argument );
log_amx ( s_Buffer );

for ( new i_Index = 1; i_Index <= g_MaxPlayers; i_Index++ )
{
if ( ! is_user_connected ( i_Index ) )
continue;

message_begin ( MSG_ONE, g_MsgSayText, _, i_Index );
write_byte ( i_Index );
write_string ( s_Buffer );
message_end ( );
}

return 1;
}
Hytman is offline
Hytman
Member
Join Date: Oct 2013
Old 01-16-2018 , 00:03   Re: Help Plugin slayteam
Reply With Quote #2

UP?
Hytman is offline
DjSoftero
Veteran Member
Join Date: Nov 2014
Location: Lithuania
Old 01-16-2018 , 01:30   Re: Help Plugin slayteam
Reply With Quote #3

do not bump the thread unless 2 weeks have passed
__________________
retired chump
DjSoftero is offline
Hytman
Member
Join Date: Oct 2013
Old 02-19-2018 , 07:34   Re: Help Plugin slayteam
Reply With Quote #4

UP?
Hytman is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 02-19-2018 , 08:05   Re: Help Plugin slayteam
Reply With Quote #5

Somewhere on a "for" loop, you must add if (!is_user_admin(id)) continue;
__________________

Last edited by Relaxing; 02-19-2018 at 08:06.
Relaxing is offline
Hytman
Member
Join Date: Oct 2013
Old 03-01-2018 , 16:27   Re: Help Plugin slayteam
Reply With Quote #6

UP?
Hytman is offline
Hytman
Member
Join Date: Oct 2013
Old 03-29-2018 , 08:35   Re: Help Plugin slayteam
Reply With Quote #7

UP?
Hytman is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 03-29-2018 , 09:49   Re: Help Plugin slayteam
Reply With Quote #8

It's just copy and pasting a line and you are still looking for help.
__________________
Relaxing is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:13.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode