Raised This Month: $ Target: $400
 0% 

weapon list....


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HkFree
Junior Member
Join Date: Jun 2008
Location: Hong Kong of China
Old 07-30-2008 , 11:28   weapon list....
Reply With Quote #1

can i make a weapon list of a player?
such as a string like this:
"weapon_knife weapon_usp weapon_awp weapon_hegrenade weapon_flashbang weapon_flashbang weapon_smokegrenade weapon_c4"
(this player has a knife, a usp pistol, an awp sniper rifle, a HE grenade, two flash grenades, a smoke grenade and a C4 bomb)
__________________
=]

Last edited by HkFree; 07-30-2008 at 11:31.
HkFree is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-30-2008 , 11:40   Re: weapon list....
Reply With Quote #2

yes
http://www.amxmodx.org/funcwiki.php?...pons&go=search
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
HkFree
Junior Member
Join Date: Jun 2008
Location: Hong Kong of China
Old 07-30-2008 , 12:04   Re: weapon list....
Reply With Quote #3

Quote:
Originally Posted by connorr View Post
I don't know how to use this function.....
Can you give an example?
__________________
=]
HkFree is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-30-2008 , 12:28   Re: weapon list....
Reply With Quote #4

Examples are allready provided on the link a gave you.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
HkFree
Junior Member
Join Date: Jun 2008
Location: Hong Kong of China
Old 07-30-2008 , 13:13   Re: weapon list....
Reply With Quote #5

Quote:
Originally Posted by connorr View Post
Examples are allready provided on the link a gave you.
PHP Code:
new Weapons[32]
new 
numWeaponsiweapon
get_user_weapons
(idWeaponsnumWeapons)
for (
i=0i<numWeaponsi++)
{
   
weapon Weapons[i]

I expect "weapon" is a string which contain something like "weapon_*" but I got a blank string when I use client_print() to print it
code are following:
PHP Code:
new Weapons[32];
new 
numWeaponsiweapon;
get_user_weapons(idWeaponsnumWeapons);
for (
i=0i<numWeaponsi++) {
   
weapon Weapons[i];
   
client_print(id,print_chat,"[Debug] get_user_weapons:%s",weapon);

I see the following message in chat area (I have a USP pistol and a Knife):
Quote:
[Debug] get_user_weapons:
[Debug] get_user_weapons:
I expect is like this
Quote:
[Debug] get_user_weapons: weapon_knife
[Debug] get_user_weapons: weapon_usp
__________________
=]

Last edited by HkFree; 07-30-2008 at 13:16.
HkFree is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-30-2008 , 13:42   Re: weapon list....
Reply With Quote #6

weapon is the index, use get_weaponname(weapon, szWeapon, 15) to retrieve weapon name.
http://www.amxmodx.org/funcwiki.php?go=func&id=164
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:40.


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