SetPlayerTeam bug - 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: SetPlayerTeam bug (
/showthread.php?tid=252185)
SetPlayerTeam bug -
AxL - 30.04.2011
Hello.
Function SetPlayerTeam sometimes works wrong. Players have this same team, but they may kill each other.
I made code to check what went wrong and I think this may be function bug, not gamemode.
Test-script code: (
happens in onplayerdeath)
Code:
format(str, sizeof(str),"\r\n[PlayerID] SkinID: %d | Team: %d (%d) | AddTime: %d:%02d * [KillerID] SkinID: %d | Team: %d (%d) | AddTime: %d:%02d *** RoundTime: %d:%02d | SpawnProtect: %d",
GetPlayerSkin(playerid), GetMainTeam(playerid), GetPlayerTeam(playerid), GetPVarInt(playerid, PV_ADD_MIN), GetPVarInt(playerid, PV_ADD_SEK),
GetPlayerSkin(killerid), GetMainTeam(killerid), GetPlayerTeam(killerid), GetPVarInt(killerid, PV_ADD_MIN), GetPVarInt(killerid, PV_ADD_SEK),
CzasMin, CzasSek, SpawnProtect <= 0 ? 0 : 1);
//GetMainTeam is gamemode function.
Some of results:
Quote:
[PlayerID] SkinID: 114 | Team: 2 (2) | AddTime: 6:45 * [KillerID] SkinID: 114 | Team: 2 (2) | AddTime: 7:00 *** RoundTime: 2:45 | SpawnProtect: 0
[PlayerID] SkinID: 114 | Team: 2 (2) | AddTime: 6:25 * [KillerID] SkinID: 114 | Team: 2 (2) | AddTime: 7:00 *** RoundTime: 3:49 | SpawnProtect: 0
|
Time "7:00" in killerid "AddTime" means that, player was added at round start. As You see, killed player was added later.
Re: SetPlayerTeam bug -
sabretur - 30.04.2011
Yeah, it happens to me too.
Re: SetPlayerTeam bug -
rbN. - 02.05.2011
Where's SetPlayerTeam located at your script?
Re: SetPlayerTeam bug -
AxL - 02.05.2011
In function to add player to fight, but it doesn't matter.