Get the active weapon and compare it

Hello again gentlemen, here there is only one “newbie” who wants to learn something from lua and which is a small problem … but annoying

I’m trying to get the information of a weapon, and compare this with other weapons or at least distinguish or make clear in the code which gun and which does not use bullets, but … codes that I have, do not work or do not work well “/”

Parth of my code (doesn’t work)

bullets = ply:GetActiveWeapon():Clip1()
if bullets == 0 and (ply:KeyReleased(IN_ATTACK)) then
weapon = ply:GetActiveWeapon()
if weapon == (“weapon_pistol”) then
Msg(“This is a pistol”)
Msg(“This no are a pistol!”)

Thanks for see

Change weapon to:

local weapon = ply:GetActiveWeapon():GetClass();

OF COURSE! i’m so idiot…You are the best Chessnut!