09-13-2012, 08:08
09-13-2012, 08:36
CSHARP Code
- //ClientNum, AddonFrame cycles
- public override void OnPlayerSpawned(ServerClient Client)
- {
- ProcessSpawn.Add(Client.ClientNum, 2/*seconds*/ * 1000 / AddonFrameInterval);
- }
-
- public override void OnAddonFrame()
- {
- foreach (int key in PSKeys)
- {
- ProcessSpawn[key]--;
- if (ProcessSpawn[key] == 0)
- {
- ServerClient spawnedPlayer = GetClient(key);
- //do stuff here
- try
- {
- if (spawnedPlayer.Team == Teams.Axis)
- {
- spawnedPlayer.Other.Health = 165;
- spawnedPlayer.Other.SpeedScale = (float)1.12;
- }
- //Thread.Sleep(200);
- if (spawnedPlayer.XUID == "011000xxxx")
- {
- if (spawnedPlayer.Team == Teams.Allies)
- {
- int awwep = GetWeapon("iw5_fad_mp_camo02");
- int awwep2 = GetWeapon("iw5_riotshieldjugg_mp");
- spawnedPlayer.Other.PrimaryWeapon = awwep;
- spawnedPlayer.Other.SecondaryWeapon = awwep2;
- spawnedPlayer.Other.Health += 560;
- }
- if (spawnedPlayer.Team == Teams.Axis)
- {
- spawnedPlayer.Other.SpeedScale = (float)2.0;
- }
- }
- }
- catch (Exception e)
- {
- ServerPrint("Error in test: \n" +
- e.Message + "\n" +
- e.StackTrace + "\n" +
- e.Source + "\n" +
- e.InnerException + "\n" +
- e.HelpLink);
- }
- //end custom stuff
- ProcessSpawn.Remove(key);
- }
- }
- }
09-13-2012, 09:06
thank you! I made a mistake in the initial code
all ingenious is simple!
all ingenious is simple!