How do I make money saving.
#1

I'm using Dudb and have no clue.

Код:
enum PlayerInfo
{
  AdminLevel,
  Logged,
  Muted,
  Kicks,
  Bans
}

new PlayerData[MAX_PLAYERS][PlayerInfo];
That's the PlayerInfo Section.

Код:
    dUserSetINT(PlayerName(playerid)).("PlayerBans", PlayerData[playerid][Bans]);
On playerdisconnect.

Код:
  if(udb_CheckLogin(PlayerName(playerid),params))
  {
    PlayerData[playerid][Logged] = 1;
    PlayerData[playerid][Kicks] = (dUserINT(PlayerName(playerid)).("PlayerKicks"));
    PlayerData[playerid][Bans] = (dUserINT(PlayerName(playerid)).("PlayerBans"));
    PlayerData[playerid][AdminLevel] = (dUserINT(PlayerName(playerid)).("AdminLevel"));
    SendClientMessage(playerid,COLOR_WHITE,"Successfully logged in!");
    return true;
  }
When the user has logged in.

Thanks, much appreciated if helped.
Reply
#2

add inside OnPlayerDisconnect:
pawn Код:
dUserSetINT(PlayerName(playerid)).("Money", GetPlayerMoney(playerid));
and inside checklogin:
pawn Код:
GivePlayerMoney(playerid, dUserINT(PlayerName(playerid)).("Money"));
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)