AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   [Req] Simple Slay on Team Kill (https://forums.alliedmods.net/showthread.php?t=215920)

thebro 05-13-2013 23:30

[Req] Simple Slay on Team Kill
 
Hello. I tried ATAC, idk if its possible for it to automatically Slay instead of showing a menu.
Or if Restricting "Forgive" is possible.

Either way I am looking for a simple Slay on Teamkill.
For example,

"Player kills Teammate"
Slay player and play sound "bo/slay.wav"

Player kills a total of 3 teammates
Kick player and play sound to server "bo/kick.wav"


Please and thankyou!

Blizzard_87 05-13-2013 23:38

Re: [Req] Simple Slay on Team Kill
 
how many times can player TK before kick...?

thebro 05-13-2013 23:58

Re: [Req] Simple Slay on Team Kill
 
I'm sorry, i forgot to put that.

Player can TK 3 times, then kick.

Blizzard_87 05-14-2013 00:09

Re: [Req] Simple Slay on Team Kill
 
try this havent tested fully as im at work atm.

Code:
/*     Blizzards Plugins Comply With GNU General Public License     TK Punish is free software: you can redistribute it and/or modify     it under the terms of the GNU General Public License as published by     the Free Software Foundation, either version 3 of the License, or     (at your option) any later version.         Under no circumstances are you allowed to redistribute and/or modify     it claming that you are the original author of such plugin/modification.         TK Punish is distributed in the hope that it will be useful,     but WITHOUT ANY WARRANTY; without even the implied warranty of     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the     GNU General Public License for more details.         You should have received a copy of the GNU General Public License     along with this program.  If not, see <http://www.gnu.org/licenses/>.     */ #include < amxmodx > #include < amxmisc > #include < fun > #include < cstrike > #pragma semicolon 1 #define PLUGIN "TK Punish" #define VERSION "1.0" #define AUTHOR "Blizzard" new g_iTkCount[ 33 ]; new g_iTkTotal; new g_sSlay[] = { "bo/slay" }; new g_sKick[] = { "bo/kick" }; public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR);         register_event( "DeathMsg", "Event_DeathMsg", "a" );         g_iTkTotal = register_cvar( "amx_tk_total", "3" ); } public plugin_precache() {     precache_sound( g_sKick );     precache_sound( g_sSlay ); } public client_connect( id ) g_iTkCount[ id ] = 0; public Event_DeathMsg() {     new iKiller = read_data( 1 );     new iVictim = read_data( 2 );         new TkTotal = get_pcvar_num( g_iTkTotal );         if( iVictim != iKiller )     {         if( cs_get_user_team( iKiller ) == cs_get_user_team( iVictim ) )         {             if( g_iTkCount[ iKiller ] >= TkTotal )             {                 set_task( 5.0, "KickTKiller", iKiller );                 client_cmd( 0, "spk %s", g_sKick );             }             else {                 user_silentkill( iKiller );                 client_cmd( 0, "spk %s", g_sSlay );                 g_iTkCount[ iKiller ]++;             }         }     } } public KickTKiller( id ) {     server_cmd( "kick #%i ^"You Killed To Many Players On Your Team!^"", get_user_userid(id) ); }

thebro 05-14-2013 00:10

Re: [Req] Simple Slay on Team Kill
 
Will do, Thanks in advance!
I'll let you know how it goes

thebro 05-14-2013 00:16

Re: [Req] Simple Slay on Team Kill
 
The Slay works. But I think CSDM is conflicting with it. The Player won't respond.
Sorry if I didn't mention CSDM is being used.

Is it possible to respawn the player? And if so, can it be a 10 Second delay?

Blizzard_87 05-14-2013 00:44

Re: [Req] Simple Slay on Team Kill
 
Quote:

Originally Posted by thebro (Post 1951600)
The Slay works. But I think CSDM is conflicting with it. The Player won't respond.
Sorry if I didn't mention CSDM is being used.

Is it possible to respawn the player? And if so, can it be a 10 Second delay?

I can add a respawn after 10 seconds once get on my computer.

thebro 05-14-2013 01:43

Re: [Req] Simple Slay on Team Kill
 
Thankyou very much!

Blizzard_87 05-14-2013 06:37

Re: [Req] Simple Slay on Team Kill
 
ok got it working respawning the team attacker but, does your current plugin respawn the player that the TK attacked?

Code:
/*     Blizzards Plugins Comply With GNU General Public License     TK Punish is free software: you can redistribute it and/or modify     it under the terms of the GNU General Public License as published by     the Free Software Foundation, either version 3 of the License, or     (at your option) any later version.         Under no circumstances are you allowed to redistribute and/or modify     it claming that you are the original author of such plugin/modification.         TK Punish is distributed in the hope that it will be useful,     but WITHOUT ANY WARRANTY; without even the implied warranty of     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the     GNU General Public License for more details.         You should have received a copy of the GNU General Public License     along with this program.  If not, see <http://www.gnu.org/licenses/>.     */ #include < amxmodx > #include < amxmisc > #include < fun > #include < cstrike > #include < hamsandwich > #pragma semicolon 1 #define PLUGIN "TK Punish" #define VERSION "1.0" #define AUTHOR "Blizzard" #define TASK_COUNTDOWN 123456 new g_iTkCount[ 33 ]; new g_iTkTotal; new g_iTimer; new REVIVE_TIME; new g_sSlay[] = { "bo/slay" }; new g_sKick[] = { "bo/kick" }; public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR);         register_event( "DeathMsg", "Event_DeathMsg", "a" );         g_iTkTotal = register_cvar( "amx_tk_total", "3" );     REVIVE_TIME = register_cvar( "amx_tk_revivetime", "10" ); } public plugin_precache() {     precache_sound( g_sKick );     precache_sound( g_sSlay ); } public client_connect( id ) g_iTkCount[ id ] = 0; public Event_DeathMsg() {     new iKiller = read_data( 1 );     new iVictim = read_data( 2 );         new TkTotal = get_pcvar_num( g_iTkTotal );         if( iVictim != iKiller )     {         if( cs_get_user_team( iKiller ) == cs_get_user_team( iVictim ) )         {             if( g_iTkCount[ iKiller ] > TkTotal )             {                 set_task( 5.0, "KickTKiller", iKiller );                 client_cmd( 0, "spk %s", g_sKick );             }             else {                 user_silentkill( iKiller );                 g_iTimer = ( get_pcvar_num( REVIVE_TIME ) + 1 );                 ReviveCountdown( iKiller );                 client_cmd( 0, "spk %s", g_sSlay );                 g_iTkCount[ iKiller ]++;             }         }     } } public ReviveCountdown(id) {       --g_iTimer;         set_hudmessage(random(256), random(256), random(256), -1.0,-1.0, 1, 6.0, 1.0, 0.0, 0.0);     if( g_iTimer == 0 )     {         show_hudmessage( id, "FIGHT!!!");                 ExecuteHamB( Ham_CS_RoundRespawn, id );                 remove_task(TASK_COUNTDOWN);                 g_iTimer = ( get_pcvar_num( REVIVE_TIME ) + 1 );                 return;     }         show_hudmessage( id, "Respawn In %i Second(s)", g_iTimer);         set_task(1.0, "ReviveCountdown", id); } public KickTKiller( id ) {     server_cmd( "kick #%i ^"You Killed To Many Players On Your Team!^"", get_user_userid(id) ); }

try this out... it respawns team killer after 10 secs

editable from cvar
Code:
 amx_tk_revivetime "10"

thebro 05-14-2013 14:52

Re: [Req] Simple Slay on Team Kill
 
I'll try this when I get home, looks promising!
And the CSDM does respawn players but not when they TK.
The respawn feature you made should fix the problem :)

And the cvar thing is a perfect addition! Customizable!!


All times are GMT -4. The time now is 23:05.

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