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

[REQ] Disarm,Bury,RemoveDroppedWeapon on Player(s) at round end


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fang
Senior Member
Join Date: Nov 2007
Location: New Jersey
Old 04-20-2009 , 16:01   [REQ] Disarm,Bury,RemoveDroppedWeapon on Player(s) at round end
Reply With Quote #1

As the title says I'm looking for something that buries and disarms a player at the round's end.

Untested coding but there probably is a better method than this.

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>


#define PLUGIN "Omg Disarm And Bury!!"
#define VERSION "1.0"
#define AUTHOR "Super Central Coding Stuck together by Fang D:?"

//Disarm Code Credited to SuperCentral

new weapons[33][] = {
    
"weapon_usp",
    
"weapon_glock18",
    
"weapon_deagle",
    
"weapon_p228",
    
"weapon_elite",
    
"weapon_fiveseven",
    
"weapon_m3",
    
"weapon_xm1014",
    
"weapon_tmp",
    
"weapon_mac10",
    
"weapon_mp5navy",
    
"weapon_p90",
    
"weapon_ump45",
    
"weapon_famas",
    
"weapon_galil",
    
"weapon_ak47",
    
"weapon_m4a1",
    
"weapon_sg552",
    
"weapon_aug",
    
"weapon_scout",
    
"weapon_sg550",
    
"weapon_awp",
    
"weapon_g3sg1",
    
"weapon_m249",
    
"weapon_hegrenade",
    
"weapon_smokegrenade",
    
"weapon_flashbang",
    
"weapon_shield",
    
"weapon_c4",
    
"weapon_knife",
    
"item_kevlar",
    
"item_assaultsuit",
    
"item_thighpack"
}

enum {
    
WEAPON_USP,
    
WEAPON_GLOCK18,
    
WEAPON_DEAGLE,
    
WEAPON_P228,
    
WEAPON_ELITE,
    
WEAPON_FIVESEVEN,
    
WEAPON_M3,
    
WEAPON_XM1014,
    
WEAPON_TMP,
    
WEAPON_MAC10,
    
WEAPON_MP5NAVY,
    
WEAPON_P90,
    
WEAPON_UMP45,
    
WEAPON_FAMAS,
    
WEAPON_GALIL,
    
WEAPON_AK47,
    
WEAPON_M4A1,
    
WEAPON_SG552,
    
WEAPON_AUG,
    
WEAPON_SCOUT,
    
WEAPON_SG550,
    
WEAPON_AWP,
    
WEAPON_G3SG1,
    
WEAPON_M249,
    
WEAPON_HEGRENADE,
    
WEAPON_SMOKEGRENADE,
    
WEAPON_FLASHBANG,
    
WEAPON_SHIELD,
    
WEAPON_C4,
    
WEAPON_KNIFE,
    
ITEM_KEVLAR,
    
ITEM_ASSAULTSUIT,
    
ITEM_THIGHPACK
}


public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_logevent("round_end"2"1=Round_End")  
}

public 
round_end(id) {
    
//Taken from AMX SUPER but untested. (Will this work?)
    
new origin[3]

    
get_user_origin(id,origin)
    
origin[2] -= 2000
    fm_set_user_origin
(id,origin)

    new 
iweapons[32], wpname[32], inum
    get_user_weapons
(id,iweapons,inum)

    for(new 
a=0;a<inum;++a){

        
get_weaponname(iweapons[a],wpname,31)
        
engclient_cmd(id,"drop",wpname)
        
engfunc(EngFunc_RemoveEntitywpname)
    }

    
engclient_cmd(id,weapons[WEAPON_KNIFE])
}


//Stocks from AMX SUPER
stock fm_set_user_origin(index/* const */ origin[3]) {
    new 
Float:orig[3]
    
IVecFVec(originorig)

    return 
fm_entity_set_origin(indexorig)
}
stock fm_entity_set_origin(index, const Float:origin[3]) {
    new 
Float:mins[3], Float:maxs[3]
    
pev(indexpev_minsmins)
    
pev(indexpev_maxsmaxs)
    
engfunc(EngFunc_SetSizeindexminsmaxs)

    return 
engfunc(EngFunc_SetOriginindexorigin)


Last edited by fang; 04-20-2009 at 16:07.
fang is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-20-2009 , 18:29   Re: [REQ] Disarm,Bury,RemoveDroppedWeapon on Player(s) at round end
Reply With Quote #2

Try something that :

Code:
#include <amxmodx> #include <fun> new gMaxClients; public plugin_init() {     register_plugin( "", "", "" )     register_logevent( "Event_RoundEnd", 2, "1=Round_End" );     gMaxClients = get_maxplayers(); } public Event_RoundEnd () {     new Origin[ 3 ];         for ( new id = 1; id <= gMaxClients; id++ )  if ( is_user_alive( id ) )     {         strip_user_weapons( id );         give_item( id, "weapon_knife" );                 get_user_origin( id, Origin );         Origin[ 2 ] -= 45;         set_user_origin( id, Origin );     } }
Arkshine is offline
fang
Senior Member
Join Date: Nov 2007
Location: New Jersey
Old 04-20-2009 , 18:29   Re: [REQ] Disarm,Bury,RemoveDroppedWeapon on Player(s) at round end
Reply With Quote #3

Tyvm arkshine. I'll test this out now.
fang 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 00:36.


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