AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   weapon list.... (https://forums.alliedmods.net/showthread.php?t=75098)

HkFree 07-30-2008 11:28

weapon list....
 
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)

ConnorMcLeod 07-30-2008 11:40

Re: weapon list....
 
yes
http://www.amxmodx.org/funcwiki.php?...pons&go=search

HkFree 07-30-2008 12:04

Re: weapon list....
 
Quote:

Originally Posted by connorr (Post 661706)

I don't know how to use this function.....
Can you give an example?

ConnorMcLeod 07-30-2008 12:28

Re: weapon list....
 
Examples are allready provided on the link a gave you.

HkFree 07-30-2008 13:13

Re: weapon list....
 
Quote:

Originally Posted by connorr (Post 661739)
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

ConnorMcLeod 07-30-2008 13:42

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


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

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