AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved [HELP] Get killer's all weapon? (https://forums.alliedmods.net/showthread.php?t=308093)

CrAzY MaN 06-06-2018 10:02

[HELP] Get killer's all weapon?
 
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?

HamletEagle 06-06-2018 10:45

Re: [HELP] Get killer's all weapon?
 
Easy? get_user_weapons

CrAzY MaN 06-06-2018 11:43

Re: [HELP] Get killer's all weapon?
 
How do i print it then seperated by ","?
Using loops?

CrazY. 06-06-2018 12:12

Re: [HELP] Get killer's all weapon?
 
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 MaN 06-07-2018 02:52

Re: [HELP] Get killer's all weapon?
 
Great! Thanks!


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

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