SetPlayerTeam bug
#1

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.
Reply
#2

Yeah, it happens to me too.
Reply
#3

Where's SetPlayerTeam located at your script?
Reply
#4

In function to add player to fight, but it doesn't matter.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)