Script do not affect IG (Help)
#1

I got this code:

pawn Код:
GetPlayerName(playerid, plname, sizeof(plname));
    format(string, sizeof(string), "accounts/%s.ini", plname);
    if(fexist(string))
    {
        gPlayerAccount[playerid] = 1;
        SendClientMessage(playerid, COLOR_YELLOW, "SERVER: That nick is registered, please login");
        SendClientMessage(playerid, COLOR_WHITE, "HINT: You can now login by typing /login <password>");
        return 1;
    }
    else
    {
        gPlayerAccount[playerid] = 0;
        SendClientMessage(playerid,COLOR_YELLOW,"You dont have an account. Please register by using /register [password]");
        return 1;
    }
I got no errors but when I go IG it tells me that I don't have an account (I am having an account at scriptfiles/accounts/Lenny_Kraff.ini and I can /login but it shows that I can't.)
Reply
#2

Looks like to me "_" is being escaped to something else. If the file's name is "Lenny_Kraff.ini" and it's not finding it still, try:

Код:
GetPlayerName(playerid, plname, sizeof(plname));
    format(string, sizeof(string), "accounts\\%s.ini", plname);
Reply
#3

Quote:
Originally Posted by Karagon
Посмотреть сообщение
Looks like to me "_" is being escaped to something else. If the file's name is "Lenny_Kraff.ini" and it's not finding it still, try:

Код:
GetPlayerName(playerid, plname, sizeof(plname));
    format(string, sizeof(string), "accounts\\%s.ini", plname);
Didn't work...
Reply
#4

1) Is "string" large enough to hold it all?
2) Is "plname" large enough to hold the name?
3) Is your name Lenny_Kraff?
4) Are you sure there's a Lenny_Kraff.ini in the scriptfiles/accounts folder?

If all of those are right, check out:
Код:
GetPlayerName(playerid, plname, sizeof(plname));
    format(string, sizeof(string), "accounts\\%s.ini", plname);
print(string);
//Go on with normal checks here
Check your console right after to make sure string is being formed right. If it's like this:
Код:
accounts\Lenny_Kraff.ini
in the print, then I've no clue!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)