Advertisement
Guest User

Untitled

a guest
Oct 4th, 2015
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. #pragma semicolon 1
  2.  
  3. #define DEBUG
  4.  
  5. #define PLUGIN_AUTHOR ""
  6. #define PLUGIN_VERSION "0.00"
  7.  
  8. #include <sourcemod>
  9. #include <sdktools>
  10.  
  11. public Plugin myinfo =
  12. {
  13. name = "",
  14. author = PLUGIN_AUTHOR,
  15. description = "",
  16. version = PLUGIN_VERSION,
  17. url = ""
  18. };
  19.  
  20. public void OnPluginStart()
  21. {
  22. init();
  23. }
  24.  
  25. stock void init()
  26. {
  27. HookEvent("player_spawn", onSpawn);
  28. HookEvent("weapon_reload", onReload);
  29. }
  30.  
  31. /* Player is shooting */
  32. public Action OnPlayerRunCmd(int client, &buttons, &impulse, float vel[3], float angles[3], &weapon);
  33. {
  34. if ((buttons & IN_ATTACK) == IN_ATTACK)
  35. {
  36. for (int wep; wep < 4; wep++)
  37. {
  38. if ((ent = GetPlayerWeaponSlot(client, wep)) != -1)
  39. {
  40. SetEntProp(ent, Prop_Send, "m_iPrimaryReserveAmmoCount", 0);
  41. SetEntProp(ent, Prop_Send, "m_iClip1", 0)
  42. }
  43. }
  44. }
  45. }
  46.  
  47. /* Remove ammo on spawn */
  48. public Action onSpawn(Handle event, const char[] name, bool dontBroadcast)
  49. {
  50. if (GameRules_GetProp("m_bWarmupPeriod") == 0) // it's not warm up
  51. {
  52. int cl = GetClientOfUserId(GetEventInt(event, "userid"));
  53.  
  54. for (int wep; wep < 4; wep++)
  55. {
  56. if ((ent = GetPlayerWeaponSlot(cl, wep)) != -1)
  57. {
  58. SetEntProp(ent, Prop_Send, "m_iPrimaryReserveAmmoCount", 0);
  59. SetEntProp(ent, Prop_Send, "m_iClip1", 0)
  60. }
  61. }
  62. }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement