AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   killer weapon (https://forums.alliedmods.net/showthread.php?t=56327)

Alka 06-11-2007 14:55

killer weapon
 
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 :wink:

pRED* 06-11-2007 16:23

Re: killer weapon
 
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"

Arkshine 06-11-2007 16:31

Re: killer weapon
 
"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

Alka 06-11-2007 16:43

Re: killer weapon
 
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 :wink:


All times are GMT -4. The time now is 10:38.

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