The variable names I gave you were just to tell you what you should try to do. You need to look up the actual name yourself.
Use %client.dump() and look for something relating to job type or criminal status.
Also, in a player method, the first argument is player. So, your code should look something like this:
function Player::ifWanted(%player) {
if(%player.client.isCriminal) {
messageClient(%client,'',"Yes");
} else {
messageClient(%client,'',"No");
}
}
Or, what would make even more sense, would be to just make it a client event, not a player event.