AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Has user got XXXX weapon? (https://forums.alliedmods.net/showthread.php?t=108771)

byetovice 11-09-2009 08:58

Has user got XXXX weapon?
 
I need help.
[Note : my english isnt good xD]
if player has got a hegrenade .. ==> set_user_health(id,100)
but users current weapon CAN don't be hegrenade

:S sorry .. xD my english is bad
example :
user has got ak-47...
user is killed another player...
if user buys a hegrenade ..
users hp will be 100
xD

who can help me?

Exolent[jNr] 11-09-2009 09:01

Re: Has user got XXXX weapon?
 
Only use bold when it's necessary.

ConnorMcLeod 11-09-2009 09:27

Re: Has user got XXXX weapon?
 
Quote:

Originally Posted by Exolent[jNr] (Post 984960)
Only use bold when it's necessary.

Fixed.


You are in scripting help section, don't you have any begining of code ?

byetovice 11-09-2009 10:15

Re: Has user got XXXX weapon?
 
if i use get_user_weapon, it gives me current weapons id..
but i dont want it
if want to get to know "has user got xxxx weapon"
example : hegrenade

Exolent[jNr] 11-09-2009 10:16

Re: Has user got XXXX weapon?
 
http://forums.alliedmods.net/showthread.php?t=100352

Stop posting in all bold or else your topic will be trashed.

byetovice 11-09-2009 10:18

Re: Has user got XXXX weapon?
 
sorry..

hleV 11-09-2009 12:01

Re: Has user got XXXX weapon?
 
PHP Code:

if (user_has_weapon(idCSW_yourwep))
{
    
// Stuff



grimvh2 11-09-2009 12:41

Re: Has user got XXXX weapon?
 
All your weapons

Code:

CSW_P228        1
CSW_SCOUT        3
CSW_HEGRENADE        4
CSW_XM1014        5
CSW_C4            6
CSW_MAC10        7
CSW_AUG            8
CSW_SMOKEGRENADE    9
CSW_ELITE        10
CSW_FIVESEVEN        11
CSW_UMP45        12
CSW_SG550        13
CSW_GALI        14
CSW_GALIL        14
CSW_FAMAS        15
CSW_USP            16
CSW_GLOCK18        17
CSW_AWP            18
CSW_MP5NAVY        19
CSW_M249        20
CSW_M3            21
CSW_M4A1        22
CSW_TMP            23
CSW_G3SG1        24
CSW_FLASHBANG        25
CSW_DEAGLE        26
CSW_SG552        27
CSW_AK47        28
CSW_KNIFE        29
CSW_P90            30


ConnorMcLeod 11-09-2009 12:45

Re: Has user got XXXX weapon?
 
And if you want to know if the user is holding a specific weapon, use :

if( get_user_weapon(id) == CSW_KNIFE )

byetovice 11-10-2009 02:08

Re: Has user got XXXX weapon?
 
Thanks...
if (user_has_weapon(id, CSW_yourwep))
{
// Stuff
}


it's true


All times are GMT -4. The time now is 17:39.

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