SA-MP Forums Archive
Anti teamkill - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP (https://sampforum.blast.hk/forumdisplay.php?fid=3)
+--- Forum: Bug Reports (https://sampforum.blast.hk/forumdisplay.php?fid=20)
+--- Thread: Anti teamkill (/showthread.php?tid=139561)



Anti teamkill - Mikep. - 05.04.2010

3 players, Mike Danny and Sonny.

Mike shoots Sonny and Danny - they take no damage
Danny or Sonny shoots Mike - Mike takes damge

Our team is 1, all 3 of us are in team 1.


Re: Anti teamkill - Burridge - 05.04.2010

That bugs been there since...like forever...afaik


Re: Anti teamkill - Jay_ - 08.04.2010

Can't reproduce.


Re: Anti teamkill - DeadalusNetwork - 08.04.2010

Tried to code it , works sometimes , but the bug goes through few times.


Re: Anti teamkill - Grim_ - 09.04.2010

Quote:
Originally Posted by Burridge
That bugs been there since...like forever...afaik
What Burridge said.

It seems after a few seconds the SetPlayerTeam gets reset or something. Just make a timer every 10 or so seconds to reset the players team.


Re: Anti teamkill - Jay_ - 09.04.2010

Code:
#include <a_samp>

public OnGameModeInit()
{
  AddPlayerClass(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); // required
}

public OnPlayerSpawn(playerid)
{
  SetPlayerTeam(playerid, 1);
}
Works fine.


Re: Anti teamkill - Rac3r - 10.04.2010

I threw up a quick DM mode and tried it out.

No timer, only SetPlayerTeam when they spawn (about 25/30 players)
Sometimes was able to team kill with a deagle, very rarely. People at spawn trying to kill each other, but failing. The odd team kill seen in deathbox.

Timer to update SetPlayerTeam every second (about 10/15 players)
Not one team kill that I know of.


Re: Anti teamkill - Mikep. - 10.04.2010

But GetPlayerTeam was returning 1 for all 3 of us?


Re: Anti teamkill - Tenshi - 13.04.2010

Quote:
Originally Posted by Mikep.
3 players, Mike Danny and Sonny.

Mike shoots Sonny and Danny - they take no damage
Danny or Sonny shoots Mike - Mike takes damge

Our team is 1, all 3 of us are in team 1.
Conformed, Have a TDM server for other past 2 to 3 years with coding changed @ 0.3.

Anti TK works 90% of the time, the more players, the more likely for a TK, but it cannot be produced and its, in a way rare but frequent thing.


Re: Anti teamkill - Sergei - 13.04.2010

If you set team with AddClassEx or SetSpawnInfo, you will get proper team with GetPlayerTeam, but anti-team kill won't work. You need to re-apply team under OnPlayerSpawn. Also if you set team during gameplay and then die, you will stay in the same team, but anti-team kill won't be activated anymore after spawn.


Re: Anti teamkill - Mikep. - 13.04.2010

Team is set to 1 in both OnPlayerConnect and OnPlayerSpawn, still doesn't work. Should I use AddPlayerClassEx then?