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

Solved Knife detection


Post New Thread Reply   
 
Thread Tools Display Modes
OneMore
Senior Member
Join Date: Feb 2019
Old 03-29-2019 , 07:54   Re: Knife detection
Reply With Quote #11

Quote:
Originally Posted by McSnaggit View Post
Had that problem too. Edit the thread in advanced mode. Next to title select solved in the dropdown.
Thanks!
OneMore is offline
McSnaggit
Junior Member
Join Date: Feb 2019
Old 04-16-2019 , 08:31   Re: Knife detection
Reply With Quote #12

I have found the StrContains function that can do the trick too. It's like eyal282's solution but a little different.

I use it like so:
PHP Code:
if(StrContains(weapon"knife"false) > -1){
//Weapon was knife

McSnaggit is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 01-06-2021 , 11:23   Re: Knife detection
Reply With Quote #13

PHP Code:

bool IsWeaponKnife
(int weapon)
{
    
char netClass[256];
    
GetEntityNetClass(weaponnetClasssizeof(netClass));
    return 
StrNumEqual(netClass"CKnife"6true);

From this plugin: https://forums.alliedmods.net/showthread.php?t=329478
__________________
Ilusion9 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 05:26.


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