Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sourcemod>
- #include <sdktools>
- #define MODEL_AMMO "models/w_models/weapons/w_eq_explosive_ammopack.mdl"
- public OnPluginStart()
- {
- HookEvent("upgrade_pack_used", Event_PlayerUse);
- }
- public Event_PlayerUse(Handle:event, const String:name[], bool:dontBroadcast)
- {
- //int i = GetClientOfUserId(GetEventInt(event, "userid"));
- int entity_id = GetEventInt(event, "upgradeid");
- float origin[3];
- GetEntPropVector(entity_id, Prop_Send, "m_vecOrigin", origin);
- new ammo_stack = CreateEntityByName("weapon_ammo_spawn");
- AcceptEntityInput(entity_id, "kill")
- DispatchSpawn(ammo_stack);
- SetEntityModel(ammo_stack, MODEL_AMMO);
- TeleportEntity(ammo_stack, origin, NULL_VECTOR, NULL_VECTOR);
- }
- stock bool:IsClientInGameHuman(client)
- {
- if (client > 0) return IsClientInGame(client) && !IsFakeClient(client);
- else return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment