Raised This Month: $ Target: $400
 0% 

Unlimited-Clips


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
-Acid-
Senior Member
Join Date: Feb 2009
Old 06-12-2009 , 23:04   Unlimited-Clips
Reply With Quote #1

Okay i was looking for a plugin that gives unlimited clips on connect to a player, didnt find out so i decided to create one, but i wanna make sure if the code is good, and well it work at all?? so heres my code......
PHP Code:
/* This plugin will set user clip to unlimited on connect to server. */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#define PLUGIN "Unlimited-Clips"
#define VERSION "1.0"
#define AUTHOR "-Acid-"

#if cellbits == 32
const OFFSET_CLIPAMMO 51
#else
const OFFSET_CLIPAMMO 65
#endif
const OFFSET_LINUX_WEAPONS 4


new const MAXCLIP[] = { -113, -11017, -1303013020253035251220,
10301008303020273030, -150 }

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("HLTV""event_round_start""a""1=0""2=0")
    
register_message(get_user_msgid("CurWeapon"), "message_cur_weapon")
}
public 
message_cur_weapon(msg_idmsg_destmsg_entity)
{
    
    
    
    if (!
is_user_alive(msg_entity) || get_msg_arg_int(1) != 1)
        return;
    
    static 
weaponclip
    weapon 
get_msg_arg_int(2
    
clip get_msg_arg_int(3
    
    
    if (
MAXCLIP[weapon] > 2
    {
        
set_msg_arg_int(3get_msg_argtype(3), MAXCLIP[weapon])
        
        if (
clip 2
        {
            
            static 
wname[32], weapon_ent
            get_weaponname
(weaponwnamesizeof wname 1)
            
weapon_ent fm_find_ent_by_owner(-1wnamemsg_entity)
            
            
            
fm_set_weapon_ammo(weapon_entMAXCLIP[weapon])
        }
    }
}

stock fm_find_ent_by_owner(entity, const classname[], owner)
{
    while ((
entity engfunc(EngFunc_FindEntityByStringentity"classname"classname)) && pev(entitypev_owner) != owner) {}
    
    return 
entity;
}


stock fm_set_weapon_ammo(entityamount)
{
    
set_pdata_int(entityOFFSET_CLIPAMMOamountOFFSET_LINUX_WEAPONS);

So what do u think?? Well it work??.
Thanks in advance!!!
__________________
-Acid- 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 13:52.


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