Raised This Month: $235 Target: $400
 58% 

Solved New teams


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Traphouse
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.
__________________
Accepting paid work!

Check out my Battle Royale game-mode.
188.212.102.219:27015

Last edited by edon1337; 06-25-2018 at 14:23. Reason: solved
edon1337 is online now
Send a message via Skype™ to edon1337
Natsheh
Veteran Member
Join Date: Sep 2012
Location: Muslim and proud!
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 API MODE 100% done !
@User Tag Prefix 100% done !
@Mystery Box 100% done !

@Arena Mod 90% done !


Donate for more

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: Traphouse
Old 05-25-2018 , 06:08   Re: New teams
Reply With Quote #3

-solved-
__________________
Accepting paid work!

Check out my Battle Royale game-mode.
188.212.102.219:27015

Last edited by edon1337; 06-25-2018 at 14:24.
edon1337 is online now
Send a message via Skype™ to edon1337
CrazY.
Veteran Member
Join Date: May 2015
Location: 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
__________________
Need private work? Contact me.
Skype: crazy.770 | Steam: crazy770 | Discord: CrazY.#5317

Check my Aliens vs. Predator: 177.54.156.162:27018
CrazY. is offline
Send a message via Skype™ to CrazY.
generalmemer
Junior 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
Junior 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: Traphouse
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.
__________________
Accepting paid work!

Check out my Battle Royale game-mode.
188.212.102.219:27015

Last edited by edon1337; 06-23-2018 at 16:16.
edon1337 is online now
Send a message via Skype™ to edon1337
Kushfield
Junior Member
Join Date: Jan 2017
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 online now
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 06:15.


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