Raised This Month: $ Target: $400
 0% 

Knife Question


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
X-Script
BANNED
Join Date: Jul 2007
Location: (#504434)
Old 09-20-2007 , 07:20   Knife Question
Reply With Quote #1

How would you force someone to use the KNIFE ONLY without stripping there weapons?
X-Script is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 09-20-2007 , 07:49   Re: Knife Question
Reply With Quote #2

1.
Code:
engclient_cmd(id, "weapon_knife");
you must use this in Prethink or CurWeapon. ;)
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
X-Script
BANNED
Join Date: Jul 2007
Location: (#504434)
Old 09-20-2007 , 07:50   Re: Knife Question
Reply With Quote #3

Does it matter if I use it in one rather than the other?
X-Script is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 09-20-2007 , 07:52   Re: Knife Question
Reply With Quote #4

Don't think so...all you must to do is to check if weapon != CSW_KNIFE and do that cmd!
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
X-Script
BANNED
Join Date: Jul 2007
Location: (#504434)
Old 09-20-2007 , 07:54   Re: Knife Question
Reply With Quote #5

Okay thanks Alka.
X-Script is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 09-20-2007 , 12:21   Re: Knife Question
Reply With Quote #6

It'd be better in CurWeapon.
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 09-20-2007 , 14:03   Re: Knife Question
Reply With Quote #7

Alka, that has to be the most inefficient way to do that...Executing a command like that every prethink?

Execute the command once, then alter the pev_weapons bitmask to be ONLY the knife, which would be something like set_pev(id,pev_weapons,CSW_KNIFE);

To safeguard from some workarounds (I think lastinv might be one of them), also hook CurWeapon and test which weapon it is being changed to - if it's not the knife, execute weapon_knife again.
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 09-20-2007 , 14:11   Re: Knife Question
Reply With Quote #8

Whoa lol, i've sayd about CurWeapon too, and how Zenith77 say's the efficient way is CurWeapon, check if weapon read_data(2) != CSW_KNIFE! :/
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-20-2007 , 17:08   Re: Knife Question
Reply With Quote #9

Because you said CurWeapon OR client prethink.

You can register the event with "2!29" so the event will be called only if player weapon is not a knife.
ConnorMcLeod is offline
X-Script
BANNED
Join Date: Jul 2007
Location: (#504434)
Old 09-20-2007 , 17:09   Re: Knife Question
Reply With Quote #10

I'm using prethink, although if that method isn't "good" i'll use curweapon.

Last edited by X-Script; 09-20-2007 at 17:34.
X-Script 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 16:04.


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