Raised This Month: $32 Target: $400
 8% 

Events request [SOLVED!]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 08-27-2008 , 12:40   Events request [SOLVED!]
Reply With Quote #1

Hi.
I need an event when a player drops a weapon.
Thanks
__________________


Last edited by anakin_cstrike; 08-28-2008 at 10:33.
anakin_cstrike is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-27-2008 , 12:54   Re: Events request
Reply With Quote #2

Hooking 'drop' command ?
__________________
Arkshine is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 08-27-2008 , 13:00   Re: Events request
Reply With Quote #3

Quote:
Originally Posted by arkshine View Post
Hooking 'drop' command ?
I want to check the 'entity' droped...if is not a grenade for example..read_data(2) ?
__________________

anakin_cstrike is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 08-27-2008 , 15:35   Re: Events request
Reply With Quote #4

register_forward(FM_SetModel, "fwd_SetModel", 0) - Hook when a model is spawned, check if model contains weapon/... and you can make an extra check, classname, weaponbox.
Alka is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 08-27-2008 , 16:05   Re: Events request
Reply With Quote #5

Quote:
Originally Posted by Alka View Post
register_forward(FM_SetModel, "fwd_SetModel", 0) - Hook when a model is spawned, check if model contains weapon/... and you can make an extra check, classname, weaponbox.
I know...but how to check the weapon droped ?
__________________

anakin_cstrike is offline
PrEn1umz
Junior Member
Join Date: Feb 2007
Location: Nice, France
Old 08-27-2008 , 21:23   Re: Events request
Reply With Quote #6

not sure.

Code:
#include <amxmodx>
#include <fakemeta>

public plugin_init()
{
    register_plugin("Drop Weapon Catcher", "0.1.a", "PrEn1umz");
    register_forward(FM_SetModel, "Forward_SetModel");
}

public Forward_SetModel(id, model[])
{    
    if (!pev_valid(id) || !strlen(model))
        return;
    
    static szClassname[33];
    pev(id, pev_classname, szClassname, 32);
}
PrEn1umz is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 08-27-2008 , 21:34   Re: Events request
Reply With Quote #7

@ PrEn1umz : it's something like this:
PHP Code:
public fw_setmodel(ent,const model[])
{
    if(!
pev_valid(ent))
        return 
FMRES_IGNORED;
    static 
classname[32]
    
pev(ent,pev_classname,classname,31);
    if(!
strcmp(classname"weaponbox") || !strcmp(classname"armoury_entity") || !strcmp(classname"grenade"))
    {
        
// change model
        
return FMRES_SUPERCEDE;
    }
    
    return 
FMRES_IGNORED;

but is not what i'm looking for...i want an event/function when a player has drop a weapon...and check if the weapon is x for example.
__________________

anakin_cstrike is offline
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 08-27-2008 , 22:22   Re: Events request
Reply With Quote #8

HamSandwich - Ham_Item_Drop - Look at includes\ham_const.inc
danielkza is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 08-28-2008 , 02:42   Re: Events request
Reply With Quote #9

Oh gawd anakin, look here -> http://forums.alliedmods.net/showthr...ghlight=weapon like i said.
Alka is offline
anakin_cstrike
Veteran Member
Join Date: Nov 2007
Location: Romania
Old 08-28-2008 , 03:35   Re: Events request
Reply With Quote #10

I know, i know.. thank you.
__________________

anakin_cstrike 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 01:51.


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