Saving/loading skin with DUDB?
#1

I try to make a clothes system for my newly started server. I use DUDB for the saving/loading part.
I just wonder, how can I code a system that saves the skinID when the player logs out, and then loads it again whenever the player comes online?

dcm_login:
pawn Код:
if (udb_CheckLogin(PlayerName(playerid),params)) {
    GivePlayerMoney(playerid,dUserINT(PlayerName(playerid)).("money")-GetPlayerMoney(playerid));
    SetPlayerSkin(playerid,dUserINT(PlayerName(playerid)).("skin"));
OnPlayerDisconnect:
pawn Код:
public OnPlayerDisconnect(playerid) {
 if (PLAYERLIST_authed[playerid]) {
  dUserSetINT(PlayerName(playerid)).("money",GetPlayerMoney(playerid));
  dUserSetINT(PlayerName(playerid)).("skin",GetPlayerSkin(playerid));
 }
 PLAYERLIST_authed[playerid]=false;
 return false;
}
When I edit the "Money" part in the userfile and I log on, the money counter will go up to the given "money" number in the file.
But when I try to edit the "Skin" part, there's no change when I log on, I still spawn with CJ skin.
So how can I make this right?

This is in the Username.dudb file:
pawn Код:
password_hash=xxxxxxx
money=50000
skin=293
So when I try to go IG I'll get 50000, but not skinID 293.
Reply


Messages In This Thread
Saving/loading skin with DUDB? - by Anarkien - 08.07.2009, 16:01
Re: Saving/loading skin with DUDB? - by Anarkien - 08.07.2009, 17:38
Re: Saving/loading skin with DUDB? - by Anarkien - 08.07.2009, 20:16
Re: Saving/loading skin with DUDB? - by Naruto4 - 07.01.2010, 09:21
Re: Saving/loading skin with DUDB? - by Calon - 07.01.2010, 09:55

Forum Jump:


Users browsing this thread: 2 Guest(s)