It is, you just have to put the puzzle pieces together.
If it is not what you are asking for, you should specify your question.
Spoiler
edit:
here small untested not optimzed example.
I never stored the grenades names so you need the 'FindDataMapInfo' & 'GetEntData' method metioned by Indarello for the grenades to check which kind of grenade.
PHP Code:
char sWeapons[5][64]
for (int i = 0; i <= 4; i++) { if ((weapon = GetPlayerWeaponSlot(client, i)) != -1) { if (weapon = -1) continue;
GetEdictClassname(weapon, sWeapons[i], sizeof(sWeapons)); int weaponID = GetEntProp(weapon, Prop_Send, "m_iItemDefinitionIndex"); switch (weaponID) { case 60: strcopy(sWeapons[i], sizeof(sWeapons), "weapon_m4a1_silencer"); case 61: strcopy(sWeapons[i], sizeof(sWeapons), "weapon_usp_silencer"); case 63: strcopy(sWeapons[i], sizeof(sWeapons), "weapon_cz75a"); case 64: strcopy(sWeapons[i], sizeof(sWeapons), "weapon_revolver"); } } }
BTW. Since I assume this is for csgo, don't forget to loop through Knife_Slot twice for the taser.
int iEntity; int iSize = GetEntPropArraySize(iClient, Prop_Send, "m_hMyWeapons");
for (int X = 0; X < iSize; X++) { if ((iEntity = GetEntPropEnt(iClient, Prop_Send, "m_hMyWeapons", X)) != -1) { GetEntityClassname(iEntity, sWeapon, sizeof(sWeapon));
for (int Y = 0; Y < sizeof(g_sWeapons); Y++) { // If any of the client's weapon is equivalent to any of the ones in the array. Then print it to the chat. if (StrEqual(sWeapon, g_sWeapons[Y])) { PrintToChat(iClient, "%s", g_sWeapons[Y]); } } } }
But it prints it nothing to the chat.
Why is that and how do I fix it?
EDIT:
Might be because it stores every weapon the client has in the array "sWeapon".