Dini Message failure?
#1

pawn Код:
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;
}
kk so, i've added this to my OnPlayerConnect, and the messages arent showing, but its scripted right? any ideas?
Reply
#2

pawn Код:
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;
}
You forgot an else.
Reply
#3

Actually it should still work. A file either exists or it doesn't. Both are covered with IF statements.
Reply
#4

Quote:
Originally Posted by TheXIII
Посмотреть сообщение
Actually it should still work. A file either exists or it doesn't. Both are covered with IF statements.
Oh, you're right.. well, maybe you don't have the folders?
Reply
#5

No, the /register and login work, everything works in it exept that D:
Reply
#6

If i remember right, dini/dudb encodes names, so...

Код:
format(file, 64, "/Users/%s.ini", udb_encode(name));
Reply
#7

Quote:
Originally Posted by cj101
Посмотреть сообщение
If i remember right, dini/dudb encodes names, so...

Код:
format(file, 64, "/Users/%s.ini", udb_encode(name));
Might be, but it still should give at least a (false) message, that you are not registered. Makes no sense..
Reply
#8

try printing file before your if statments see if its set right ive found on connect sometimes it dont pickup player values stright away
Reply
#9

Still no dice yall.
Reply
#10

pawn Код:
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;
}
Also check if your files end with .ini.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)