0.3 register question!
#1

i am a chinese! and when i register a new ID , if the password is chinese. i login the id ,and the server is not working, How to limit it only in English .

Quote:

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;
}

Reply
#2

please help me!
Reply
#3

你应该加一个字符监测在regist的时候,就是当chr[没一个数入字符]都在英文字母范围内,具体范围你查一下资料,我忘了,然后再让客户注册,否则提示非法字符。
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)