class Color { uint8 r, g, b, a; Color() { r = g = b = a = 0; } Color(uint8 r, uint8 g, uint8 b) { this.r = r; this.g = g; this.b = b; this.a = 255; } Color(uint8 r, uint8 g, uint8 b, uint8 a) { this.r = r; this.g = g; this.b = b; this.a = a; } Color(float r, float g, float b, float a) { this.r = uint8(r); this.g = uint8(g); this.b = uint8(b); this.a = uint8(a); } Color (Vector v) { this.r = uint8(v.x); this.g = uint8(v.y); this.b = uint8(v.z); this.a = 255; } string ToString() { return "" + r + " " + g + " " + b + " " + a; } Vector getRGB() { return Vector(r, g, b); } } Color RED = Color(255,0,0); Color GREEN = Color(0,255,0); Color BLUE = Color(0,0,255); Color YELLOW = Color(255,255,0); Color ORANGE = Color(255,127,0); Color PURPLE = Color(127,0,255); Color PINK = Color(255,0,127); Color TEAL = Color(0,255,255); Color WHITE = Color(255,255,255); Color BLACK = Color(0,0,0); Color GRAY = Color(127,127,127); void te_beampoints(Vector start, Vector end, string sprite="sprites/laserbeam.spr", uint8 frameStart=0, uint8 frameRate=100, uint8 life=20, uint8 width=2, uint8 noise=0, Color c=GREEN, uint8 scroll=32, NetworkMessageDest msgType=MSG_BROADCAST, edict_t@ dest=null) { NetworkMessage m(msgType, NetworkMessages::SVC_TEMPENTITY, dest);m.WriteByte(TE_BEAMPOINTS);m.WriteCoord(start.x);m.WriteCoord(start.y);m.WriteCoord(start.z);m.WriteCoord(end.x);m.WriteCoord(end.y);m.WriteCoord(end.z);m.WriteShort(g_EngineFuncs.ModelIndex(sprite));m.WriteByte(frameStart);m.WriteByte(frameRate);m.WriteByte(life);m.WriteByte(width);m.WriteByte(noise);m.WriteByte(c.r);m.WriteByte(c.g);m.WriteByte(c.b);m.WriteByte(c.a);m.WriteByte(scroll);m.End(); } // Will create a new state if the requested one does not exit PlayerState@ getPlayerState(CBasePlayer@ plr) { if (plr is null or !plr.IsConnected()) return null; string steamId = g_EngineFuncs.GetPlayerAuthId( plr.edict() ); if (steamId == 'STEAM_ID_LAN' or steamId == 'BOT') { steamId = plr.pev.netname; } if ( !g_player_states.exists(steamId) ) { PlayerState state; g_player_states[steamId] = state; } return cast( g_player_states[steamId] ); } void print(string text) { g_Game.AlertMessage( at_console, text); } void println(string text) { print(text + "\n"); }