Raised This Month: $ Target: $400
 0% 

Help with Simple Script Edit


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kitami
Senior Member
Join Date: Jun 2006
Location: Toronto
Old 08-09-2008 , 02:16   Help with Simple Script Edit
Reply With Quote #1

This script is to give admins an awp with full bullets and take away any primary weapons, I was wondering if someone could edit this to make it give you an m4, and another one to give you an ak47

example
amx_m4me
amx_akme


PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#include <fakemeta>
 
#define PLUGIN    "Test"
#define AUTHOR    "Jim"
#define VERSION    "1.0"
 
#define ACCESS_FLAG ADMIN_VOTE
 
new const pri[18] =
{
    
CSW_AK47,
    
CSW_AUG,
    
CSW_AWP,
    
CSW_FAMAS,
    
CSW_G3SG1,
    
CSW_GALI,
    
CSW_M249,
    
CSW_M3,
    
CSW_M4A1,
    
CSW_MAC10,
    
CSW_MP5NAVY,
    
CSW_P90,
    
CSW_SCOUT,
    
CSW_SG550,
    
CSW_SG552,
    
CSW_TMP,
    
CSW_UMP45,
    
CSW_XM1014
}
 
public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("amx_awpme""give_awp"ACCESS_FLAG"give an awp")
}
 
public 
give_awp(idlvlcid)
{
    if(!
cmd_access(idlvlcid1))
        return 
PLUGIN_HANDLED
    
    
if(is_user_alive(id))
    {
        new 
weapons pev(idpev_weapons) & ~(1<<31)
        for(new 
i18; ++i)
        {
            if(
weapons & (1<<pri[i]))
            {
                new 
wpname[20]
                
get_weaponname(pri[i], wpname19)
                
engclient_cmd(id"drop"wpname)
                break
            }
        }
        
        
give_item(id"weapon_awp")
        
cs_set_user_bpammo(idCSW_AWP30
    }
    return 
PLUGIN_HANDLED

__________________
You know what I'd like to be? I mean if I had my goddamn choice, I'd just be the catcher in the rye and all.
Kitami is offline
PvtSmithFSSF
Senior Member
Join Date: Jul 2008
Old 08-09-2008 , 09:21   Re: Help with Simple Script Edit
Reply With Quote #2

untested:

m4a1:
Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#include <fakemeta>
 
#define PLUGIN    "Test"
#define AUTHOR    "Jim"
#define VERSION    "1.0"
 
#define ACCESS_FLAG ADMIN_VOTE
 
new const pri[18] =
{
    CSW_AK47,
    CSW_AUG,
    CSW_AWP,
    CSW_FAMAS,
    CSW_G3SG1,
    CSW_GALI,
    CSW_M249,
    CSW_M3,
    CSW_M4A1,
    CSW_MAC10,
    CSW_MP5NAVY,
    CSW_P90,
    CSW_SCOUT,
    CSW_SG550,
    CSW_SG552,
    CSW_TMP,
    CSW_UMP45,
    CSW_XM1014
}
 
public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_clcmd("amx_m4me", "give_m4", ACCESS_FLAG, "give an awp")
}
 
public give_m4(id, lvl, cid)
{
    if(!cmd_access(id, lvl, cid, 1))
        return PLUGIN_HANDLED
    
    if(is_user_alive(id))
    {
        new weapons = pev(id, pev_weapons) & ~(1<<31)
        for(new i; i < 18; ++i)
        {
            if(weapons & (1<<pri[i]))
            {
                new wpname[20]
                get_weaponname(pri[i], wpname, 19)
                engclient_cmd(id, "drop", wpname)
                break
            }
        }
        
        give_item(id, "weapon_m4")
        cs_set_user_bpammo(id, CSW_M4A1, 90) 
    }
    return PLUGIN_HANDLED
}  



ak47:
Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#include <fakemeta>
 
#define PLUGIN    "Test"
#define AUTHOR    "Jim"
#define VERSION    "1.0"
 
#define ACCESS_FLAG ADMIN_VOTE
 
new const pri[18] =
{
    CSW_AK47,
    CSW_AUG,
    CSW_AWP,
    CSW_FAMAS,
    CSW_G3SG1,
    CSW_GALI,
    CSW_M249,
    CSW_M3,
    CSW_M4A1,
    CSW_MAC10,
    CSW_MP5NAVY,
    CSW_P90,
    CSW_SCOUT,
    CSW_SG550,
    CSW_SG552,
    CSW_TMP,
    CSW_UMP45,
    CSW_XM1014
}
 
public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_clcmd("amx_akme", "give_ak", ACCESS_FLAG, "give an ak")
}
 
public give_ak(id, lvl, cid)
{
    if(!cmd_access(id, lvl, cid, 1))
        return PLUGIN_HANDLED
    
    if(is_user_alive(id))
    {
        new weapons = pev(id, pev_weapons) & ~(1<<31)
        for(new i; i < 18; ++i)
        {
            if(weapons & (1<<pri[i]))
            {
                new wpname[20]
                get_weaponname(pri[i], wpname, 19)
                engclient_cmd(id, "drop", wpname)
                break
            }
        }
        
        give_item(id, "weapon_ak47")
        cs_set_user_bpammo(id, CSW_AK47, 90) 
    }
    return PLUGIN_HANDLED
} 
Not sure if they'll work?
PvtSmithFSSF is offline
Reply


Thread Tools
Display Modes

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 05:34.


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