Raised This Month: $51 Target: $400
 12% 

[TF2] Unlimited Ammo


Post New Thread Reply   
 
Thread Tools Display Modes
Author
SilentLikeSilence
Senior Member
Join Date: Jul 2009
Plugin ID:
1517
Plugin Version:
1.0.0
Plugin Category:
Gameplay
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Plugin runs a timer which refills players' ammo
    Old 03-12-2010 , 12:26   [TF2] Unlimited Ammo
    Reply With Quote #1

    [TF2] Unlimited Ammo

    Installation:
    Put unlimited_ammo.smx into /tf/addons/sourcemod/plugins/.

    Cvars:
    • sm_unlimitedammo_enable
    • sm_unlimitedammo_adminonly

    Cfg is automatically created on the first run in /tf/cfg/sourcemod/.

    Other version: 641 downloads
    Attached Files
    File Type: sp Get Plugin or Get Source (unlimited_ammo_2.0.5.sp - 15363 views - 2.7 KB)

    Last edited by SilentLikeSilence; 06-02-2010 at 14:24.
    SilentLikeSilence is offline
    desynced
    Member
    Join Date: Feb 2010
    Old 03-13-2010 , 13:27   Re: [TF2] Unlimited Ammo
    Reply With Quote #2

    Installed it on my idle server to test it and it works just fine. No bugs after a couple hours.
    desynced is offline
    Cooltad
    Veteran Member
    Join Date: Apr 2008
    Old 03-13-2010 , 15:25   Re: [TF2] Unlimited Ammo
    Reply With Quote #3

    Here's a version I use for one of my servers that adds a few checks (needed checks)
    I should make it known that none of this is from the auther's code, this was made some months ago.
    Code:
    #pragma semicolon 1
    #include <sourcemod>
    #include <sdkhooks>
    #define PLUGIN_VERSION "1.0.0.3"
    
    //infandor
    new bool:roundend=false;
    new String:strDate[5];
    new ActiveWeapon;
    
    public Plugin:myinfo = {
        name = "Infinite Ammo",
        author = "Cooltad",
        description = "gives all players infinite ammo.",
        version = PLUGIN_VERSION,
        url = "www.thetoptiers.com"
    };
    
    public OnPluginStart()
    {
        for (new client=1;client<=MaxClients;client++)
        {
            if (IsClientInGame(client))
            {
                SDKHook(client, SDKHook_PreThink, OnPreThink);
            }
        }
        HookEvent("teamplay_round_win", Event_RoundEnd, EventHookMode_PostNoCopy);
        HookEvent("teamplay_round_active", Event_RoundStart, EventHookMode_PostNoCopy);
    }
    
    public OnClientPostAdminCheck(client)
    {
        SDKHook(client, SDKHook_PreThink, OnPreThink);
    }
    
    public OnPreThink(client)
    {
        if (!roundend)
        {
            for(client=0;client<=MaxClients;client++)
            {
                if(IsValidEntity(client))
                {
                    ActiveWeapon=GetEntDataEnt2(client,FindSendPropOffs("CTFPlayer", "m_hActiveWeapon"));
                    if(IsValidEntity(ActiveWeapon))
                    {
                        SetEntData(ActiveWeapon,FindSendPropOffs("CBaseCombatWeapon", "m_iClip1"),5,4);
                        SetEntData(client,FindSendPropOffs("CTFPlayer", "m_iAmmo")+4,5,4);
                        SetEntData(client,FindSendPropOffs("CTFPlayer", "m_iAmmo")+8,5,4);
                    }
                }
            }
        }
    }
    
    public Event_RoundEnd(Handle:event,const String:name[],bool:dontBroadcast)
    {
        roundend=true;
    }
    
    public Event_RoundStart(Handle:event,const String:name[],bool:dontBroadcast)
    {
        roundend=false;
    }
    The author's code would eventually crash a server, this one doesn't.
    If you're wondering why, it's because 1=client, 0=weapon, he assigns i=1, which is incorrect.

    I should also say this code is originally made for infinite clip, not just ammo. But I removed the clip part and left the ammo part.
    __________________
    Please, give me some rep if you found what I posted useful. :]

    Last edited by Cooltad; 03-13-2010 at 19:26.
    Cooltad is offline
    Thalion
    Member
    Join Date: Oct 2009
    Location: Mount Dora, Florida, USA
    Old 03-22-2010 , 17:44   Re: [TF2] Unlimited Ammo
    Reply With Quote #4

    This doesn't have a cvar to enable/disable it right? If not.. you should put one.
    __________________

    Thalion is offline
    Send a message via AIM to Thalion Send a message via MSN to Thalion Send a message via Yahoo to Thalion
    Geek_Loco
    SourceMod Donor
    Join Date: May 2009
    Old 03-23-2010 , 04:16   Re: [TF2] Unlimited Ammo
    Reply With Quote #5

    Great, just great! SDKHooks?:

    Code:
    //// tf2_UnlimitedAmmo-CoolTad_v10.sp
    // C:\Valve\tf2\orangebox\tf\addons\sourcemod\scripting\tf2_UnlimitedAmmo-CoolTad_v10.sp(3) : fatal error 120: cannot read from file: "sdkhooks"
    //
    // Compilation aborted.
    // 1 Error.
    Geek_Loco is offline
    REDSCOUT
    Member
    Join Date: Sep 2009
    Old 03-26-2010 , 23:00   Re: [TF2] Unlimited Ammo
    Reply With Quote #6

    Is there a way you can create this plugin for L4D Games??? I am really eager to see it for L4D or L4D2!!!
    REDSCOUT is offline
    SilentLikeSilence
    Senior Member
    Join Date: Jul 2009
    Old 03-27-2010 , 12:24   Re: [TF2] Unlimited Ammo
    Reply With Quote #7

    In order

    1, I will add one

    2, You can't use the webcompiler to recompile that script because it uses SDK Hooks, download latest sourcemod and do the compillation in your own scripting folder with compile.exe

    3, Gonna take a look in L4D and L4D2 offsets

    Sorry for the lately answer.
    SilentLikeSilence is offline
    REDSCOUT
    Member
    Join Date: Sep 2009
    Old 03-30-2010 , 05:32   Re: [TF2] Unlimited Ammo
    Reply With Quote #8

    I LOVE THIS PLUGIN!!! IT WORKS FOR MY TF2 SERVER!!!! ☺☺☺☻☻☻ THIS IS SOOOO AWESOME!!! THX!!!!!!
    REDSCOUT is offline
    REDSCOUT
    Member
    Join Date: Sep 2009
    Old 04-02-2010 , 04:14   Re: [TF2] Unlimited Ammo
    Reply With Quote #9

    I LOVE HAVING UAMMO!!! >
    REDSCOUT is offline
    SilentLikeSilence
    Senior Member
    Join Date: Jul 2009
    Old 04-02-2010 , 04:45   Re: Unlimited Ammo
    Reply With Quote #10

    Okay, it should work with l4d games too. Could you test it? Because I don't have l4d servers.

    Thanks, John
    SilentLikeSilence is offline
    Reply



    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 19:41.


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