Raised This Month: $12 Target: $400
 3% 

Solved [CSTRIKE] team kill positive fragging


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Natsheh
Veteran Member
Join Date: Sep 2012
Old 02-07-2021 , 10:36   [CSTRIKE] team kill positive fragging
Reply With Quote #1

how to change team kill to a positive fragging instead of getting -1 kill.

I'm searching for an efficient method to use .
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 02-07-2021 at 11:35.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
SpliN
Junior Member
Join Date: Jun 2020
Location: Egypt
Old 02-07-2021 , 10:50   Re: [CSTRIKE] team kill positive fragging
Reply With Quote #2

Quote:
Originally Posted by Natsheh View Post
how to change team kill to a positive fragging instead of getting -1 kill.

I'm searching for an efficient method to use .
try this bro notice i am newbie in the amxmodx
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fun>

#define PLUGIN "team kill"
#define VERSION "1.0"
#define AUTHOR "SpliN"

public plugin_init() {
    
    
register_event"DeathMsg""Death""a" )
    
}

public 
Death(id
{
    new 
teamkiller[35],teamvictim[35]
    new 
killerid read_data(1)
    new 
victimid read_data(2)
    new 
killerfrags get_user_frags(killerid)
    
get_user_team(killerid,teamkiller,charsmax(teamkiller))
    
get_user_team(victimid,teamkiller,charsmax(teamvictim))
    
    if(
equali(teamkiller,teamvictim))
    {
        
set_user_frags(killerid,killerfrags 2)
    
    }

SpliN is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 02-07-2021 , 11:09   Re: [CSTRIKE] team kill positive fragging
Reply With Quote #3

yup this method is the one i am trying to avoid.



SOLVED :>

PHP Code:
new g_iMaxplayersg_iUSER_KILLS[33];

public 
plugin_init()
{
   
RegisterHam(Ham_Killed"player""fw_player_killed_post"1);
   
register_message(get_user_msgid("ScoreInfo"), "fw_message_scoreinfo");
   
g_iMaxplayers  get_maxplayers();
}

public 
fw_player_killed_post(victimkillergib)
{
    if( ( 
<= iKiller <= g_iMaxplayers ) && iKiller != iVictim )
    {
        
g_iUSER_KILLS[iKiller] ++;
        
set_user_frags(iKillerg_iUSER_KILLS[iKiller]);
        
                
// sometimes the scoreboard doesn't get updated with the correct frags.
        
message_begin(MSG_ALLget_user_msgid("ScoreInfo"), _0);
        
write_byte(iKiller);
        
write_short(g_iUSER_KILLS[iKiller]);
        
write_short(get_user_deaths(iKiller));
        
write_short(0);
        
write_short(get_user_team(iKiller));
        
message_end();
    }
}

public 
fw_message_scoreinfo(msgiddestid)
{
    new 
target get_msg_arg_int);
    
    
set_msg_arg_intARG_SHORTg_iUSER_KILLS[target]);
}

public 
client_disconnect(idg_iUSER_KILLS[id] = 0
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 02-07-2021 at 11:36.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
SpliN
Junior Member
Join Date: Jun 2020
Location: Egypt
Old 02-07-2021 , 13:03   Re: [CSTRIKE] team kill positive fragging
Reply With Quote #4

worked for u my way to acheive what u want
SpliN is offline
SpliN
Junior Member
Join Date: Jun 2020
Location: Egypt
Old 02-07-2021 , 13:13   Re: [CSTRIKE] team kill positive fragging
Reply With Quote #5

i think two codes are the same but used different things
SpliN is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-07-2021 , 13:34   Re: [CSTRIKE] team kill positive fragging
Reply With Quote #6

They do the same thing in different ways, where you add 2 kills for only TK while his code always gives + 1 for any kill.

Your code can be cleaned up a bit:
PHP Code:
public Death(id
{
    new 
killerid read_data)
    new 
victimid read_data)
    
    if ( 
is_user_connectedkillerid ) && ( cs_get_user_teamkillerid ) != cs_get_user_teamvictimid ) ) )
    {
        
set_user_fragskillerid get_user_fragskillerid ) + )
    }

__________________
Bugsy is offline
SpliN
Junior Member
Join Date: Jun 2020
Location: Egypt
Old 02-07-2021 , 15:18   Re: [CSTRIKE] team kill positive fragging
Reply With Quote #7

when he kill his friend he will get -1 then you should add 1 for remove -1 then add 1 to make him get a frags to make the kill positive
SpliN is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-07-2021 , 16:59   Re: [CSTRIKE] team kill positive fragging
Reply With Quote #8

He is keeping a count of kills in a variable and then using that value to set the kill count & scoreboard, so it doesn't matter how many kills the game gives, or takes away.
__________________
Bugsy is offline
SpliN
Junior Member
Join Date: Jun 2020
Location: Egypt
Old 02-07-2021 , 17:28   Re: [CSTRIKE] team kill positive fragging
Reply With Quote #9

ah ok thanks bugsy
bro i have problem with zp 6.2 ultimatex by sidewinder i fixed the tag and i need help in teambugfix
SpliN is offline
Reply


Thread Tools
Display Modes

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 04:07.


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