Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sourcemod>
- #include <sdktools>
- #include <sdkhooks>
- #define PipeBomb
- #define Molotov
- #define VomitJar
- #pragma tabsize 0
- #pragma semicolon 1
- #define PARTICLE "fire_01.pcf"
- new Sprite;
- public Plugin myinfo = {
- name = "[ANY] Particles",
- author = "TheUnderTaker",
- description = "Can show particles on client =)",
- version = "1.1",
- url = "http://steamcommunity.com/id/theundertaker007/"
- };
- public void OnPluginStart()
- {
- RegConsoleCmd("sm_sp", Command_SpawnParticle);
- RegConsoleCmd("sm_spawnparticle", Command_SpawnParticle);
- Sprite = PrecacheModel("particles/fire_01.pcf");
- }
- public Action:Command_SpawnParticle(client, args)
- {
- if(client == 0)
- {
- PrintToServer("Command In-game Only!");
- }
- if (args != 1)
- {
- ReplyToCommand(client, "[Particles] Usage:sm_sp or sm_spawnparticle <particle_name>");
- return Plugin_Handled;
- }
- char particle[99];
- GetCmdArg(1, particle, sizeof(particle));
- CreateParticle(client, particle, 5.0);
- return Plugin_Handled;
- }
- stock CreateParticle(ent, String:particleType[], Float:time)
- {
- new particle = CreateEntityByName("info_particle_system");
- new String:Start[32];
- new String:End[32];
- if (IsValidEdict(particle))
- {
- DispatchKeyValue(particle, "fire_01.pcf", PARTICLE);
- DispatchKeyValue(particle, "cpoint0", End);
- DispatchKeyValue(particle, "cpoint1", Start);
- DispatchSpawn(particle);
- ActivateEntity(particle);
- AcceptEntityInput(particle, "start");
- }
- }
- public Action:DeleteParticle(Handle:timer, any:particle)
- {
- if (IsValidEntity(particle))
- {
- new String:classN[64];
- GetEdictClassname(particle, classN, sizeof(classN));
- if (StrEqual(classN, "info_particle_system", false))
- {
- RemoveEdict(particle);
- }
- }
- }
- public OnEntityCreated(Entity, const String:Classname[])
- {
- if(strcmp(Classname, "pipe_bomb_projectile") == 0)
- {
- CreateParticle;
- }
- else if(strcmp(Classname, "molotov_projectile") == 0)
- {
- CreateParticle;
- }
- else if(strcmp(Classname, "vomitjar_projectile") == 0)
- {
- CreateParticle;
- }
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement