11.05.2010, 18:28
I want my login script to detect if a file with that players name exists, if not, then on /login say that it does not exist.
However, my current one says it never exists, even when it does. Someone correct it please? Tell me if you need more of the code. Thanks a lot
Note: "file" has been formatted to (playername).ini.
However, my current one says it never exists, even when it does. Someone correct it please? Tell me if you need more of the code. Thanks a lot
Note: "file" has been formatted to (playername).ini.
pawn Код:
if(strcmp(cmd, "/login", true) == 0)
{
new PlayerName[24];
tmp = strtok(cmdtext, idx);
if(strlen(tmp) == 0) return SendClientMessage(playerid, COLOR_GREY, "Usage: /login (password)");
if(IsLogged[playerid] == 1)
{
SendClientMessage(playerid, COLOR_GREY, "ERROR: You already are logged in.");
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
return 1;
}
else
{
if(!fexist(file))
{
SendClientMessage(playerid, COLOR_GREY, "ERROR: This account does not exist.");
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
return 1;
}
else
Login code here