SA-MP Forums Archive
[dudb] Saveskin Problem - 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: [dudb] Saveskin Problem (/showthread.php?tid=97239)



[dudb] Saveskin Problem - Vichuzz - 13.09.2009

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;
}



Re: [dudb] Saveskin Problem - RaFsTar - 13.09.2009

Dudb sucks for a skin system.


Re: [dudb] Saveskin Problem - Vichuzz - 13.09.2009

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


Re: [dudb] Saveskin Problem - Nero_3D - 13.09.2009

maybe because you put -GetPlayerSkin ...


Re: [dudb] Saveskin Problem - Vichuzz - 13.09.2009

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


Re: [dudb] Saveskin Problem - Nero_3D - 13.09.2009

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")


Re: [dudb] Saveskin Problem - Vichuzz - 13.09.2009

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


Re: [dudb] Saveskin Problem - RaFsTar - 13.09.2009

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

Make it on Dini.


Re: [dudb] Saveskin Problem - Nero_3D - 13.09.2009

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


Re: [dudb] Saveskin Problem - Vichuzz - 14.09.2009

Thanks!