public OnPlayerConnect(playerid)
{
new name[MAX_PLAYER_NAME];
new file[128];
GetPlayerName(playerid, name, sizeof(name));
format(file,sizeof(file),"/Users/%s.ini",name);
if(!fexist(file))
{
SendClientMessage(playerid, COLOR_GREEN, "OMGWTFBBQ You arent registered! type /register to save your stats!");
logged[playerid] = 0;
}
if(fexist(file))
{
SendClientMessage(playerid, COLOR_GREEN, "hot damn sexy! You are registered! type /login [pass]!!");
}
return 1;
}
public OnPlayerConnect(playerid)
{
new name[25];
new file[64];
GetPlayerName(playerid, name, 25);
format(file, 64, "/Users/%s.ini", name);
if(!fexist(file))
{
SendClientMessage(playerid, COLOR_GREEN, "OMGWTFBBQ You arent registered! type /register to save your stats!");
logged[playerid] = 0;
}
else
{
SendClientMessage(playerid, COLOR_GREEN, "hot damn sexy! You are registered! type /login [pass]!!");
}
return 1;
}
Actually it should still work. A file either exists or it doesn't. Both are covered with IF statements.
|
format(file, 64, "/Users/%s.ini", udb_encode(name));
If i remember right, dini/dudb encodes names, so...
Код:
format(file, 64, "/Users/%s.ini", udb_encode(name)); |
public OnPlayerConnect(playerid)
{
new name[25], tmp[40];
GetPlayerName(playerid, name, 25);
format(tmp, 40, "/Users/%s.ini", name);
if(fexist(tmp))
{
SendClientMessage(playerid, COLOR_GREEN, "hot damn sexy! You are registered! type /login [pass]!!");
}
else
{
SendClientMessage(playerid, COLOR_GREEN, "OMGWTFBBQ You arent registered! type /register to save your stats!");
logged[playerid] = 0;
}
return 1;
}