You still haven't been able to tell us what is actually wrong with your plugin and you have not tried to debug it yet.
Simply use log_amx() or server_print() to find out the value of the critical variables involved to determine if they are what they should be.
I'd also like to reiterate that your endeavor (your plugin) is pointless because the solution (the BEST solution) is simply to not give your plugin to anyone.