1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
| #include <sourcemod> #include <sdktools>
#define IsValidClient(%1) (1 <= %1 <= MaxClients && IsClientInGame(%1)) new g_BeamObject[66]; new g_BeamSprite;
public OnPluginStart() { RegConsoleCmd("sm_hy", Command_CPmenu); }
public OnMapStart() { g_BeamSprite = PrecacheModel("materials/sprites/laserbeam.vmt", false); }
public Action:Command_CPmenu(client, args) { VIPHy(client); }
public Action:VIPHy(Client) { CreateTimer(1.0, on, Client, 3); return; }
public Action:on(Handle:timer, any:Client) { SetUpBeamSpirit(Client, "red", 2.0, 7.0, 100); return; }
SetUpBeamSpirit(Client, String:ColoR[], Float:Life, Float:width, Alpha) { if (IsPlayerAlive(Client)) { if (IsValidClient(Client)) { new mr_Noob = CreateEntityByName("prop_dynamic_override", -1); decl Float:pos[3]; GetClientAbsOrigin(Client, pos); if (IsValidEdict(mr_Noob)) { decl Float:nooB[3]; decl Float:noobAng[3]; GetEntPropVector(Client, PropType:0, "m_vecOrigin", nooB, 0); GetEntPropVector(Client, PropType:1, "m_angRotation", noobAng, 0); DispatchKeyValue(mr_Noob, "model", "models/editor/camera.mdl"); SetEntPropVector(mr_Noob, PropType:0, "m_vecOrigin", nooB, 0); SetEntPropVector(mr_Noob, PropType:0, "m_angRotation", noobAng, 0); DispatchSpawn(mr_Noob); SetEntPropFloat(mr_Noob, PropType:0, "m_flModelScale", -0.0, 0); SetEntProp(mr_Noob, PropType:0, "m_nSolidType", any:6, 4, 0); SetEntityRenderMode(mr_Noob, RenderMode:1); SetEntityRenderColor(mr_Noob, 255, 255, 255, 0); SetVariantString("!activator"); AcceptEntityInput(mr_Noob, "SetParent", Client, -1, 0); SetVariantString("spine"); AcceptEntityInput(mr_Noob, "SetParentAttachment", -1, -1, 0); new col[4]; col[0] = GetRandomInt(0, 255); col[1] = GetRandomInt(0, 255); col[2] = GetRandomInt(0, 255); col[3] = Alpha; new col2[4]; col2[0] = GetRandomInt(0, 255); col2[1] = GetRandomInt(0, 255); col2[2] = GetRandomInt(0, 255); col2[3] = Alpha; if (StrEqual(ColoR, "red", false)) { col[0] = GetRandomInt(0, 255); col2[1] = GetRandomInt(0, 255); } else { if (StrEqual(ColoR, "green", false)) { col[1] = 255; col2[0] = 255; } if (StrEqual(ColoR, "blue", false)) { col[2] = 255; col2[0] = 255; } } TE_SetupBeamFollow(mr_Noob, g_BeamSprite, 100, Life, width, 1.0, 3, col); TE_SendToAll(0.0); TE_SetupBeamFollow(mr_Noob, g_BeamSprite, 100, Life, 1.0, 1.0, 3, col2); TE_SendToAll(0.0); g_BeamObject[Client] = mr_Noob; CreateTimer(1.5, DeleteParticles, mr_Noob, 0); } } } return; }
public Action:DeleteParticles(Handle:timer, any:particle) { if (IsValidEntity(particle)) { new String:classname[64]; GetEdictClassname(particle, classname, 64); RemoveEdict(particle); } return; }
|