Getting past the SetPlayerTeam anti-teamkill bug
#1

Hey guys, my players are desperate to fly a gunship around without getting any team mates injured but they always have some glitched team mates they can team kill. After they team kill more than 3 people they get kicked and loose their killstreak.

A SA-MP moderator/beta tester said something about using OnPlayerStreamIn and SetPlayerTeam(playerid, playerid+100);

I'm not quite sure but I'm going to ask you guys how I can fix this. Would be much appreciated.
Reply
#2

my solution was: at each OnPlayerText, set the team[playerid] again. this wont waste that much CPU, and each time a player rages @ death (normal behavior imo hehe), then his team gets set again.
suggest all players to welcome a new team mate, so all will get set to the new team.
i successfully avoided friendly fire using this method.
Reply
#3

Quote:
Originally Posted by Babul
Посмотреть сообщение
my solution was: at each OnPlayerText, set the team[playerid] again. this wont waste that much CPU, and each time a player rages @ death (normal behavior imo hehe), then his team gets set again.
suggest all players to welcome a new team mate, so all will get set to the new team.
i successfully avoided friendly fire using this method.
A key binder and this method would be nasty, I wouldn't recommend on onplayertext.

Are you using setplayerteam or a variable? (from the looks of you saying team[playerid])
Reply
#4

i was using a global variable, however, after i switched to PVars, it worked aswell:
Код:
public OnPlayerText(playerid, text[]){
new Faction=GetPVarInt(playerid,"Faction");//Faction got used a lot more times...
SetPlayerTeam(playerid,Faction);//never caused problems here
i was using a colored faction tag, and some other faction-depending stuff, the onplayertext was the simplest way to implement setting the team again and again..
Reply
#5

I'll give this a bump in the next 3 days or so, posting my results regarding to this.

this should be fixed in 0.3d
Reply
#6

Quote:
Originally Posted by Babul
Посмотреть сообщение
i was using a global variable, however, after i switched to PVars, it worked aswell:
Код:
public OnPlayerText(playerid, text[]){
new Faction=GetPVarInt(playerid,"Faction");//Faction got used a lot more times...
SetPlayerTeam(playerid,Faction);//never caused problems here
i was using a colored faction tag, and some other faction-depending stuff, the onplayertext was the simplest way to implement setting the team again and again..
Bump, that still fails.

Please anyone, I'm so desperate
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)