SA-MP Forums Archive
Script do not affect IG (Help) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: Script do not affect IG (Help) (/showthread.php?tid=400242)



Script do not affect IG (Help) - Partner - 17.12.2012

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.)


Re: Script do not affect IG (Help) - Karagon - 17.12.2012

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);



Re: Script do not affect IG (Help) - Partner - 17.12.2012

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...


Re: Script do not affect IG (Help) - Karagon - 17.12.2012

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!