AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   uammol4d.sp (https://forums.alliedmods.net/showthread.php?t=191614)

K o T 07-31-2012 18:34

uammol4d.sp
 
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;



K o T 08-08-2012 13:50

Re: uammol4d.sp
 
Molotov / Pipe Bomb / Bile Bomb unrestrictedly how to make


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

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