Raised This Month: $ Target: $400
 0% 

Weapon function


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Bruno
Member
Join Date: Jun 2005
Old 12-20-2005 , 19:47   Weapon function
Reply With Quote #1

user_has_weapon ( index, weapon, [ setweapon ] )
How can I check if a player is carrying a weapon or not? (not what weapon or anything, just something that tells me when they are carrying a weapon and when they are not)
Bruno is offline
Dizzy
Veteran Member
Join Date: Jun 2004
Location: Massachusetts
Old 12-20-2005 , 19:56  
Reply With Quote #2

Code:
if (user_has_weapon(id, weapon, [setweapon]))     {         script here...     }

Correct me if I'm wrong...
__________________
My Plugins

Purchase Mod - Stable
Type Sounds - Stable
Monster Spawner - Stable
Nade Giver - Maintenance
Dizzy is offline
Send a message via AIM to Dizzy
Bruno
Member
Join Date: Jun 2005
Old 12-20-2005 , 20:08  
Reply With Quote #3

so if i do this
Code:
 if (user_has_weapon(id, weapon, [setweapon]))     {         client_print...     }

It will only print when he has a weapon? (of course when I put it so the server checks every x seconds)

And how do I define weapon and set weapon?

new weapon, setweapon?
Bruno is offline
Bruno
Member
Join Date: Jun 2005
Old 12-20-2005 , 20:25  
Reply With Quote #4

Putting new setweapon does not work. Someone please explain to me how that function works?
Bruno is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 12-20-2005 , 21:13  
Reply With Quote #5

register the event "CurWeapon" and then do a check if they are carrying the weapon

Code:
new  Ammo , Clip, WepIdx = get_user_weapon( id , Ammo , Clip ) if( WepIdx == CSW_KNIFE ) {     //They are holding knife } return PLUGIN_CONTINUE
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
Bruno
Member
Join Date: Jun 2005
Old 12-20-2005 , 21:24  
Reply With Quote #6

Will the same thing work for The Specialists (I don't mean the CSW Knife part. Thats only for cs from what i understand)?
Bruno is offline
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 12-20-2005 , 21:27  
Reply With Quote #7

Oh, I'm not user about TS. I dont think that the event is the same.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
Bruno
Member
Join Date: Jun 2005
Old 12-20-2005 , 21:30  
Reply With Quote #8

Well thanks for trying. Anyone know about ts?

Oh and Suicid, do you know anything about smoke?
Bruno is offline
Maddo
Member
Join Date: Dec 2004
Old 12-20-2005 , 23:08  
Reply With Quote #9

The "WeaponInfo" event is should do what you want in TS
Maddo is offline
Bruno
Member
Join Date: Jun 2005
Old 12-20-2005 , 23:13  
Reply With Quote #10

Can you show me how to do that please?
__________________
If you have but one shot at an opportunity, make it count.
Bruno 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:08.


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