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

weapon and ammo box


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Admin Commands       
apocalips
Member
Join Date: Aug 2008
Old 02-24-2009 , 16:57   weapon and ammo box
Reply With Quote #1

Description: This plugin creates a box with ammunition and weapons, who touches the box will have bullets and if not the weapon will show automatically a list with some weapons
(that player can have 9 primary weapons )
admins comands "munitie_spawn" create box and "remove" and "removeall" remove box
I modified pluginul now used only amxmodx, amxmisc, fakemeta_util, now can open archive (.zip)

new in new version: new model with animation, open closed, and save the location where it was created

[IMG]http://img509.**************/img509/6531/box.png[/IMG]
Attached Thumbnails
Click image for larger version

Name:	1.JPG
Views:	816
Size:	36.0 KB
ID:	72715   Click image for larger version

Name:	2.JPG
Views:	673
Size:	33.2 KB
ID:	72716  
Attached Files
File Type: sma Get Plugin or Get Source (weapon_box.sma - 1337 views - 13.2 KB)
File Type: zip weapon_box.zip (610.6 KB, 512 views)

Last edited by apocalips; 09-01-2010 at 15:32.
apocalips is offline
Send a message via Yahoo to apocalips
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-24-2009 , 17:09   Re: weapon and ammo box
Reply With Quote #2

Change:
Code:
register_plugin(PLUGIN, AUTHOR, VERSION)

Code:
 register_plugin(PLUGIN, VERSION, AUTHOR)
Also, I can't open .rar files. Need a .zip.
__________________
fysiks is offline
minimiller
Veteran Member
Join Date: Aug 2007
Location: United Kingdom
Old 02-24-2009 , 17:13   Re: weapon and ammo box
Reply With Quote #3

oh dear

Quote:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <fakemeta_util>
#include <fun>
->
Quote:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta_util>
Indent your code better plz
My eyes are bleeding
=[
__________________
minimiller is offline
Send a message via MSN to minimiller
BOYSplayCS
BANNED
Join Date: Apr 2008
Location: Gainesville, FL
Old 02-24-2009 , 17:40   Re: weapon and ammo box
Reply With Quote #4

Here you go:

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta_util>
#include <fakemeta>
#include <fun>

#define PLUGIN "lada cu munitie"
#define AUTHOR "apocalips"
#define VERSION "0.1"

new Enable
new munitieModel[] = "models/munitie.mdl"
new aimVector[3]


public 
plugin_precache()
{
    
precache_model(munitieModel)
}



public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("munitie","lada_munitie",ADMIN_SLAY,"")
    
register_clcmd("remove","delet_munitie",ADMIN_SLAY,"")
    
register_forward(FM_Touch,"fw_touch");
    
register_menucmd(register_menuid("\yweapons:"), 1023"menu_command" );
    
Enable register_cvar("touch_enable""1");
    
set_task(3.0"touch_begin",_,_,_,"b");
    
    
}



public 
lada_munitie(id,level,cid)
{
    if (!
cmd_access(id,level,cid,1)) 
        return 
PLUGIN_HANDLED 
    
    
    
new munitieEnt engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString,"func_wall"));
    
    
    
set_pev(munitieEntpev_classname"munitie");
    
get_user_origin(idaimVector3//where the player is aiming
    
    
new Float:fOrigin[3];
    
IVecFVec(aimVectorfOrigin); //covert aim origin(int) to float.
    
    
set_pev(munitieEntpev_originfOrigin);
    
    
engfunc(EngFunc_SetModelmunitieEntmunitieModel);
    
    
set_pev(munitieEnt,pev_solid,SOLID_BBOX);
    
engfunc(EngFunc_SetSizemunitieEntFloat:{-16.0, -16.0, -16.0}, Float:{16.016.016.0} )
    
    
    
    return 
PLUGIN_HANDLED
}


public 
fw_touch(ent,id)
{
    
    if(
get_pcvar_num(Enable) == 0)
        return 
FMRES_IGNORED;
    
    if(!
pev_valid(ent))
        return 
FMRES_IGNORED;
    
    new 
classname[32]
    
pev(ent,pev_classname,classname,31)
    
    if(!
equal(classname"munitie"))  // check for kit 
        
return FMRES_IGNORED;
    
    
    new 
weapon get_user_weapon(id)
    
    
    switch(
weapon)
    {
        case 
CSW_M4A1,CSW_SG552,CSW_FAMAS,CSW_GALIL,CSW_SG550,CSW_AUGgive_item(id"ammo_556nato"); 
            case 
CSW_XM1014,CSW_M3give_item(id"ammo_buckshot");
            case 
CSW_MAC10,CSW_UMP45give_item(id"ammo_45acp");
            case 
CSW_MP5NAVY,CSW_TMPgive_item(id"ammo_9mm");
            case 
CSW_P90give_item(id"ammo_57mm");
            case 
CSW_AWPgive_item(id"ammo_338magnum");
            case 
CSW_M249give_item(id"ammo_556natobox");
            case 
CSW_G3SG1,CSW_AK47give_item(id"ammo_762nato");
            
        
        
        
        default:
    {
        
        if(
weapon == CSW_DEAGLE,CSW_FIVESEVEN,CSW_KNIFE,CSW_GLOCK18,CSW_ELITE,CSW_P228,CSW_USP
        {
            
            
            switch(
weapon)
            {
                case 
CSW_DEAGLEgive_item(id"ammo_50ae");
                    case 
CSW_P228give_item(id"ammo_357sig");
                        case 
CSW_ELITE,CSW_GLOCK18give_item(id"ammo_9mm");
                        case 
CSW_FIVESEVENgive_item(id"ammo_57mm");
                        case 
CSW_USPgive_item(id"ammo_45acp");
                        
                }
                
                
                
                
                new 
szMenuBody[256];
                new 
keys;
                
                new 
nLen formatszMenuBody255"\yweapons:^n" );
                
nLen += formatszMenuBody[nLen], 255-nLen"^n\w1. xm1014" );
                
nLen += formatszMenuBody[nLen], 255-nLen"^n\w2. aug" );
                
nLen += formatszMenuBody[nLen], 255-nLen"^n\w3. awp" );
                
nLen += formatszMenuBody[nLen], 255-nLen"^n\w4. m249" );
                
nLen += formatszMenuBody[nLen], 255-nLen"^n\w5. m3" );
                
nLen += formatszMenuBody[nLen], 255-nLen"^n\w6. m4a1" );
                
nLen += formatszMenuBody[nLen], 255-nLen"^n\w7. g3sg1" );
                
nLen += formatszMenuBody[nLen], 255-nLen"^n\w8. ak47" );
                
nLen += formatszMenuBody[nLen], 255-nLen"^n\w9. p90" );
                
nLen += formatszMenuBody[nLen], 255-nLen"^n^n\w0. Exit" );
                
                
keys = (1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6|1<<7|1<<8|1<<9)
                
                
show_menuidkeysszMenuBody, -);
                
server_cmd("touch_enable 0")
            }                   
        }
    }
    return 
FMRES_IGNORED;
    
}

public 
menu_command(id,key)
{
    switch( 
key )
    {
        case 
0: { 
            
give_item(id"weapon_xm1014")
            
server_cmd("touch_enable 1")      
        }
        case 
1: { 
            
give_item(id"weapon_aug")
            
server_cmd("touch_enable 1")      
        }
        case 
2: {
            
give_item(id"weapon_awp"
            
server_cmd("touch_enable 1")      
        }       
        case 
3: {
            
give_item(id"weapon_m249"
            
server_cmd("touch_enable 1")     
        }
        case 
4: {
            
give_item(id"weapon_m3")  
            
server_cmd("touch_enable 1")     
        }
        case 
5: {
            
give_item(id"weapon_m4a1"
            
server_cmd("touch_enable 1")      
        }
        case 
6: {
            
give_item(id"weapon_g3sg1"
            
server_cmd("touch_enable 1")     
        }
        case 
7: { 
            
give_item(id"weapon_ak47"
            
server_cmd("touch_enable 1")     
        }
        case 
8: {
            
give_item(id"weapon_p90")
            
server_cmd("touch_enable 1")     
        }
        
    }
}



public 
touch_begin()
{
    
    if(
get_pcvar_num(Enable) ==0)
    {
        
server_cmd("touch_enable 1")
    }
    return 
PLUGIN_HANDLED;
}


public 
delet_munitie(id,level,cid)
{    
    if (!
cmd_access(id,level,cid,1)) 
        return 
PLUGIN_HANDLED 
    
    
new ammo = -1;
    while ((
ammo fm_find_ent_by_class(ammo"munitie")))
        
engfunc(EngFunc_RemoveEntityammo);
    
    return 
FMRES_IGNORED;
    

BOYSplayCS is offline
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 02-24-2009 , 18:22   Re: weapon and ammo box
Reply With Quote #5

RAR file removed. Please attach a ZIP file according to the rules if you want the plugin to be approved. Also, provide a better description about the plugin, the current one is too vague.
__________________

Community / No support through PM
danielkza is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 02-24-2009 , 18:49   Re: weapon and ammo box
Reply With Quote #6

AMXX file removed, do not upload it again. Also, there is really no point in having the SMA in the zip so I removed it as well
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-24-2009 , 19:29   Re: weapon and ammo box
Reply With Quote #7

Quote:
Originally Posted by BOYSplayCS View Post
Here you go:

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta_util>
#include <fakemeta>
#include <fun>
 
#define PLUGIN "lada cu munitie"
#define AUTHOR "apocalips"
#define VERSION "0.1"
 
new Enable
new munitieModel[] = "models/munitie.mdl"
new aimVector[3]
 
 
public 
plugin_precache()
{
    
precache_model(munitieModel)
}
 
 
 
public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("munitie","lada_munitie",ADMIN_SLAY,"")
    
register_clcmd("remove","delet_munitie",ADMIN_SLAY,"")
    
register_forward(FM_Touch,"fw_touch");
    
register_menucmd(register_menuid("\yweapons:"), 1023"menu_command" );
    
Enable register_cvar("touch_enable""1");
    
set_task(3.0"touch_begin",_,_,_,"b");
 
 
}
 
 
 
public 
lada_munitie(id,level,cid)
{
    if (!
cmd_access(id,level,cid,1)) 
        return 
PLUGIN_HANDLED 
 
 
    
new munitieEnt engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString,"func_wall"));
 
 
    
set_pev(munitieEntpev_classname"munitie");
    
get_user_origin(idaimVector3//where the player is aiming
 
    
new Float:fOrigin[3];
    
IVecFVec(aimVectorfOrigin); //covert aim origin(int) to float.
 
    
set_pev(munitieEntpev_originfOrigin);
 
    
engfunc(EngFunc_SetModelmunitieEntmunitieModel);
 
    
set_pev(munitieEnt,pev_solid,SOLID_BBOX);
    
engfunc(EngFunc_SetSizemunitieEntFloat:{-16.0, -16.0, -16.0}, Float:{16.016.016.0} )
 
 
 
    return 
PLUGIN_HANDLED
}
 
 
public 
fw_touch(ent,id)
{
 
    if(
get_pcvar_num(Enable) == 0)
        return 
FMRES_IGNORED;
 
    if(!
pev_valid(ent))
        return 
FMRES_IGNORED;
 
    new 
classname[32]
    
pev(ent,pev_classname,classname,31)
 
    if(!
equal(classname"munitie"))  // check for kit 
        
return FMRES_IGNORED;
 
 
    new 
weapon get_user_weapon(id)
 
 
    switch(
weapon)
    {
        case 
CSW_M4A1,CSW_SG552,CSW_FAMAS,CSW_GALIL,CSW_SG550,CSW_AUGgive_item(id"ammo_556nato"); 
            case 
CSW_XM1014,CSW_M3give_item(id"ammo_buckshot");
            case 
CSW_MAC10,CSW_UMP45give_item(id"ammo_45acp");
            case 
CSW_MP5NAVY,CSW_TMPgive_item(id"ammo_9mm");
            case 
CSW_P90give_item(id"ammo_57mm");
            case 
CSW_AWPgive_item(id"ammo_338magnum");
            case 
CSW_M249give_item(id"ammo_556natobox");
            case 
CSW_G3SG1,CSW_AK47give_item(id"ammo_762nato");
 
 
 
 
        default:
    {
 
        if(
weapon == CSW_DEAGLE,CSW_FIVESEVEN,CSW_KNIFE,CSW_GLOCK18,CSW_ELITE,CSW_P228,CSW_USP
        {
 
 
            switch(
weapon)
            {
                case 
CSW_DEAGLEgive_item(id"ammo_50ae");
                    case 
CSW_P228give_item(id"ammo_357sig");
                        case 
CSW_ELITE,CSW_GLOCK18give_item(id"ammo_9mm");
                        case 
CSW_FIVESEVENgive_item(id"ammo_57mm");
                        case 
CSW_USPgive_item(id"ammo_45acp");
 
                }
 
 
 
 
                new 
szMenuBody[256];
                new 
keys;
 
                new 
nLen formatszMenuBody255"\yweapons:^n" );
                
nLen += formatszMenuBody[nLen], 255-nLen"^n\w1. xm1014" );
                
nLen += formatszMenuBody[nLen], 255-nLen"^n\w2. aug" );
                
nLen += formatszMenuBody[nLen], 255-nLen"^n\w3. awp" );
                
nLen += formatszMenuBody[nLen], 255-nLen"^n\w4. m249" );
                
nLen += formatszMenuBody[nLen], 255-nLen"^n\w5. m3" );
                
nLen += formatszMenuBody[nLen], 255-nLen"^n\w6. m4a1" );
                
nLen += formatszMenuBody[nLen], 255-nLen"^n\w7. g3sg1" );
                
nLen += formatszMenuBody[nLen], 255-nLen"^n\w8. ak47" );
                
nLen += formatszMenuBody[nLen], 255-nLen"^n\w9. p90" );
                
nLen += formatszMenuBody[nLen], 255-nLen"^n^n\w0. Exit" );
 
                
keys = (1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6|1<<7|1<<8|1<<9)
 
                
show_menuidkeysszMenuBody, -);
                
server_cmd("touch_enable 0")
            }                   
        }
    }
    return 
FMRES_IGNORED;
 
}
 
public 
menu_command(id,key)
{
    switch( 
key )
    {
        case 
0: { 
            
give_item(id"weapon_xm1014")
            
server_cmd("touch_enable 1")      
        }
        case 
1: { 
            
give_item(id"weapon_aug")
            
server_cmd("touch_enable 1")      
        }
        case 
2: {
            
give_item(id"weapon_awp"
            
server_cmd("touch_enable 1")      
        }       
        case 
3: {
            
give_item(id"weapon_m249"
            
server_cmd("touch_enable 1")     
        }
        case 
4: {
            
give_item(id"weapon_m3")  
            
server_cmd("touch_enable 1")     
        }
        case 
5: {
            
give_item(id"weapon_m4a1"
            
server_cmd("touch_enable 1")      
        }
        case 
6: {
            
give_item(id"weapon_g3sg1"
            
server_cmd("touch_enable 1")     
        }
        case 
7: { 
            
give_item(id"weapon_ak47"
            
server_cmd("touch_enable 1")     
        }
        case 
8: {
            
give_item(id"weapon_p90")
            
server_cmd("touch_enable 1")     
        }
 
    }
}
 
 
 
public 
touch_begin()
{
 
    if(
get_pcvar_num(Enable) ==0)
    {
        
server_cmd("touch_enable 1")
    }
    return 
PLUGIN_HANDLED;
}
 
 
public 
delet_munitie(id,level,cid)
{    
    if (!
cmd_access(id,level,cid,1)) 
        return 
PLUGIN_HANDLED 
 
    
new ammo = -1;
    while ((
ammo fm_find_ent_by_class(ammo"munitie")))
        
engfunc(EngFunc_RemoveEntityammo);
 
    return 
FMRES_IGNORED;
 

This doensn't use tabs , or the forums replace tabs with spaces. If so, it will have to be done by the author if he chooses to do so .
__________________
fysiks is offline
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 02-25-2009 , 00:30   Re: weapon and ammo box
Reply With Quote #8

wtf?

I,m from Romania too, but change the name of zip and name of plugin

Code:
#define PLUGIN "lada cu munitie"
into
Code:
ammo box
and change the zip file name into ammobox.zip because some peoples doesn't understand.. you must use the descriptive names and titles...

RO: ma, si un prieten hip_hop_x a avut un plugin si comenzile din el in romana.... si numele la plugin tot in romana, si un moderator i-a dat unaprove ca nu a avut titlu descriptiv, si na,, ..Aici tot ar trebui sa postezi in engleza, ca nu e greu
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 02-26-2009 , 08:15   Re: weapon and ammo box
Reply With Quote #9

@Minimiller, why you said that he should not include fakemeta? It's just a same, cause fakemeta_util includes it anyway if it's not already included.
OT: @danielkza, nice title: AMX Mod X Plugin Approver and karma lvl increased too GZ!
SnoW is offline
Send a message via MSN to SnoW
minimiller
Veteran Member
Join Date: Aug 2007
Location: United Kingdom
Old 02-26-2009 , 08:41   Re: weapon and ammo box
Reply With Quote #10

Quote:
Originally Posted by SnoW View Post
@Minimiller, why you said that he should not include fakemeta? It's just a same, cause fakemeta_util includes it anyway if it's not already included.
OT: @danielkza, nice title: AMX Mod X Plugin Approver and karma lvl increased too GZ!
exactly my point
there no point including both fakemeta and fakemeta_util
Tidy code = happy people
__________________
minimiller is offline
Send a message via MSN to minimiller
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 01:31.


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