public int SetPlayerId(string Nick, int Pid)
{
// If no user exists, return code -1
if (!UserExists(Nick))
return -1;
// If the Pid already exists, return -2
if (UserExists(Pid))
return -2;
// If PID is false, the PID is not taken
int Success = base.Execute("UPDATE accounts SET id=@P0 WHERE name=@P1", Pid, Nick);
return (Success > 0) ? 1 : 0;
}