FlacoBey

Untitled

Dec 30th, 2018
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1. #include <sourcemod>
  2. #include <sdktools>
  3.  
  4. public OnPluginStart()
  5. {
  6.     HookEvent("upgrade_pack_used", Event_PlayerUse);
  7. }
  8.  
  9. public Event_PlayerUse(Handle:event, const String:name[], bool:dontBroadcast)
  10. {
  11.     int i = GetClientOfUserId(GetEventInt(event, "userid"));
  12.  
  13.     int entity_id = GetEventInt(event, "upgradeid");
  14.     if (IsValidEdict(entity_id))
  15.     {
  16.         float origin[3];
  17.         GetClientAbsOrigin(i,origin);
  18.         origin[2] += 1;
  19.         new pack = CreateEntityByName("weapon_ammo_spawn");
  20.         DispatchSpawn(pack);
  21.         AcceptEntityInput(entity_id, "kill")
  22.         DispatchKeyValueVector(entity_id, "origin", origin);
  23.        
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment