[dudb] Saveskin Problem
#1

I was trying to study dudb. After reading the tutorials, I tried to make a basic saveskin command along with the user system in the tut. It seems 50% working because, it saves the Skin ID to file. But every time I do /saveskin and then rejoin, it sets my skin to some random one. I guess its because the skin id value gets overwriting each time when I do /saveskin or something like that..can't sort it out
Please help

Heres the code:

Код:
dcmd_login(playerid,params[]) {


  if (PLAYERLIST_authed[playerid]) return SystemMsg(playerid,"Already authed.");

  if (!udb_Exists(PlayerName(playerid))) return SystemMsg(playerid,"Account doesn't exist, please use '/register password'.");

  if (strlen(params)==0) return SystemMsg(playerid,"Correct usage: '/login password'");

  if (udb_CheckLogin(PlayerName(playerid),params)) {

    GivePlayerMoney(playerid,dUserINT(PlayerName(playerid)).("money")-GetPlayerMoney(playerid));
    SetPlayerSkin(playerid,dUserINT(PlayerName(playerid)).("Skin")-GetPlayerSkin(playerid));

    PLAYERLIST_authed[playerid]=true;

    return SystemMsg(playerid,"Successfully authed!");
  }
  
  return SystemMsg(playerid,"Login failed!");
 }

dcmd_saveskin(playerid, params[])
{
  #pragma unused params
  if (PLAYERLIST_authed[playerid])
    {
  dUserSetINT(PlayerName(playerid)).("Skin",GetPlayerSkin(playerid));
  SendClientMessage(playerid, Green, "You have successfully saved your skin!");
    }
	else
	SendClientMessage(playerid, Red, "Error: Please login and try again!");
	return 1;
}
Reply
#2

Dudb sucks for a skin system.
Reply
#3

Quote:
Originally Posted by RaFsTar
Dudb sucks for a skin system.
That doesn't helps. I can't give this up, cuz ya're saying dudb is too shit for save skin. Help will be appreciated
Reply
#4

maybe because you put -GetPlayerSkin ...
Reply
#5

Quote:
Originally Posted by ♣ ⓐⓢⓢ
maybe because you put -GetPlayerSkin ...
No. Thats dudb format I guess.
Reply
#6

Quote:
Originally Posted by Vichuzz
Quote:
Originally Posted by ♣ ⓐⓢⓢ
maybe because you put -GetPlayerSkin ...
No. Thats dudb format I guess.
wrong, that isnt dudb format, dudb format is dUser("Playername").("keyword")
actually this format sucks in my eyes, I use udb_User("Playername", "keyword")
Reply
#7

But I don't really see any problem in the code. It works and sets player skin. The fail part is that it sets player to some random skin ID
Reply
#8

I had my system of skins before on dudb, but i am advising you that is a lost of time.

Make it on Dini.
Reply
#9

just remove the fucking "-GetPlayerSkin(playerid)" and done

@rafstar

dudb USES dini, its actually the same, only that dudb save everything to a playerfile and with dini you can say in which file it should be saved
Reply
#10

Thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)