SA-MP Forums Archive
0.3 register question! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: 0.3 register question! (/showthread.php?tid=128098)



0.3 register question! - yqyq007 - 16.02.2010

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




Re: 0.3 register question! - yqyq007 - 17.02.2010

please help me!


Re: 0.3 register question! - demon_pan - 01.03.2010

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