#include new g_ExplosionSprite; new g_SteamSprite; new g_LightningSprite; new g_Laser; public OnPluginStart() { HookEvent("player_spawn", PlayerSpawn); } public OnMapStart() { g_ExplosionSprite = PrecacheModel("sprites/sprite_fire01.vmt"); g_SteamSprite = PrecacheModel("sprites/steam1.vmt"); g_LightningSprite = PrecacheModel("sprites/lgtning.vmt"); g_Laser = PrecacheModel("sprites/laser.vmt"); PrecacheSound("ambient/explosions/explode_9.wav", true); } public Action:PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast) { CreateTimer(0.3, Timer_Effect, GetEventInt(event, "userid")); } public Action:Timer_Effect(Handle:timer, any:userid) { new client = GetClientOfUserId(userid); if (client && IsClientInGame(client) && GetClientTeam(client)>1) { new Float:pos[3]; GetClientAbsOrigin(client, pos); new randomx = GetRandomInt(-500, 500); new randomy = GetRandomInt(-500, 500); new Float:startpos[3]; startpos[0] = pos[0] + randomx; startpos[1] = pos[1] + randomy; startpos[2] = pos[2] + 800; TE_SetupBeamPoints(startpos, pos, g_LightningSprite, 0, 0, 0, 0.2, 20.0, 10.0, 0, 2.0, {0, 0, 255, 255}, 3); TE_SendToAll(); TE_SetupBeamPoints(startpos, pos, g_LightningSprite, 0, 0, 0, 0.2, 10.0, 5.0, 0, 1.0, {255, 255, 255, 255}, 3); TE_SendToAll(); TE_SetupSparks(pos, Float:{0.0, 0.0, 0.0}, 5000, 1000); TE_SendToAll(); TE_SetupEnergySplash(pos, Float:{0.0, 0.0, 0.0}, false); TE_SendToAll(); TE_SetupSmoke(pos, g_SteamSprite, 5.0, 10); TE_SendToAll(); TE_SetupExplosion(pos, g_ExplosionSprite, 10.0, 1, 0, 100, 5000); TE_SendToAll(); new tesla = CreateEntityByName("point_tesla"); //Он делается с помощью создания entity объекта "point_tesla" DispatchKeyValue(tesla, "m_flRadius", "100.0"); // Радиус 100 единиц DispatchKeyValue(tesla, "m_SoundName", "DoSpark"); //Звук искр DispatchKeyValue(tesla, "beamcount_min", "42"); // Минимальное Количество всплесков DispatchKeyValue(tesla, "beamcount_max", "62"); //Максимальное DispatchKeyValue(tesla, "texture", "sprites/physbeam.vmt"); // Текстура спрайта DispatchKeyValue(tesla, "m_Color", "255 255 255"); //Цвет DispatchKeyValue(tesla, "thick_min", "10.0"); DispatchKeyValue(tesla, "thick_max", "11.0"); DispatchKeyValue(tesla, "lifetime_min", "0.3"); //Минимальное время жизни DispatchKeyValue(tesla, "lifetime_max", "0.3"); //Максимальное время жизни DispatchKeyValue(tesla, "interval_min", "0.1"); DispatchKeyValue(tesla, "interval_max", "0.2"); DispatchSpawn(tesla); //Спавним наш "point_tesla" TeleportEntity(tesla, pos, NULL_VECTOR, NULL_VECTOR); //И телепортируем на позицию прицела AcceptEntityInput(tesla, "TurnOn"); AcceptEntityInput(tesla, "DoSpark"); EmitAmbientSound("ambient/explosions/explode_9.wav", pos); new Float:center[3], Float:one[3], Float:two[3], Float:three[3], Float:four[3], Float:five[3], Float:six[3], Float:seven[3], Float:eight[3]; // нижние точки //Создаем 8 переменных для 8 точек. Я не использовал цикл, потому что мне нужна каждая позиция отдельно, чтобы их потом связать линиями. center[0] = pos[0]; center[1] = pos[1]; center[2] = pos[2]; new Num = 8; new Degrees = 360; new Coeff = 0; new Mul = 50; new Float:oneh[3], Float:twoh[3], Float:threeh[3], Float:fourh[3], Float:fiveh[3], Float:sixh[3], Float:sevenh[3], Float:eighth[3]; new Float:point; point = DegToRad(float(0 * (Degrees / Num) + Coeff)); oneh[0] = center[0] + Sine(point) * Mul; //Честно говоря, не знаю, как он вычисляет. В геометрии не силен. Спросите у хвостега, это его код. oneh[1] = center[1] + Cosine(point) * Mul; oneh[2] = center[2] + 100.0; // 50.0 - Высота клетки one[0] = oneh[0]; //Получаем нижнюю точку one[1] = oneh[1]; one[2] = center[2]; //Т.к. она нижняя, то выысота будет, как у центра. TE_SetupBeamPoints(one, oneh, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); //Создаем вертикальные лазеры, соединяющие 2 наши точки. TE_SendToAll(); point = DegToRad(float(1 * (Degrees / Num) + Coeff)); //вычисляем 2 точку twoh[0] = center[0] + Sine(point) * Mul; twoh[1] = center[1] + Cosine(point) * Mul; twoh[2] = center[2] + 100.0; two[0] = twoh[0]; two[1] = twoh[1]; two[2] = center[2]; TE_SetupBeamPoints(two, twoh, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); //Создаем вертикальные лазеры, соединяющие 2 наши точки. TE_SendToAll(); point = DegToRad(float(2 * (Degrees / Num) + Coeff)); //вычисляем 3 точку threeh[0] = center[0] + Sine(point) * Mul; threeh[1] = center[1] + Cosine(point) * Mul; threeh[2] = center[2] + 100.0; three[0] = threeh[0]; three[1] = threeh[1]; three[2] = center[2]; TE_SetupBeamPoints(three, threeh, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); TE_SendToAll(); point = DegToRad(float(3 * (Degrees / Num) + Coeff)); //вычисляем 4 точку fourh[0] = center[0] + Sine(point) * Mul; fourh[1] = center[1] + Cosine(point) * Mul; fourh[2] = center[2] + 100.0; four[0] = fourh[0]; four[1] = fourh[1]; four[2] = center[2]; TE_SetupBeamPoints(four, fourh, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); TE_SendToAll(); point = DegToRad(float(4 * (Degrees / Num) + Coeff)); //вычисляем 5 точку fiveh[0] = center[0] + Sine(point) * Mul; fiveh[1] = center[1] + Cosine(point) * Mul; fiveh[2] = center[2] + 100.0; five[0] = fiveh[0]; five[1] = fiveh[1]; five[2] = center[2]; TE_SetupBeamPoints(five, fiveh, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); TE_SendToAll(); point = DegToRad(float(5 * (Degrees / Num) + Coeff)); //вычисляем 6 точку sixh[0] = center[0] + Sine(point) * Mul; sixh[1] = center[1] + Cosine(point) * Mul; sixh[2] = center[2] + 100.0; six[0] = sixh[0]; six[1] = sixh[1]; six[2] = center[2]; TE_SetupBeamPoints(six, sixh, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); TE_SendToAll(); point = DegToRad(float(6 * (Degrees / Num) + Coeff)); //вычисляем 7 точку sevenh[0] = center[0] + Sine(point) * Mul; sevenh[1] = center[1] + Cosine(point) * Mul; sevenh[2] = center[2] + 100.0; seven[0] = sevenh[0]; seven[1] = sevenh[1]; seven[2] = center[2]; TE_SetupBeamPoints(seven, sevenh, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); TE_SendToAll(); point = DegToRad(float(7 * (Degrees / Num) + Coeff)); //вычисляем 8 точку eighth[0] = center[0] + Sine(point) * Mul; eighth[1] = center[1] + Cosine(point) * Mul; eighth[2] = center[2] + 100.0; eight[0] = eighth[0]; eight[1] = eighth[1]; eight[2] = center[2]; TE_SetupBeamPoints(eight, eighth, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); TE_SendToAll(); //Соединяем верхние и нижние точки друг с другом, чтобы получилась "крыша" TE_SetupBeamPoints(one, two, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); //Соединяем нижние точки по кругу: 1 со 2, 2 с 3, 3 с 4, ... , 8 с 1 TE_SendToAll(); TE_SetupBeamPoints(two, three, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); TE_SendToAll(); TE_SetupBeamPoints(three, four, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); TE_SendToAll(); TE_SetupBeamPoints(four, five, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); TE_SendToAll(); TE_SetupBeamPoints(five, six, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); TE_SendToAll(); TE_SetupBeamPoints(six, seven, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); TE_SendToAll(); TE_SetupBeamPoints(seven, eight, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); TE_SendToAll(); TE_SetupBeamPoints(eight, one, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); TE_SendToAll(); TE_SetupBeamPoints(oneh, twoh, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30);//Соединяем верхние точки по кругу: 1 со 2, 2 с 3, 3 с 4, ... , 8 с 1 TE_SendToAll(); TE_SetupBeamPoints(twoh, threeh, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); TE_SendToAll(); TE_SetupBeamPoints(threeh, fourh, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); TE_SendToAll(); TE_SetupBeamPoints(fourh, fiveh, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); TE_SendToAll(); TE_SetupBeamPoints(fiveh, sixh, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); TE_SendToAll(); TE_SetupBeamPoints(sixh, sevenh, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); TE_SendToAll(); TE_SetupBeamPoints(sevenh, eighth, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); TE_SendToAll(); TE_SetupBeamPoints(eighth, oneh, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); TE_SendToAll(); //Для красоты я соединил между собой верхние точки, чтобы получилась своеобразная "крыша". Для того, чтобы понять, как соединять, нарисуйте на листочке. //Соединяем 1 точку со всеми, кроме 2 и 8 (т.к. она уже соединена с ними) TE_SetupBeamPoints(oneh, threeh, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); TE_SendToAll(); TE_SetupBeamPoints(oneh, fourh, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); TE_SendToAll(); TE_SetupBeamPoints(oneh, fiveh, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); TE_SendToAll(); TE_SetupBeamPoints(oneh, fiveh, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); TE_SendToAll(); TE_SetupBeamPoints(oneh, sixh, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); TE_SendToAll(); TE_SetupBeamPoints(oneh, sevenh, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); TE_SendToAll(); //Соединяем 2 точку со всеми, кроме 1 и 3. TE_SetupBeamPoints(twoh, fourh, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); TE_SendToAll(); TE_SetupBeamPoints(twoh, fiveh, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); TE_SendToAll(); TE_SetupBeamPoints(twoh, sixh, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); TE_SendToAll(); TE_SetupBeamPoints(twoh, sevenh, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); TE_SendToAll(); TE_SetupBeamPoints(twoh, eighth, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); TE_SendToAll(); //Соединяем 3 точку со всеми, кроме 1, 2 и 4. TE_SetupBeamPoints(threeh, fiveh, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); TE_SendToAll(); TE_SetupBeamPoints(threeh, sixh, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); TE_SendToAll(); TE_SetupBeamPoints(threeh, sevenh, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); TE_SendToAll(); TE_SetupBeamPoints(threeh, eighth, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); TE_SendToAll(); //Соединяем 4 точку с 6, 7 и 8 (т.к. со всеми остальными она уже соединена). TE_SetupBeamPoints(fourh, sixh, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); TE_SendToAll(); TE_SetupBeamPoints(fourh, sevenh, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); TE_SendToAll(); TE_SetupBeamPoints(fourh, eighth, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); TE_SendToAll(); //Соединяем 5 точку с 7 и 8 по той же причине. TE_SetupBeamPoints(fiveh, sevenh, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); TE_SendToAll(); TE_SetupBeamPoints(fiveh, eighth, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); TE_SendToAll(); //Соединяем 6 точку с 8. TE_SetupBeamPoints(sixh, eighth, g_Laser,0,0,0,10.0,1.0,1.0,10,0.5,{0, 100, 255, 255},30); TE_SendToAll(); } }