SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 08/07/2009, 04:01 PM   #1
Anarkien
Huge Clucker
 
Join Date: May 2008
Posts: 269
Reputation: 8
Default Saving/loading skin with DUDB?

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 Code:
if (udb_CheckLogin(PlayerName(playerid),params)) {
    GivePlayerMoney(playerid,dUserINT(PlayerName(playerid)).("money")-GetPlayerMoney(playerid));
    SetPlayerSkin(playerid,dUserINT(PlayerName(playerid)).("skin"));

OnPlayerDisconnect:
pawn Code:
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 Code:
password_hash=xxxxxxx
money=50000
skin=293

So when I try to go IG I'll get 50000, but not skinID 293.
Anarkien is offline  
Old 08/07/2009, 05:38 PM   #2
Anarkien
Huge Clucker
 
Join Date: May 2008
Posts: 269
Reputation: 8
Default Re: Saving/loading skin with DUDB?

It's weird that it won't load the skinID when it loads everything else I've tried..
Any suggestions on what I can do about this?
And just a fast question: is DUDB just as good as INI?
Anarkien is offline  
Old 08/07/2009, 08:16 PM   #3
Anarkien
Huge Clucker
 
Join Date: May 2008
Posts: 269
Reputation: 8
Default Re: Saving/loading skin with DUDB?

Can't anyone help me out with this?
Anarkien is offline  
Old 07/01/2010, 09:21 AM   #4
Naruto4
Huge Clucker
 
Join Date: May 2009
Posts: 234
Reputation: 0
Default Re: Saving/loading skin with DUDB?

i have the same problem.Can anyone help us ?
Naruto4 is offline  
Old 07/01/2010, 09:55 AM   #5
Calon
Big Clucker
 
Join Date: Nov 2009
Posts: 117
Reputation: 2
Default Re: Saving/loading skin with DUDB?

Use SetSpawnInfo() to set the skin, for when the player spawns (though it sometimes doesn't set the skin). Don't (whatever you do) use SetPlayerSkin() in OnPlayerSpawn(), it leads to a substantial amount of crashes (supposed to be fixed in 0.2, but still happens).
Calon is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
loading/saving skin from mysql swredder Help Archive 2 05/06/2010 06:33 PM
Saving gTeam with DUDB Assyria Help Archive 1 13/04/2010 04:31 PM
Good Dini/Dudb tutorial for file saving and info saving for example score ect JoeDaDude Help Archive 2 07/02/2010 09:04 PM
Dudb - Cash Saving Ritchie999 Help Archive 1 28/11/2009 06:29 PM
[HELP]-[DUDB] saving to folder papedo Help Archive 0 06/11/2009 01:08 PM


All times are GMT. The time now is 08:58 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.