Advertisement
Guest User

Untitled

a guest
Jun 21st, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.40 KB | None | 0 0
  1. #include <sourcemod>
  2. #include <sdktools>
  3. #include <sdkhooks>
  4.    
  5.  
  6. #pragma tabsize 0
  7. #pragma semicolon 1
  8.  
  9. public Plugin myinfo = {
  10.     name        = "[ANY] Particles",
  11.     author      = "TheUnderTaker",
  12.     description = "Can show particles on client =)",
  13.     version     = "1.1",
  14.     url         = "http://steamcommunity.com/id/theundertaker007/"
  15. };
  16.  
  17. public void OnPluginStart()
  18. {
  19.     HookEvent("player_first_spawn", Event_spawn);
  20.     PrecacheGeneric("particles/BloodFire.pcf", true);
  21. }
  22.  
  23. public void OnMapStart()
  24. {
  25.     PrecacheGeneric("particles/BloodFire.pcf", true);
  26. }
  27.  
  28.  
  29. void CreateEffect(int iClient)
  30. {
  31.     float fPos[3];
  32.     new iEnt = CreateEntityByName("info_particle_system");
  33.    
  34.     DispatchKeyValue(iEnt, "start_active", "1");
  35.     DispatchKeyValue(iEnt, "effect_name", "bubble_2_new_2j");
  36.    
  37.     SetEntPropEnt(iEnt, Prop_Send, "m_hOwnerEntity", iClient);
  38.     GetClientAbsOrigin(iClient, fPos);
  39.    
  40.     TeleportEntity(iEnt, fPos, NULL_VECTOR, NULL_VECTOR);
  41.    
  42.     DispatchKeyValue(iEnt, "angles", "-90 0 0");
  43.     DispatchSpawn(iEnt);
  44.    
  45.     ActivateEntity(iEnt);
  46.     SetVariantString("!activator");
  47.     AcceptEntityInput(iEnt, "SetParent", iClient, iEnt);
  48.    
  49.     AcceptEntityInput(iEnt, "Start");
  50.  
  51. }
  52.  
  53.  
  54. public Action:Event_spawn(Handle:Event, const String:strName[], bool:DontBroadcast)
  55. {
  56.     new Client = GetClientOfUserId(GetEventInt(Event, "userid"));
  57.     CreateEffect(Client);
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement