Hide with a weapon/string

Here is my script:
[php]// Graal2002 NPC by Stefan Knorr
if (created) {
// Initialize the attributes
showcharacter;
setcharprop #3,head16.png;
setcharprop #C0,orange;
setcharprop #C1,gray;
setcharprop #C2,darkblue;
setcharprop #C3,darkblue;
setcharprop #C4,darkblue;
setcharprop #2,holst_templiarshield.png;
shieldpower = 1;
dir = 2;
x += 0.5;
setcharprop #P1,hat1008111.png;
}

if (playertouchsme && !client.passeport == 1) {
say2 #i(head16.png,0,63,32,32) Templier:#b
You need a passport!;
}
if (playertouchsme && client.passeport == 1) {
say2 #i(head16.png,0,63,32,32) Templier:#b
You can enter!;
if (playerendsreading) {
hidelocal;
}
}
[/php]

1-How to hide a npc? only if i have the weapon on my inventory
2-Why is not working?
Thanks for your future help :shrug:

use strtofloat(client.passeport) == 1. you have to change the string into an integer value.

I don’t even understand what the question is… if you want to hide the weapon while it’s in your inventory add - to the start of the weapon name, If you want to toggle its visibility in the inventory that’s not possible with the default qmenu.

He wants to hide the NPC not wNPC. L2think