Raised This Month: $ Target: $400
 0% 

Weapon


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sooN
Veteran Member
Join Date: Apr 2009
Old 07-03-2009 , 22:00   Weapon
Reply With Quote #1

Hello,

I need plugin when the terrorist walk on weapon he can't pick this weapon.

Thanks
__________________
sooN is offline
vato loco [GE-S]
Veteran Member
Join Date: Oct 2006
Location: Germany
Old 07-04-2009 , 02:10   Re: Weapon
Reply With Quote #2

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <cstrike>
#include <fakemeta>

#define PLUGIN "New Plugin"
#define VERSION "1.0"
#define AUTHOR "Author"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_forward(FM_Touch"fw_WeaponTouch")
}

public 
fw_WeaponTouch(iEntid)
{
    if (
is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_T)
    {
        new 
ClName[32]
        
pev(iEntpev_classnameClName31)
        
        if (
equal(ClName"weaponbox") || equal(ClName"armoury_entity") || equal(ClName"grenade"))
            return 
FMRES_SUPERCEDE
    
}
    return 
FMRES_IGNORED

__________________
vato loco [GE-S] is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-04-2009 , 02:19   Re: Weapon
Reply With Quote #3

Better to use engine, and ground nades are weaponbox entities.

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <engine>

#define VERSION "0.0.1"

public plugin_init()
{
    
register_plugin("No Weapon Pick Up"VERSION"ConnorMcLeod")

    
g_pCvarTeamPickUp register_cvar("amx_no_weapon_pickup""1"//0:disabled, 1:Ts, 2:CTs, 3:ALL

    
register_touch("weaponbox""player""WeaponTouch")
    
register_touch("armoury_entity""player""WeaponTouch")
}

public 
WeaponTouch(iEntid)
{
    if( 
_:cs_get_user_team(id) & get_pcvar_num(g_pCvarTeamPickUp) )
    {
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_CONTINUE

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 07-04-2009 , 03:53   Re: Weapon
Reply With Quote #4

Or Ham
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-04-2009 , 03:59   Re: Weapon
Reply With Quote #5

Not really, using engine with register_touch, it avoids extra checks.
__________________
Arkshine is offline
Old 07-04-2009, 05:35
vato loco [GE-S]
This message has been deleted by vato loco [GE-S]. Reason: ...
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 15:36.


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