Raised This Month: $ Target: $400
 0% 

killer weapon


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 06-11-2007 , 14:55   killer weapon
Reply With Quote #1

Hi.I have this code but not working...for some reasons! . If killer weapon is CSW_HEGRENADE, plugin return _HANDLED!

Code:
public _death_msg() {  new killer = read_data(1)  new victim = read_data(2)  new wpn = read_data(4)    if(!is_user_connected(killer) || !is_user_connected(victim))   return 1; // ->    if(wpn == CSW_HEGRENADE)   return 1; // reutrn _HANDLED    client_print(victim,"Wow you have been killed with an weapon!") //Just an e.g :/  return 0; }

Thanks
__________________
Still...lovin' . Connor noob! Hello

Last edited by Alka; 06-11-2007 at 14:57.
Alka is offline
pRED*
Join Date: Dec 2006
Old 06-11-2007 , 16:23   Re: killer weapon
Reply With Quote #2

Name: DeathMsg Structure: byte KillerID byte VictimID byte IsHeadshot string TruncatedWeaponName
The 4th data parameter is the weapon name as a string..
Try using get_user_weapon or compare the strings. pretty sure HE is "grenade"
pRED* is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-11-2007 , 16:31   Re: killer weapon
Reply With Quote #3

"Note: For grenade kill TruncatedWeaponName isn't "hegrenade" but "grenade", in fact it's an actual classname of a throwed grenade."

http://wiki.alliedmods.net/Half-Life...vents#DeathMsg
__________________
Arkshine is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 06-11-2007 , 16:43   Re: killer weapon
Reply With Quote #4

Heh thanks !solved with

Code:
 new kweapon[32]
 read_data(4,kweapon,31)
 
 if(equali(kweapon,"grenade"))
  return 1;
EDIT:Lol thanks arkshine too but solved
__________________
Still...lovin' . Connor noob! Hello
Alka 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 10:38.


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