AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] Check for smoke, he, weapons, flash (https://forums.alliedmods.net/showthread.php?t=98674)

malec321 07-27-2009 18:27

[HELP] Check for smoke, he, weapons, flash
 
1 Attachment(s)
Hey on my BM coding... I would like to know how when you step on a block it CHECKS to see if you already have a weapon/nade,smoke,flash. Like right now if you have a smoke and you step on it. It acts like you didnt have one. It doest stack but lets say u use that smoke and step on it it wont give you one anymore.

Arkshine 07-27-2009 19:17

Re: [HELP] Check for smoke, he, weapons, flash
 
user_has_weapon()

malec321 07-27-2009 20:26

Re: [HELP] Check for smoke, he, weapons, flash
 
so it would be

if user_has_weapon(id, weapon_smokegrenade, 0)

TitANious 07-27-2009 20:27

Re: [HELP] Check for smoke, he, weapons, flash
 
CSW_SMOKEGRENADE

malec321 07-27-2009 20:44

Re: [HELP] Check for smoke, he, weapons, flash
 
if user_has_weapon(id, CSW_SMOKEGRENADE, 0)

does that check if the user has NO smokes?

TitANious 07-27-2009 20:52

Re: [HELP] Check for smoke, he, weapons, flash
 
if( !user_has_bla bla

malec321 07-27-2009 23:49

Re: [HELP] Check for smoke, he, weapons, flash
 
if( !user_has_weapon(id, CSW_SMOKEGRENADE, 0))

?

=)

Arkshine 07-28-2009 04:58

Re: [HELP] Check for smoke, he, weapons, flash
 
You are in the SCRIPTING section. It means you are there to learn how to code, thus please test yourself instead of asking each time if it's good or not. -_-

malec321 09-11-2010 18:18

Re: [HELP] Check for smoke, he, weapons, flash
 
Bringing old topic back up,

I tryed

if ( get_user_team ( id ) == 1 && user_has_weapon( id, CSW_FLASHBANG, 0) )

and it wont work.. It compiled fine, am i not supposed to use , 0?

Exolent[jNr] 09-11-2010 18:29

Re: [HELP] Check for smoke, he, weapons, flash
 
If that doesn't work, you can get the bpammo of the grenade.

Code:
if ( get_user_team ( id ) == 1 && cs_get_user_bpammo( id, CSW_FLASHBANG ) > 0 )


All times are GMT -4. The time now is 18:23.

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