FlacoBey

Untitled

Dec 25th, 2018
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.86 KB | None | 0 0
  1. #include <sourcemod>
  2. #include <sdktools>
  3.  
  4. #define MODEL_AMMO "models/w_models/weapons/w_eq_explosive_ammopack.mdl"
  5.  
  6. public OnPluginStart()
  7. {
  8.     HookEvent("upgrade_pack_used", Event_PlayerUse);
  9. }
  10.  
  11. public Event_PlayerUse(Handle:event, const String:name[], bool:dontBroadcast)
  12. {
  13.     //int i = GetClientOfUserId(GetEventInt(event, "userid"));
  14.     int entity_id = GetEventInt(event, "upgradeid");
  15.     float origin[3];
  16.    
  17.     GetEntPropVector(entity_id, Prop_Send, "m_vecOrigin", origin);
  18.    
  19.     new ammo_stack = CreateEntityByName("weapon_ammo_spawn");
  20.    
  21.     AcceptEntityInput(entity_id, "kill")
  22.     DispatchSpawn(ammo_stack);
  23.     SetEntityModel(ammo_stack, MODEL_AMMO);
  24.     TeleportEntity(ammo_stack, origin, NULL_VECTOR, NULL_VECTOR);
  25. }
  26.  
  27. stock bool:IsClientInGameHuman(client)
  28. {
  29.     if (client > 0) return IsClientInGame(client) && !IsFakeClient(client);
  30.     else return false;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment