Raised This Month: $ Target: $400
 0% 

is this possible?(solved)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
2inspyr
SourceMod Donor
Join Date: Dec 2004
Old 06-04-2008 , 13:01   is this possible?(solved)
Reply With Quote #1

im just wondering is it possible to block the "blah blah Attacked a Teammate" & "blah blah killed a teammate" messages when a player injures/kills a teammate, and is it also possible to turn the "-1 kill" on the scoreboard for a TK into a "+1 kill" for killing a teammate. sound like odd requests, but its for a little somthing im working on.

this is for CS 1.6

any help is aprreciated, i have looked around, maybe im searching the wrong terms, but i havent come across anything like this as yet.

Regards
2inspyr
__________________
hmmms........

Last edited by 2inspyr; 06-05-2008 at 18:28. Reason: typos :S...
2inspyr is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-04-2008 , 15:32   Re: is this possible?
Reply With Quote #2

Quote:
and is it also possible to turn the "-1 kill" on the scoreboard for a TK into a "+1 kill" for killing a teammate.
Not sure to understand. Players who kill a teammate will gain 1 frag instead of losing one. Are you sure ?
__________________
Arkshine is offline
2inspyr
SourceMod Donor
Join Date: Dec 2004
Old 06-04-2008 , 15:35   Re: is this possible?
Reply With Quote #3

yeah thats correct sounds odd i know, but its for a mod im working on, ive got everything else working fine an dandy, except for the kills and block the screen msgs

ok i did some more looking around it seems i didnt look hard enough

i could possibly create a function that is called upon a Teamkill and use:

get_user_frags(id)

and then use:

set_user_frags(id)

ie. get their frags, then +2 frags onto thier scrore (+2 because they would lose a kill for the Teamkill)

unless someone could think of a better way?? as i cant really prethink a teamkill id have to add to the score after the teamkill frag was taken.

now to block the messages if thats possible



Regards
2inspyr
__________________
hmmms........

Last edited by 2inspyr; 06-04-2008 at 16:00.
2inspyr is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-04-2008 , 16:35   Re: is this possible?
Reply With Quote #4

First request :

Code:
    #include <amxmodx>         new gi_FriendlyFire;         public plugin_init ()     {         register_plugin ( "Block Attack/Kill Teammates Messages", "1.0.0", "Arksine" );                 gi_FriendlyFire = get_cvar_pointer ( "mp_friendlyfire" );                 if ( !get_pcvar_num ( gi_FriendlyFire ) )         {             pause ( "ad" );             return;         }                 register_message ( get_user_msgid ( "TextMsg" ), "m_TextMsg" );     }         public m_TextMsg ( msg_id, msg_type, msg_id )     {         if ( get_msg_arg_int ( 1 ) == print_notify )         {             return PLUGIN_CONTINUE;         }             static s_Message[ 22 ];         get_msg_arg_string  ( 2, s_Message, charsmax ( s_Message ) );                 if ( equal ( s_Message, "#Game_teammate_attack" ) || equal ( s_Message, "#Killed_Teammate" ) || equal ( s_Message, "#Game_teammate_kills" ) )         {             return PLUGIN_HANDLED;         }                 return PLUGIN_CONTINUE;     }         /* -- Informations --             s_Message = #Game_teammate_attack | print_chat         s_Message = #Killed_Teammate      | print_center         s_Message = #Game_teammate_kills  | print_console     */

Second request :

Code:
      #include <amxmodx>     #include <fakemeta>         #define FRAGS_TO_ADD 1         new gi_FriendlyFire;         #define MAX_CLIENTS 32     new bool:gb_TeamKill[ MAX_CLIENTS + 1 ];         public plugin_init ()     {         register_plugin ( "Teamkill Frag", "1.0.0", "Arksine" );                 gi_FriendlyFire = get_cvar_pointer ( "mp_friendlyfire" );                 if ( !get_pcvar_num ( gi_FriendlyFire ) )         {             pause ( "ad" );             return;         }                 register_event ( "DeathMsg", "e_DeathMsg", "a" );         register_message ( get_user_msgid ( "ScoreInfo" ), "m_ScoreInfo" );     }             public client_putinserver ( id )     {         gb_TeamKill[ id ] = false;     }         public m_ScoreInfo ( msg_id, msg_type, msg_id )     {         new id = get_msg_arg_int ( 1 );           if ( gb_TeamKill[ id ] )         {             gb_TeamKill[ id ] = false;             new i_CurrentFrag = get_msg_arg_int ( 2 );                         i_CurrentFrag += FRAGS_TO_ADD + 1;                         set_pev ( id, pev_frags, i_CurrentFrag * 1.0 );             set_msg_arg_int ( 2, ARG_SHORT, i_CurrentFrag );         }     }         public e_DeathMsg ()     {           new i_Killer = read_data ( 1 );         new i_Victim = read_data ( 2 );                 if ( get_user_team ( i_Killer ) == get_user_team ( i_Victim ) )         {             gb_TeamKill[ i_Killer ] = true;         }     }

For the second I'm trying to find another way ( register_message() for example ).
__________________

Last edited by Arkshine; 06-04-2008 at 18:36.
Arkshine is offline
2inspyr
SourceMod Donor
Join Date: Dec 2004
Old 06-04-2008 , 16:43   Re: is this possible?
Reply With Quote #5

woah, ok, thats awsome, ill test those out today and let you know how they go. Thanks for doing that it would have taken me ages to write those up as i dont do alot of amxx stuff

++KARMA
__________________
hmmms........
2inspyr is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 06-04-2008 , 17:39   Re: is this possible?
Reply With Quote #6

arkshine, does that frag adding method work with stats?
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-04-2008 , 17:42   Re: is this possible?
Reply With Quote #7

Quote:
does that frag adding method work with stats?
Sorry, v3x, I don't understand well what you mean.

By the way, it should MSG_ALL. I'm testing...
__________________

Last edited by Arkshine; 06-04-2008 at 18:02.
Arkshine is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-04-2008 , 18:22   Re: is this possible?
Reply With Quote #8

@2inspyr : I found a better way for your second request. See above. ( well it avoids just sending another message to update the frags )
__________________

Last edited by Arkshine; 06-04-2008 at 18:27.
Arkshine is offline
Vet
Veteran Member
Join Date: Jul 2006
Location: I|O wa
Old 06-04-2008 , 21:43   Re: is this possible?
Reply With Quote #9

You can also stop the TK/TA messages by editing the client_damage and client_death routines in the stats.sma. Just comment out the applicable client_print statements.
__________________
=====================================
- My Plugins -
=====================================
Vet is offline
Send a message via MSN to Vet
2inspyr
SourceMod Donor
Join Date: Dec 2004
Old 06-05-2008 , 14:13   Re: is this possible?
Reply With Quote #10

thank you arkshine for that code it worked a treat. I had to mod it a little to get it work in with the rest of my current coding, but it all works well.

the stats though could be a problem, as v3x mentioned, it does take away from your stats when you team kill, ratios drop. I will adress this issue at a later date and figure out a work around, but for now, for a beta it does what i need it to do.

Regards
2inspyr
__________________
hmmms........

Last edited by 2inspyr; 06-06-2008 at 03:04.
2inspyr 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 05:12.


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