SA-MP Forums Archive
[UNSOLVED] Automatic Login attempt. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [UNSOLVED] Automatic Login attempt. (/showthread.php?tid=120965)



[UNSOLVED] Automatic Login attempt. - `FuTuRe- - 14.01.2010

When i go in my server it logs me in. (automaticly) It's getting data.
When i try to use admin commands it still says i am not logged in and such.
So i type /login and it logs me in.
Also the textdraw doesn't go away anymore when it's fake logging me in.

Here a short movie: www.nix.turkdale.nl/weird.wmv

pawn Код:
//////onplayerconnect/////////////////////////
  new IP[56];
  GetPlayerIp(playerid, IP, 56);
  if(strcmp(dini_Get(pInfo[playerid][name], "IP"), IP)== 0) OnPlayerLogin(playerid);

//////onplayerlogin//////////////////////////////
public OnPlayerLogin(playerid)
{
    new string[265];

    pInfo[playerid][logged] = 1;
    pInfo[playerid][money] = dini_Int(udb_encode(pInfo[playerid][name]), "money");
    pInfo[playerid][score] = dini_Int(udb_encode(pInfo[playerid][name]), "score");
    pInfo[playerid][level] = dini_Int(udb_encode(pInfo[playerid][name]), "level");
    pInfo[playerid][perfect] = dini_Int(udb_encode(pInfo[playerid][name]), "perfect");
    new IP[56];
    GetPlayerIp(playerid, IP, 56);
    dini_Set(udb_encode(pInfo[playerid][name]), "IP", IP);
    format(string, sizeof(string), "~r~Information: ~w~your now logged in! [~r~Score: ~w~%d] [~r~Admin Level: ~w~%d] [~r~Premium Member:~w~ %d] [~r~Money: ~w~%d]", pInfo[playerid][score], pInfo[playerid][level], pInfo[playerid][perfect], pInfo[playerid][money]);
    SendMsg(playerid, 5000, string);

    GivePlayerMoney(playerid,pInfo[playerid][money]);
    SetPlayerScore(playerid,pInfo[playerid][score]+GetPlayerScore(playerid));
    }
I hope that somebody will be able to help me.


Re: [UNSOLVED] Automatic Login attempt. - `FuTuRe- - 14.01.2010

Bump


Re: [UNSOLVED] Automatic Login attempt. - KnooL - 14.01.2010

Second time, stop bumping within 12 hours..


Re: [UNSOLVED] Automatic Login attempt. - bajskorv123 - 14.01.2010

"Read This Before Posting" Topic, That i guess you didn't read because you bumped...
Quote:
Originally Posted by Kaisersouse
b) Do Not Bump!
Some people apparently think they are important enough to bump their own topic after 10 minutes.
You can bump topics when the last reply is at least 12 hours old.



Re: [UNSOLVED] Automatic Login attempt. - KnooL - 14.01.2010

Post your /login command.


Re: [UNSOLVED] Automatic Login attempt. - Badger(new) - 14.01.2010

Check any code to do with the level. Also that probably should be a different password to your real one in the video.


Re: [UNSOLVED] Automatic Login attempt. - `FuTuRe- - 15.01.2010

Here is my /login command

pawn Код:
dcmd_login(playerid,params[])
{
    new string[265];
    new tmp[265];

    if(pInfo[playerid][logged] == 1)return SendMsg(playerid, 5000, "~r~Information: ~w~You are already ~r~logged~w~ in!");

  if(!strlen(params))return SendMsg(playerid, 5000, "~b~USAGE: ~w~/login [password]");

  if (dini_Exists(udb_encode(pInfo[playerid][name])))
  {
      tmp = dini_Get(udb_encode(pInfo[playerid][name]), "password");
    if (udb_hash(params) != strval(tmp))
    {
      SendMsg(playerid, 5000, "~r~Information: ~w~Wrong password!");
    }
    else
    {
        OnPlayerLogin(playerid);
    }
    }
    else
    {
    format(string, sizeof(string), "The Account %s does not exist in our Database yet, use /register password to register it!", pInfo[playerid][name]);
    SendMsg(playerid, 5000, string);
  }

  return 1;
}