AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved New teams (https://forums.alliedmods.net/showthread.php?t=307770)

edon1337 05-24-2018 07:52

New teams
 
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.

Natsheh 05-24-2018 10:35

Re: New teams
 
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.

edon1337 05-25-2018 06:08

Re: New teams
 
-solved-

CrazY. 05-26-2018 09:32

Re: New teams
 
Take a look at this plugin of ConnorMcLeod.

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

generalmemer 06-22-2018 17:22

Re: New teams
 
Quote:

Originally Posted by edon1337 (Post 2593609)
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.

maqi 06-23-2018 03:33

Re: New teams
 
Check for another plugin returning a different value.

generalmemer 06-23-2018 04:31

Re: New teams
 
You should show us where you set the g_iPlayerTeam values because the problem is there, its not in this code

edon1337 06-23-2018 16:15

Re: New teams
 
Quote:

Originally Posted by generalmemer (Post 2598766)
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 (Post 2598816)
Check for another plugin returning a different value.

I'm only running this plugin.

Kushfield 06-23-2018 19:42

Re: New teams
 
Quote:

Originally Posted by edon1337 (Post 2598949)
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!


HamletEagle 06-24-2018 05:02

Re: New teams
 
SetHamParamFloat in TraceAttack and Killed are wrong.


All times are GMT -4. The time now is 09:26.

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