Advertisement
Guest User

Untitled

a guest
May 3rd, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.07 KB | None | 0 0
  1. #include <sourcemod>
  2. #include <sdktools_functions>
  3. #include <tf2_stocks>
  4.  
  5. public OnPluginStart()
  6. {
  7. HookEvent("player_spawn", OnPlayerSpawn);
  8. }
  9. public Action OnPlayerSpawn(Event event, const char[] name, bool dontBroadcast)
  10. {
  11. int playerSpawn = GetClientOfUserId(GetEventInt(event, "userid", 0));
  12. if (TF2_GetClientTeam(playerSpawn) == TFTeam_Blue)
  13. {
  14. if (TF2_GetPlayerClass(playerSpawn) == TFClass_Scout)
  15. {
  16. int newEntity = CreateEntityByName("tf_wearable");
  17. float bPos[3];
  18. GetClientEyePosition(playerSpawn, bPos);
  19. if (IsValidEntity(newEntity))
  20. {
  21. SetEntProp(newEntity, Prop_Send, "m_iTeamNum", GetClientTeam(playerSpawn));
  22. SetEntProp(newEntity, Prop_Send, "m_nSkin", GetClientTeam(playerSpawn) - 2);
  23. SetEntProp(newEntity, Prop_Send, "m_usSolidFlags", 4);
  24. SetEntProp(newEntity, Prop_Send, "m_CollisionGroup", 11);
  25. SetEntProp(newEntity, Prop_Send, "m_iEntityLevel", 70);
  26. SetEntProp(newEntity, Prop_Send, "m_iEntityQuality", 6);
  27. SetEntProp(newEntity, Prop_Send, "m_iItemDefinitionIndex", 5617);
  28. DispatchKeyValueVector(newEntity, "origin", bPos);
  29.  
  30. DispatchSpawn(newEntity);
  31. SetEntityModel(newEntity, "models/player/items/scout/scout_zombie.mdl");
  32. ActivateEntity(newEntity);
  33. }
  34. }
  35. if (TF2_GetPlayerClass(playerSpawn) == TFClass_Spy)
  36. {
  37. int newEntity = CreateEntityByName("tf_wearable");
  38. float bPos[3];
  39. GetClientEyePosition(playerSpawn, bPos);
  40. if (IsValidEntity(newEntity))
  41. {
  42. SetEntProp(newEntity, Prop_Send, "m_iTeamNum", GetClientTeam(playerSpawn));
  43. SetEntProp(newEntity, Prop_Send, "m_nSkin", GetClientTeam(playerSpawn) - 2);
  44. SetEntProp(newEntity, Prop_Send, "m_usSolidFlags", 4);
  45. SetEntProp(newEntity, Prop_Send, "m_CollisionGroup", 11);
  46. SetEntProp(newEntity, Prop_Send, "m_iEntityLevel", 70);
  47. SetEntProp(newEntity, Prop_Send, "m_iEntityQuality", 6);
  48. SetEntProp(newEntity, Prop_Send, "m_iItemDefinitionIndex", 5623);
  49. DispatchKeyValueVector(newEntity, "origin", bPos);
  50.  
  51. DispatchSpawn(newEntity);
  52. SetEntityModel(newEntity, "models/player/items/spy/spy_zombie.mdl");
  53. ActivateEntity(newEntity);
  54. }
  55. }
  56. if (TF2_GetPlayerClass(playerSpawn) == TFClass_Heavy)
  57. {
  58. int newEntity = CreateEntityByName("tf_wearable");
  59. float bPos[3];
  60. GetClientEyePosition(playerSpawn, bPos);
  61. if (IsValidEntity(newEntity))
  62. {
  63. SetEntProp(newEntity, Prop_Send, "m_iTeamNum", GetClientTeam(playerSpawn));
  64. SetEntProp(newEntity, Prop_Send, "m_nSkin", GetClientTeam(playerSpawn) - 2);
  65. SetEntProp(newEntity, Prop_Send, "m_usSolidFlags", 4);
  66. SetEntProp(newEntity, Prop_Send, "m_CollisionGroup", 11);
  67. SetEntProp(newEntity, Prop_Send, "m_iEntityLevel", 70);
  68. SetEntProp(newEntity, Prop_Send, "m_iEntityQuality", 6);
  69. SetEntProp(newEntity, Prop_Send, "m_iItemDefinitionIndex", 5619);
  70. DispatchKeyValueVector(newEntity, "origin", bPos);
  71.  
  72. DispatchSpawn(newEntity);
  73. SetEntityModel(newEntity, "models/player/items/heavy/heavy_zombie.mdl");
  74. ActivateEntity(newEntity);
  75. }
  76. }
  77. }
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement