Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sourcemod>
- #include <sdktools>
- public OnPluginStart()
- {
- HookEvent("upgrade_pack_added", Event_UpgradePackAdded);
- }
- public Action:Event_UpgradePackAdded(Handle:event, const String:name[], bool:dontBroadcast)
- {
- new client = GetClientOfUserId(GetEventInt(event, "userid"));
- new upgradeid = GetEventInt(event, "upgradeid");
- if (!IsValidEdict(upgradeid))
- {
- return;
- }
- new m_iPrimaryAmmoType = -1;
- if ((m_iPrimaryAmmoType = GetEntProp(GetPlayerWeaponSlot(client, 0), Prop_Send, "m_iPrimaryAmmoType")) != -1)
- {
- SetEntProp(GetPlayerWeaponSlot(client, 0), Prop_Send, "m_nUpgradedPrimaryAmmoLoaded", 0, 1);
- SetEntProp(GetPlayerWeaponSlot(client, 0), Prop_Send, "m_iAmmo", GetRandomInt(40, 100), _, m_iPrimaryAmmoType);
- RemoveEdict(upgradeid);
- return;
- }
- }
- stock bool:IsClientInGameHuman(client)
- {
- if (client > 0) return IsClientInGame(client) && !IsFakeClient(client);
- else return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment