• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Please add Event
#1
Question 
Hi, can Devs add OnChangeTeam ?
The more functionality of the application the greater the chance of errors.
  Reply
#2
(09-10-2012, 00:43)Nerus Wrote: Hi, can Devs add OnChangeTeam ?

example:

CSHARP Code
  1. if (Message.StartsWith("!allies"))
  2. {
  3. Client.Team = Teams.Allies;
  4. return ChatType.ChatNone;
  5. }
  6. if (Message.StartsWith("!axis"))
  7. {
  8. Client.Team = Teams.Axis;
  9. return ChatType.ChatNone;
  10. }
  11. if (Message.StartsWith("!spect"))
  12. {
  13. Client.Team = Teams.Spectator;
  14. return ChatType.ChatNone;
  15. }
  Reply
#3
@litgar i think he acctually mean the EVENT not on how to change team.

Please read the question before posting...

And im sure @zxz0O0 will take a look at this.

Thanks Barata...
Don't worry if things aren't the way you planned, in the end everything will solve itself...
  Reply
#4
the difficulties of translation....
  Reply
#5
You can manually check every ServerFrame if somebody changed team.
[Image: compiling.png][Image: aLKA8og_460sa.gif]
  Reply
#6
Which isn't very resource efficient.
[Image: MaEIQ.png]
  Reply
#7
CSHARP Code
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using Addon;
  6.  
  7. namespace teamchange
  8. {
  9. public class Class1:CPlugin
  10. {
  11. Dictionary<int, Teams> Team = new Dictionary<int, Teams>();
  12. public void OnTeamChange(ServerClient Client)
  13. {
  14. }
  15. public override void OnPlayerDisconnect(ServerClient Client)
  16. {
  17. Team.Remove(Client.ClientNum);
  18. }
  19. public override void OnPlayerSpawned(ServerClient Client)
  20. {
  21. if (!Team.ContainsKey(Client.ClientNum))
  22. {
  23. Team.Add(Client.ClientNum, Client.Team);
  24. }
  25. else
  26. {
  27. if (Team[Client.ClientNum] != Client.Team)
  28. {
  29. OnTeamChange(Client);
  30. }
  31. Team[Client.ClientNum] = Client.Team;
  32. }
  33. }
  34. }
  35. }

OnTeamChange will get called every time someone changes team.TESTED
  Reply
#8
(09-10-2012, 11:26)archit Wrote: OnTeamChange will get called every time someone changes team.UNTESTED

Yep, this is it, I need this event to build plugin without create new thread for search "team changes", it will be helpful.
The more functionality of the application the greater the chance of errors.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Hawken Closed Beta Event 3 Keys for PC [DA]Bad Blood 1 2,319 11-20-2012, 23:31
Last Post: SuperNovaAO
Question [Request] Event OnPlayerDisconnect Nerus 7 3,032 04-11-2012, 04:34
Last Post: zhp0083
  [Request] Event OnServerLoaded(), On MapLoaded(); Nerus 6 2,907 04-08-2012, 10:39
Last Post: zxz0O0
  Event to happen when Player kills someone StPatrick 4 3,122 03-24-2012, 11:02
Last Post: hidra
  [News] XP Event - Zipline Trailer Tomsen1410 4 2,338 08-25-2011, 01:46
Last Post: skata3000
  Help level waittill("event" or " this event"); Puffiamo 8 3,439 07-11-2011, 21:34
Last Post: AZUMIKKEL

Forum Jump:


Users browsing this thread: 1 Guest(s)