Hi, can Devs add OnChangeTeam ?
The more functionality of the application the greater the chance of errors.
|
Please add Event
|
|
Hi, can Devs add OnChangeTeam ?
The more functionality of the application the greater the chance of errors.
09-10-2012, 05:01
(This post was last modified: 09-10-2012, 05:03 by [Z00MBY] Alex.)
(09-10-2012, 00:43)Nerus Wrote: Hi, can Devs add OnChangeTeam ? example: Code: if (Message.StartsWith("!allies"))
{
Client.Team = Teams.Allies;
return ChatType.ChatNone;
}
if (Message.StartsWith("!axis"))
{
Client.Team = Teams.Axis;
return ChatType.ChatNone;
}
if (Message.StartsWith("!spect"))
{
Client.Team = Teams.Spectator;
return ChatType.ChatNone;
}
09-10-2012, 05:35
@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...
Code: using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Addon;
namespace teamchange
{
public class Class1:CPlugin
{
Dictionary<int, Teams> Team = new Dictionary<int, Teams>();
public void OnTeamChange(ServerClient Client)
{
}
public override void OnPlayerDisconnect(ServerClient Client)
{
Team.Remove(Client.ClientNum);
}
public override void OnPlayerSpawned(ServerClient Client)
{
if (!Team.ContainsKey(Client.ClientNum))
{
Team.Add(Client.ClientNum, Client.Team);
}
else
{
if (Team[Client.ClientNum] != Client.Team)
{
OnTeamChange(Client);
}
Team[Client.ClientNum] = Client.Team;
}
}
}
}
09-10-2012, 11:52
(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.
|
| Possibly Related Threads… | |||||
| Thread | Author | Replies | Views | Last Post | |
| Hawken Closed Beta Event 3 Keys for PC | [DA]Bad Blood | 1 | 3,682 |
11-20-2012, 23:31 Last Post: SuperNovaAO |
|
|
|
[Request] Event OnPlayerDisconnect | Nerus | 7 | 4,787 |
04-11-2012, 04:34 Last Post: zhp0083 |
| [Request] Event OnServerLoaded(), On MapLoaded(); | Nerus | 6 | 4,518 |
04-08-2012, 10:39 Last Post: zxz0O0 |
|
| Event to happen when Player kills someone | StPatrick | 4 | 5,101 |
03-24-2012, 11:02 Last Post: hidra |
|
| [News] XP Event - Zipline Trailer | Tomsen1410 | 4 | 3,793 |
08-25-2011, 01:46 Last Post: skata3000 |
|
| Help level waittill("event" or " this event"); | Puffiamo | 8 | 5,285 |
07-11-2011, 21:34 Last Post: AZUMIKKEL |
|
| Users browsing this thread: |
| 1 Guest(s) |