FlacoBey

Untitled

Dec 25th, 2018
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. #pragma semicolon 1
  2. #include <sourcemod>
  3. #include sdktools
  4.  
  5. public OnPluginStart()
  6. {
  7.     HookEvent("ammo_pack_used", EventAu);
  8. }
  9.  
  10. public Action:EventAu(Handle:event, const String:name[], bool:dontBrodcast)
  11. {
  12.     new client = GetClientOfUserId(GetEventInt(event, "userid"));
  13.     int Weapon = GetPlayerWeaponSlot(client, 1);
  14.     if (Weapon == -1)
  15.     {
  16.         char sWeapon[32];
  17.         GetEntityClassname(Weapon, sWeapon, sizeof(sWeapon));
  18.    
  19.         int AmmoType = GetEntProp(Weapon, Prop_Data, "m_iPrimaryAmmoType");    
  20.         int Clip = GetEntProp(Weapon, Prop_Send, "m_iClip1");
  21.    
  22.         SetEntProp(client, Prop_Send, "m_iAmmo", Clip + 40, _, AmmoType);
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment