AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Weapon function (https://forums.alliedmods.net/showthread.php?t=22181)

Bruno 12-20-2005 19:47

Weapon function
 
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)

Dizzy 12-20-2005 19:56

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

Correct me if I'm wrong...

Bruno 12-20-2005 20:08

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 12-20-2005 20:25

Putting new setweapon does not work. Someone please explain to me how that function works?

Xanimos 12-20-2005 21:13

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

Bruno 12-20-2005 21:24

Will the same thing work for The Specialists (I don't mean the CSW Knife part. Thats only for cs from what i understand)?

Xanimos 12-20-2005 21:27

Oh, I'm not user about TS. I dont think that the event is the same.

Bruno 12-20-2005 21:30

Well thanks for trying. Anyone know about ts?

Oh and Suicid, do you know anything about smoke?

Maddo 12-20-2005 23:08

The "WeaponInfo" event is should do what you want in TS

Bruno 12-20-2005 23:13

Can you show me how to do that please?


All times are GMT -4. The time now is 16:08.

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