Raised This Month: $ Target: $400
 0% 

uammol4d.sp


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
K o T
Senior Member
Join Date: Jan 2011
Old 07-31-2012 , 18:34   uammol4d.sp
Reply With Quote #1

one can redact that pipe bomb thrown implement Molotov infinite how ammo - ammunition

PHP Code:
#include <sourcemod>

new hCurrent_Weapon;
new 
iClip;
new 
Handle:sm_uammo_enabled INVALID_HANDLE;

public 
Plugin:myinfo =
{
    
name "Custom U-Ammo for Left 4 Dead",
    
author "4nt1h4cker",
    
description "Unlimited Ammo for Weapons, NOT pipe_bomb, first_aid_kit etc.",
    
version "1.1",
    
url ""
};

public 
OnPluginStart()
{
    
hCurrent_Weapon FindSendPropOffs"CTerrorPlayer""m_hActiveWeapon");
    
iClip FindSendPropInfo("CBaseCombatWeapon""m_iClip1");

    
// Config
    
sm_uammo_enabled CreateConVar("sm_uammo_enabled""1""Unlimited Ammo Enable");
    
AutoExecConfig(true"plugin_uammo");

    
HookEvent ("weapon_fire"Event_WeaponFire)
}

public 
Action:Event_WeaponFire (Handle:event, const String:name[], bool:dontBroadcast)
{
    if(!
GetConVarBool(sm_uammo_enabled))
    {
        return 
Plugin_Continue;
    }

    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    new 
iWeapon GetEntDataEnt2(clienthCurrent_Weapon);
    new 
iAmmo GetEntData(iWeaponiClip);
    new 
fired GetEventInt(event"count");

    if( (
iAmmo > -1) && (fired 0) ) // This is the fix
    
{
        
SetEntData(iWeaponiClipiAmmo+14true);
    }

    return 
Plugin_Continue;


Last edited by K o T; 07-31-2012 at 18:41.
K o T is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:53.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode