$name will report the $name of the player who initiated that section of code (in this case, the sub EVENT_SIGNAL portion). I believe your problem would lie in the fact that it is actually the King's script that is triggering it, and so it doesn't know who is doing it in the first place.
I would suggest looking at something like Cazic Thule's script from the Plane of Fear. That has a pretty good method for adding a client to an NPC's hate list without even using a file for them. Or, if you're really intent on using signals, you could store the $name from the King's file in a variable and pass it along to the guards that way.
Good luck!
|