Raised This Month: $ Target: $400
 0% 

infinite ammo


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
CodeMaster
Junior Member
Join Date: Dec 2008
Old 12-24-2008 , 07:35   Re: infinite ammo
Reply With Quote #2

Here it is:
Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta>
#include <fakemeta_util>

#define PLUGIN "Infinite Ammo"
#define VERSION "1.0"
#define AUTHOR "CodeMaster"

new max_ammo[30] = {13,0,10,0,7,0,30,30,0,30,20,25,30,35,25,12,20,10,30,100,8,30,30,20,0,7,30,30,0,50}

public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    register_forward(FM_PlayerPreThink,"hook_prethink")
}

public hook_prethink(id) {
    if(is_user_alive(id)) {
        new weapon_id = get_user_weapon(id)
        if(weapon_id != CSW_C4 && weapon_id != CSW_KNIFE && weapon_id != CSW_HEGRENADE && weapon_id != CSW_FLASHBANG && weapon_id != CSW_SMOKEGRENADE) {    
            new weapon = fm_get_user_weapon_entity(id)
            cs_set_weapon_ammo(weapon,max_ammo[weapon_id - 1])
        }
    }
    return FMRES_HANDLED
}
I've did it from my own curiosity about how would it work, but it took me some time. Its tested and it works fine. If you are curios how does it work feel free to ask.
BTW: It needs fakemeta_util by VEN. You can find it here http://forums.alliedmods.net/showthread.php?t=28284

+karma if you respect my time ;)

Cheers ;)

Nidza
__________________
+karma me if you found me useful
[60% -- ||||||||||] Learning AMXModX functions for better adaption to AMXModX Pawn
[100% - ||||||||||] Pawn Readaptation


Last edited by YamiKaitou; 12-24-2008 at 15:48.
CodeMaster 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 09:15.


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