Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sourcemod>
- #include <sdktools>
- #pragma tabsize 0
- public OnPluginStart()
- {
- HookEvent("ammo_pickup", Event_ItemPickup, EventHookMode_Pre)
- }
- public Action:Event_ItemPickup(Handle:event, const String:name[], bool:dontBroadcast)
- {
- new client = GetClientOfUserId(GetEventInt(event, "userid"))
- if (!client || !IsClientInGame(client)) return Plugin_Continue;
- new weaponIndex = GetPlayerWeaponSlot(client, 0);
- if(weaponIndex == -1)
- return Plugin_Continue;
- new String:classname[64];
- GetEdictClassname(weaponIndex, classname, sizeof(classname));
- if(StrEqual(classname, "weapon_grenade_launcher"))
- {
- new iPrimType = GetEntProp(weaponIndex, Prop_Send, "m_iPrimaryAmmoType");
- SetEntProp(client, Prop_Send, "m_iAmmo", 7, _, iPrimType);
- }
- return Plugin_Continue;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement