public OnPlayerRegister(playerid, password[]) // v1.0 by Luk0r { if(IsPlayerConnected(playerid)) { MySQLCheckConnection(); new playername3[MAX_PLAYER_NAME]; GetPlayerName(playerid, playername3, sizeof(playername3)); new newaccountsqlid = MySQLCreateAccount(playername3, password); if (newaccountsqlid != 0) { PlayerInfo[playerid][pSQLID] = newaccountsqlid; //PlayerInfo[playerid][pKey] = password; strmid(PlayerInfo[playerid][pKey], password, 0, strlen(password), 255); OnPlayerUpdate2(playerid); SendClientMessage(playerid, TEAM_AZTECAS_COLOR, " 成功注册,你现在可以使用 /login 你的密码 来登陆了."); return 1; } else { PlayerInfo[playerid][pSQLID] = newaccountsqlid; //PlayerInfo[playerid][pKey] = password; strmid(PlayerInfo[playerid][pKey], password, 0, strlen(password), 255); OnPlayerUpdate2(playerid); SendClientMessage(playerid, COLOR_RED, " 我们在创建你的帐户时可能发生了错误,但容许你继续游戏"); //Kick(playerid); return 0; } } return 0; } |