Topic: [HELP]Register system - Check for characters
Hi. I create account system. ReD|FoX created crash. He shuts down my the server. How to create check for characters: ",.;:"?
My cod:
if(!str_comp_num(pMsg->m_pMessage, "/register", 9))
{
if(sscanf(pMsg->m_pMessage, "/register %s %s", pPlayer->m_Name, pPlayer->m_Pass))
{
char acc[128];
str_format(acc, 128, "accounts/%s.acc", pPlayer->m_Name);
if(Exists(acc))
{
SendChatTarget(ClientID, "Account already exist");
return;
}
if(strlen(m_apPlayers[ClientID]->m_Pass) > 8)
{
SendChatTarget(ClientID, "You password is to long!");
return;
}
if(strlen(m_apPlayers[ClientID]->m_Name) > 8)
{
SendChatTarget(ClientID, "You login is to long!");
return;
}
if(strlen(m_apPlayers[ClientID]->m_Pass) < 3)
{
SendChatTarget(ClientID, "You password is to short!");
return;
}
if(strlen(m_apPlayers[ClientID]->m_Name) < 3)
{
SendChatTarget(ClientID, "You login is to short!");
return;
}
FILE* f;
f = fopen(acc, "a+");
fprintf(f, "%s\n%s\n1\n0\n0\n0\n1\n0\n0\n0", pPlayer->m_Name, pPlayer->m_Pass); // login pass lvl exp score money damage regenammo regenhealth vip
fclose(f);
SendChatTarget(ClientID, "Registration Done!\nUse /login to join the game!");
pPlayer->m_Lvl = 1;
}
else
SendChatTarget(ClientID, "Use /register <login> <password>");
}
Please, i need help!