Playername == PlAyErNaMe
#1

hi,
I have scripted a registration system but i have a problem.

User can register the same names x-times.
They only have to change the case sensitive.

pawn Код:
new file[64], string[128];
GetPlayerName(playerid, pInfo[playerid][AccName], MAX_PLAYER_NAME);
format(file, sizeof(file), "/nxadmin/Accounts/%s.ini", pInfo[playerid][AccName]);
if (!dini_Exists(file))
{
    print("Account exists");
}
has somebody a idea what i can do?
Reply
#2

pawn Код:
if(!dini_Exists(file))
{
      //Register
}
else
{
      //Login
}
Reply
#3

Pawn(C++) and SA-MP both are case sensitive, use a !strcmp
Reply
#4

Quote:
Originally Posted by Luнs Miki
Посмотреть сообщение
Pawn(C++) and SA-MP both are case sensitive, use a !strcmp
and how i should use strcmp in conjunction with dini?
Reply
#5

pawn Код:
new file[64], string[128];
GetPlayerName(playerid, pInfo[playerid][AccName], MAX_PLAYER_NAME);
format(file, sizeof(file), "/nxadmin/Accounts/%s.ini", pInfo[playerid][AccName]);
if (dini_Exists(file))
{
    print("Account exists");
}
Isnt that hard...
Reply
#6

Quote:
Originally Posted by ddnbb
Посмотреть сообщение
pawn Код:
new file[64], string[128];
GetPlayerName(playerid, pInfo[playerid][AccName], MAX_PLAYER_NAME);
format(file, sizeof(file), "/nxadmin/Accounts/%s.ini", pInfo[playerid][AccName]);
if (dini_Exists(file))
{
    print("Account exists");
}
Isnt that hard...
You donґt understand what i mean.
Reply
#7

turn the characters of the filename lowercase, then save and check them.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)