SA-MP Forums Archive
Getting past the SetPlayerTeam anti-teamkill bug - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Getting past the SetPlayerTeam anti-teamkill bug (/showthread.php?tid=285329)



Getting past the SetPlayerTeam anti-teamkill bug - Lorenc_ - 23.09.2011

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.


Re: Getting past the SetPlayerTeam anti-teamkill bug - Babul - 23.09.2011

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.


Re: Getting past the SetPlayerTeam anti-teamkill bug - Lorenc_ - 23.09.2011

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])


Re: Getting past the SetPlayerTeam anti-teamkill bug - Babul - 23.09.2011

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


Re: Getting past the SetPlayerTeam anti-teamkill bug - Lorenc_ - 23.09.2011

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


Re: Getting past the SetPlayerTeam anti-teamkill bug - Lorenc_ - 26.09.2011

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