FlacoBey

Untitled

Jun 3rd, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.74 KB | None | 0 0
  1. #include sdktools
  2. #include sdkhooks
  3.  
  4. public void OnEntityCreated(int entity, const char[] classname)
  5. {
  6.     if(IsValidEntity(entity))
  7.     {
  8.         SDKHook(entity, SDKHook_SpawnPost, SpawnPost);
  9.     }
  10. }
  11.  
  12. public void SpawnPost(int entity)
  13. {
  14.     RequestFrame(NextFrame, EntIndexToEntRef(entity));
  15. }
  16.  
  17. public void NextFrame(int entity)
  18. {
  19.     entity = EntRefToEntIndex(entity);
  20.     if (IsValidEntity(entity))
  21.     {
  22.         char sClsName[32];
  23.         GetEntityClassname(entity, sClsName, sizeof(sClsName));
  24.         if(StrContains(sClsName, "spawn") > -1)
  25.         {
  26.             if(StrContains(sClsName, "shotgun") > 1 || StrContains(sClsName, "rifle") > 1 || StrContains(sClsName, "sniper") || StrContains(sClsName, "smg") > 0)
  27.             {
  28.                 DispatchKeyValue(entity, "count", "1");
  29.             }
  30.         }
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment