If i would use this for cod2, it would require guid to be a player's normal guid instead of punkbuster guid: there is in cod2 no way to get the punkbuster guid from script.
You can view your own guid by typing /rcon status and noting down your guid. Use this as an integer/long instead of a string (so lose the "" around it) for the getguid() comparisation.
Also, you could have debugged this by iprintlnbold(self getguid()); Please try this before posting anythign
If it returns zero, it means you are connecting to a local ip, which gives you a zero guid.