Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sourcemod>
- #include <sdktools>
- 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");
- if (IsValidEdict(entity_id))
- {
- decl String:ent_name[64];
- GetEdictClassname(entity_id, ent_name, sizeof(ent_name))
- {
- if (StrEqual(ent_name, "weapon_upgradepack_explosive", false))
- {
- float origin[3];
- GetEntPropVector(entity_id, Prop_Send, "m_vecOrigin", origin);
- origin[2] += 5;
- char buffer[64];
- Format(buffer, sizeof(buffer), "%N", i);
- new ammo_stack = CreateEntityByName("weapon_ammo_spawn");
- PrintHintTextToAll("%N поставил коробку с патронами.");
- AcceptEntityInput(entity_id, "kill")
- DispatchSpawn(ammo_stack);
- 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