View Issue Details

IDProjectCategoryView StatusLast Update
0005947New Feature Requests[All Projects] Generalpublic2017-06-18 20:57
ReporterBoberAssigned To 
Status newResolutionopen 
Summary0005947: [Request] onTeamChange

Event onTeamChange
ARG: player, old Team,New team

TagsNo tags attached.


related to 0007049 closed Source patches Patch for on(Client)PlayerTeamChange events 
has duplicate 0006510 closed New issues Events like onTeamCreate/onTeamDestroy and onPlayerTeamChange 



2011-02-26 22:30

viewer   ~~0012999

IMHO: can be scriptable with small timer


2011-02-26 23:12

manager   ~~0013000

Last edited: 2011-02-26 23:14

From what i've seen on google code adding new events isn't very hard, would be a lot more efficient than a constantly running timer checking everybodies team.

I'm suprised that it wasn't already added because a player changing team is quite a significant event and many scripts might change things when a player changes team.


2011-02-26 23:18

viewer   ~~0013001

Last edited: 2011-02-26 23:20

LOL! a small timer :P
When you really want the event "onTeamChange" you might use this snippet. There's no timer or things like that needed and the functions can be as they are :D

_setPlayerTeam = setPlayerTeam
addEvent ("onTeamChange",true)
function setPlayerTeam(player,team)
local old = getPlayerTeam (player)
local bool = _setPlayerTeam (player,team)
if (bool) then
triggerEvent ("onTeamChange",player,old,team)
return bool

You can just paste it in a file in the resource where you want to use this.
Good luck:D

The source is the player, the parameters are (old team, new team)


2011-03-05 01:36

administrator   ~~0013029

We tend to go by the logic that events that happen soley via script should not be provisioned for unless there are exceptional circumstances.

In other words, we shouldnt have onPlayerSetPosition, or onPlayerGivenWeapon etc.


2011-03-07 08:37

viewer   ~~0013034

What is with: onVehicleDamage when shooting the tires?

Issue History

Date Modified Username Field Change