Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sourcemod>
- #include <sdktools>
- #include <sdkhooks>
- new g_iLight[3];
- ConVar R,G,B,A;
- public OnMapStart()
- {
- if (!IsModelPrecached("models/infected/witch.mdl")) PrecacheModel("models/infected/witch.mdl");
- if (!IsModelPrecached("models/infected/witch_bride.mdl")) PrecacheModel("models/infected/witch_bride.mdl");
- R = CreateConVar("vR", "255", "RGB", FCVAR_NONE);
- G = CreateConVar("vG", "255", "RGB", FCVAR_NONE);
- B = CreateConVar("vB", "255", "RGB", FCVAR_NONE);
- A = CreateConVar("vA", "255", "ALPHA", FCVAR_NONE);
- }
- public OnPluginStart()
- {
- HookEvent("witch_spawn", hWitchSpawned);
- }
- public Action hWitchSpawned(Handle:event, const String:name[], bool:dontBroadcast)
- {
- new Witch = GetEventInt(event, "witchid");
- new entity = CreateEntityByName("beam_spotlight");
- if(IsValidEntity(entity))
- {
- float flOrigin[3], flAngles[3];
- GetEntPropVector(Witch, Prop_Send, "m_vecOrigin", flOrigin);
- GetEntPropVector(Witch, Prop_Send, "m_angRotation", flAngles);
- for (int iLight = 0; iLight < 2; iLight++)
- {
- vLightProp(Witch, iLight, flOrigin, flAngles);
- }
- }
- }
- static void vLightProp(int Witch, int light, float origin[3], float angles[3])
- {
- g_iLight[light] = CreateEntityByName("beam_spotlight");
- DispatchKeyValueVector(g_iLight[light], "origin", origin);
- DispatchKeyValueVector(g_iLight[light], "angles", angles);
- SetEntityRenderColor(g_iLight[light], GetConVarInt(R), GetConVarInt(G), GetConVarInt(B), GetConVarInt(A));
- DispatchKeyValue(g_iLight[light], "spotlightwidth", "6");
- DispatchKeyValue(g_iLight[light], "spotlightlength", "50");
- DispatchKeyValue(g_iLight[light], "spawnflags", "3");
- DispatchKeyValue(g_iLight[light], "maxspeed", "100");
- DispatchKeyValue(g_iLight[light], "HDRColorScale", "0.4");
- DispatchKeyValue(g_iLight[light], "fadescale", "1");
- DispatchKeyValue(g_iLight[light], "fademindist", "-1");
- vSetEntityParent(g_iLight[light], Witch);
- switch (light)
- {
- case 0:
- {
- SetVariantString("reye");
- vSetVector(angles, 0.0, 0.0, 0.0);
- }
- case 1:
- {
- SetVariantString("leye");
- vSetVector(angles, 0.0, 0.0, 0.0);
- }
- }
- AcceptEntityInput(g_iLight[light], "SetParentAttachment");
- AcceptEntityInput(g_iLight[light], "Enable");
- AcceptEntityInput(g_iLight[light], "DisableCollision");
- SetEntPropEnt(g_iLight[light], Prop_Send, "m_hOwnerEntity", Witch);
- TeleportEntity(g_iLight[light], NULL_VECTOR, angles, NULL_VECTOR);
- DispatchSpawn(g_iLight[light]);
- }
- stock void vSetEntityParent(int entity, int parent)
- {
- SetVariantString("!activator");
- AcceptEntityInput(entity, "SetParent", parent);
- }
- stock void vSetVector(float target[3], float x, float y, float z)
- {
- target[0] = x;
- target[1] = y;
- target[2] = z;
- }
- stock bool:bIsSurvivor(int client)
- {
- return client > 0 && client <= MaxClients && IsClientInGame(client) && GetClientTeam(client) == 2 && !IsClientInKickQueue(client) && IsPlayerAlive(client);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement