Advertisement
Guest User

Untitled

a guest
Jun 21st, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.14 KB | None | 0 0
  1. #include <sourcemod>
  2. #include <sdktools>
  3. #include <sdkhooks>
  4.  
  5. #define PipeBomb    
  6. #define Molotov
  7. #define VomitJar    
  8.  
  9. #pragma tabsize 0
  10. #pragma semicolon 1
  11. #define PARTICLE "fire_01.pcf"
  12.  
  13. new Sprite;
  14.  
  15. public Plugin myinfo = {
  16.     name        = "[ANY] Particles",
  17.     author      = "TheUnderTaker",
  18.     description = "Can show particles on client =)",
  19.     version     = "1.1",
  20.     url         = "http://steamcommunity.com/id/theundertaker007/"
  21. };
  22.  
  23. public void OnPluginStart()
  24. {
  25.     RegConsoleCmd("sm_sp", Command_SpawnParticle);
  26.     RegConsoleCmd("sm_spawnparticle", Command_SpawnParticle);
  27.     Sprite = PrecacheModel("particles/fire_01.pcf");
  28. }
  29.  
  30. public Action:Command_SpawnParticle(client, args)
  31. {
  32.     if(client == 0)
  33.     {
  34.     PrintToServer("Command In-game Only!");
  35.     }
  36.     if (args != 1)
  37.     {
  38.         ReplyToCommand(client, "[Particles] Usage:sm_sp or sm_spawnparticle <particle_name>");
  39.         return Plugin_Handled;
  40.     }
  41.     char particle[99];
  42.     GetCmdArg(1, particle, sizeof(particle));
  43.     CreateParticle(client, particle, 5.0);
  44.    
  45.     return Plugin_Handled;
  46. }
  47.  
  48. stock CreateParticle(ent, String:particleType[], Float:time)
  49. {
  50.     new particle = CreateEntityByName("info_particle_system");
  51.     new String:Start[32];
  52.     new String:End[32];
  53.  
  54.     if (IsValidEdict(particle))
  55.     {
  56.         DispatchKeyValue(particle, "fire_01.pcf", PARTICLE);
  57.         DispatchKeyValue(particle, "cpoint0", End);
  58.         DispatchKeyValue(particle, "cpoint1", Start);
  59.         DispatchSpawn(particle);
  60.         ActivateEntity(particle);
  61.         AcceptEntityInput(particle, "start");    
  62.     }
  63. }
  64.  
  65. public Action:DeleteParticle(Handle:timer, any:particle)
  66. {
  67.     if (IsValidEntity(particle))
  68.     {
  69.         new String:classN[64];
  70.         GetEdictClassname(particle, classN, sizeof(classN));
  71.         if (StrEqual(classN, "info_particle_system", false))
  72.         {
  73.             RemoveEdict(particle);
  74.         }
  75.     }
  76. }
  77.  
  78. public OnEntityCreated(Entity, const String:Classname[])
  79. {
  80.     if(strcmp(Classname, "pipe_bomb_projectile") == 0)
  81.     {
  82.         CreateParticle;    
  83.     }
  84.     else if(strcmp(Classname, "molotov_projectile") == 0)
  85.     {
  86.         CreateParticle;
  87.     }
  88.     else if(strcmp(Classname, "vomitjar_projectile") == 0)
  89.     {
  90.         CreateParticle;
  91.     }  
  92.     return;
  93. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement