AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to know who has c4 ? (https://forums.alliedmods.net/showthread.php?t=84576)

kevin14144 01-28-2009 11:45

How to know who has c4 ?
 
I need to strip user weapons so use this code "strip_user_weapons".


I need to know who has c4 and give it again.



If "get_user_weapon()" that no use .

"get_user_weapon()" is when player get weapon now . Is it right ?

SnoW 01-28-2009 12:44

Re: How to know who has c4 ?
 
If you are stripping the weapons in spawn, there shouldn't be any problem. I tested it long time ago and bomb was given after spawn. Anyway:
Code:

/* Returns 1 if user has the "skill" to plant bomb, else 0. Normally this would only be true for a terrorist carrying a bomb.
 */
native cs_get_user_plant(index);

Just notice that it doesn't mean that users has a bomb, but if any other plugin isn't editing any bomb things, then it will fill your needs.

Exolent[jNr] 01-28-2009 14:18

Re: How to know who has c4 ?
 
Code:
if( user_has_weapon(id, CSW_C4) ) {     ham_strip_weapon(id, "weapon_c4"); }

Use this for ham_strip_weapon().

kevin14144 01-28-2009 19:56

Re: How to know who has c4 ?
 
Quote:

Originally Posted by SnoW (Post 751691)
If you are stripping the weapons in spawn, there shouldn't be any problem. I tested it long time ago and bomb was given after spawn. Anyway:
Code:

/* Returns 1 if user has the "skill" to plant bomb, else 0. Normally this would only be true for a terrorist carrying a bomb.
 */
native cs_get_user_plant(index);

Just notice that it doesn't mean that users has a bomb, but if any other plugin isn't editing any bomb things, then it will fill your needs.

thanks , it work !


All times are GMT -4. The time now is 01:45.

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