Help OnPlayerSpawned()
#21
removed
Reply

#22
Code:
//ClientNum, AddonFrame cycles Dictionary<int, int> ProcessSpawn = new Dictionary<int, int>(); public override void OnPlayerSpawned(ServerClient Client) { ProcessSpawn.Add(Client.ClientNum, 2/*seconds*/ * 1000 / AddonFrameInterval); } public override void OnAddonFrame() { List<int> PSKeys = new List<int>(ProcessSpawn.Keys); 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); } } }
[Image: azuw.jpg]
Reply

#23
thank you! I made a mistake in the initial code Tongue

all ingenious is simple!
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Help Error using OnPlayerSpawned JoSchaap 6 4,165 03-17-2012, 15:29
Last Post: JoSchaap

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2026 Melroy van den Berg.