Advertisement
Guest User

Untitled

a guest
Oct 10th, 2015
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. char EntityList[4][158] = { "Tradedoor1", "Tradedoor2", "Tradedoor3", "Tradedoor4" };
  2.  
  3. public OnEntityCreated(entity, const char[] classname)
  4. {
  5. if (IsValidEntity(entity))
  6. {
  7. if ((StrContains(classname, "func_") != -1))
  8. {
  9. SDKHook(entity, SDKHook_Spawn, Spawn);
  10. }
  11.  
  12. }
  13.  
  14. }
  15.  
  16.  
  17. public Action Spawn(entity, classname)
  18. {
  19. if (IsValidEntity(entity))
  20. {
  21. char strName[50];
  22. GetEntPropString(entity, Prop_Data, "m_iName", strName, sizeof(strName));
  23.  
  24. for (int i = 1; i < sizeof(EntityList); i++)
  25. {
  26. if (StrEqual(strName, EntityList[i]))
  27. {
  28. AcceptEntityInput(entity, "Close"); // Entity is the checked door< th
  29. PrintToServer("Name: %s", strName);
  30. }
  31. }
  32. }
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement