[UNSOLVED] Automatic Login attempt.
#1

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.
Reply
#2

Bump
Reply
#3

Second time, stop bumping within 12 hours..
Reply
#4

"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.
Reply
#5

Post your /login command.
Reply
#6

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

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)