08.07.2009, 16:01
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:
OnPlayerDisconnect:
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:
So when I try to go IG I'll get 50000, but not skinID 293.
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"));
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;
}
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