Weapon change
Hi,
I'm building a custom VIP weapon menu. It works fine, but if player selects the weapons he already has, it drops it. It works like this: when a player selects a primary weapon, I run this function: PHP Code:
But if I give user the same weapon it allready has, it will be droped. If someone needs the full code, I'll PM it, I really don't want to make this public. |
Re: Weapon change
Make a check with weapon CSW_ id against user_has_weapon()
|
Re: Weapon change
I don't understand.
|
Re: Weapon change
misterx
Just check if user has this weapon already. PHP Code:
|
Re: Weapon change
No, do this :
if( user_has_weapon(id, buying_weapon_id) ) return Before you make him buy it or drop it. |
Re: Weapon change
He doesn't buy anything, he has a menu:
1. M4A1 2. AK-47 Do I have to write an other function or is there an other way. Technicly, it seems like a AMXX bug, as cs_drop_slot() is called before the user is given its weapon. Mayby I'll PM the code? |
Re: Weapon change
Quote:
|
Re: Weapon change
Well, isn't it? I mean, I call cs_drop_slot() first and after that I give the user its weapon.
|
Re: Weapon change
misterx
If it's not your plugin, ask author. If you want to do it yourself so badly, analize plugin, find where weapon ID is checked and do what ConnorMcLeod said. |
Re: Weapon change
It is my plugin. Is there no way to do it without writing any more functions?
|
| All times are GMT -4. The time now is 04:26. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.