Finding Entity
How to find which weapon user is holding on Ham_Spawn?
If he is holding "m4a1" or any other weapon,then implement this: PHP Code:
PHP Code:
|
Re: Finding Entity
RegisterHam(Ham_Spawn, "player, "Function", 1)
Be careful with your check. It will print your message 20 times since you check if your ammo is lower than 20. I'd rather use == 20 or == 19 in your case. |
Re: Finding Entity
Quote:
then check ammo if lower than 20,Executes Client_Print |
Re: Finding Entity
No, it will not print 20 times.
|
Re: Finding Entity
I see, my bad.
Anyways, Ham_Spawn would do or logevent round start. |
Re: Finding Entity
Then,Answer my thread.
How would I do that? |
Re: Finding Entity
Your code is wrong. The check should be:
PHP Code:
|
Re: Finding Entity
I thought in index I should use weapon index not there name O_O :D
Lets see if it works |
Re: Finding Entity
cs_get_weapon_id gets the CSW_* index of the provided weapon entity id, not the player id. Use get_user_weapon if you want to check the weapon that the player is currently holding.
|
Re: Finding Entity
No shouldn't check agains get_user_weapon, because player can hold his knife when he respawn.
If you want to check few specific weapons, you can check user_has_weapon(). If you want to check more than few, then use get_user_weapons and loop through retrieved list. You can also use the method i used in there : http://forums.alliedmods.net/showthread.php?p=553846 But make sure you fully understand the code (and for any method you gonna use). |
| All times are GMT -4. The time now is 06:18. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.