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

Solved New teams


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 05-24-2018 , 07:52   New teams
Reply With Quote #1

I'm having trouble fixing this code, I want that friendlyfire to be forbidden. Right now, if I'm CT, I can only kill T players (default gameplay), but I don't want the CT&T teams to matter, only g_iPlayerTeam variable.
So basically, if I'm CT and someone from T is in team with me, I can't kill him, but I can kill the rest of the CT players that aren't in my team.

I haven't scripted for a long time so I might be missing something, thanks to whoever helps.
__________________

Last edited by edon1337; 06-25-2018 at 14:23. Reason: solved
edon1337 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 05-24-2018 , 10:35   Re: New teams
Reply With Quote #2

PHP Code:
         if( iVictimTeam == get_user_teamiAttacker ) )
        {
            
cs_set_user_teamiVictimiVictimTeam == );
            
ExecuteHamBHam_TakeDamageiVictimiInflictoriAttackerfDamageiDamageBits );
            
cs_set_user_teamiVictimiVictimTeam );
            return 
HAM_SUPERCEDE;
        } 
Do the same for trace attack and killed forwards.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 05-24-2018 at 10:35.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 05-25-2018 , 06:08   Re: New teams
Reply With Quote #3

-solved-
__________________

Last edited by edon1337; 06-25-2018 at 14:24.
edon1337 is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 05-26-2018 , 09:32   Re: New teams
Reply With Quote #4

Take a look at this plugin of ConnorMcLeod.

https://forums.alliedmods.net/showthread.php?p=711129
__________________








CrazY. is offline
generalmemer
Member
Join Date: Sep 2017
Old 06-22-2018 , 17:22   Re: New teams
Reply With Quote #5

Quote:
Originally Posted by edon1337 View Post
but I don't want the CT&T teams to matter, only g_iPlayerTeam native.
So what's the issue here? Because I tested it (post #3) with bots and everything worked fine.
Teams didn't matter and you could only kill a player that has different g_iPlayerTeam value.
generalmemer is offline
maqi
Senior Member
Join Date: Apr 2017
Location: Serbia
Old 06-23-2018 , 03:33   Re: New teams
Reply With Quote #6

Check for another plugin returning a different value.
__________________
stuff
maqi is offline
generalmemer
Member
Join Date: Sep 2017
Old 06-23-2018 , 04:31   Re: New teams
Reply With Quote #7

You should show us where you set the g_iPlayerTeam values because the problem is there, its not in this code
generalmemer is offline
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 06-23-2018 , 16:15   Re: New teams
Reply With Quote #8

Quote:
Originally Posted by generalmemer View Post
So what's the issue here? Because I tested it (post #3) with bots and everything worked fine.
Teams didn't matter and you could only kill a player that has different g_iPlayerTeam value.
How come that only works for you? I just tested it and I couldn't kill neither of my real teammates. Tested multiple times. Are you sure you tested it?

Quote:
Originally Posted by maqi View Post
Check for another plugin returning a different value.
I'm only running this plugin.
__________________

Last edited by edon1337; 06-23-2018 at 16:16.
edon1337 is offline
Kushfield
Member
Join Date: Jan 2017
Location: Estonia
Old 06-23-2018 , 19:42   Re: New teams
Reply With Quote #9

Quote:
Originally Posted by edon1337 View Post
How come that only works for you? I just tested it and I couldn't kill neither of my real teammates. Tested multiple times. Are you sure you tested it?
Perhaps because the rest of the code is different?
I tried the exact code you posted with a simple command added to change players' teams and it worked just fine for me as well, aside from
Code:
L 06/24/2018 - 01:39:19: [HAMSANDWICH] Wrong data type (data is of type entity)
L 06/24/2018 - 01:39:19: [AMXX] Run time error 10 (plugin "customteamsthing.amxx") (native "SetHamParamFloat") - debug not enabled!

Last edited by Kushfield; 06-23-2018 at 19:56.
Kushfield is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-24-2018 , 05:02   Re: New teams
Reply With Quote #10

SetHamParamFloat in TraceAttack and Killed are wrong.
__________________
HamletEagle 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 09:21.


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