Raised This Month: $51 Target: $400
 12% 

Solved [HELP] Get killer's all weapon?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CrAzY MaN
Senior Member
Join Date: Mar 2017
Location: India
Old 06-06-2018 , 10:02   [HELP] Get killer's all weapon?
Reply With Quote #1

How can i get killer's all weapon?
e.g Print "You have m4a1, glock, knife."

Using loop? Using get_user_weapons?
Any easy and optimized method?
__________________

Last edited by CrAzY MaN; 06-07-2018 at 02:52.
CrAzY MaN is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-06-2018 , 10:45   Re: [HELP] Get killer's all weapon?
Reply With Quote #2

Easy? get_user_weapons
__________________
HamletEagle is online now
CrAzY MaN
Senior Member
Join Date: Mar 2017
Location: India
Old 06-06-2018 , 11:43   Re: [HELP] Get killer's all weapon?
Reply With Quote #3

How do i print it then seperated by ","?
Using loops?
__________________
CrAzY MaN is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 06-06-2018 , 12:12   Re: [HELP] Get killer's all weapon?
Reply With Quote #4

Code:
new stWeapons[32], szWeapon[32], szBuffer[128], iLen, iWeaponsCount, iWeapon; get_user_weapons(pPlayer, stWeapons, iWeaponsCount); for (new i = 0; i < iWeaponsCount; i++) {     iWeapon = stWeapons[i];     get_weaponname(iWeapon, szWeapon, charsmax(szWeapon));     iLen += formatex(szBuffer[iLen], charsmax(szBuffer) - iLen, "%s , ", szWeapon); } format(szBuffer[strlen(szBuffer) - 2], 2, ""); client_print(0, print_chat, "%s", szBuffer);
__________________








CrazY. is offline
CrAzY MaN
Senior Member
Join Date: Mar 2017
Location: India
Old 06-07-2018 , 02:52   Re: [HELP] Get killer's all weapon?
Reply With Quote #5

Great! Thanks!
__________________
CrAzY MaN 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 09:25.


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