SA-MP Forums Archive
How do I make money saving. - 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: How do I make money saving. (/showthread.php?tid=113041)



How do I make money saving. - Studio - 12.12.2009

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.


Re: How do I make money saving. - LarzI - 12.12.2009

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