[Include] [DUDB] Userdatabase Management (Version 2.4, 4th July) // 0.2#Ready
#26

Quote:
Originally Posted by FeaR
pawn Код:
public udb_getPosition(nickname[]) {
 new pwd_hash,acc_state,lvl,money,banks,position,kills,deaths,suicides,jail,mute,clantag[MAX_STRING];
 if (udb_Load(nickname,pwd_hash,acc_state,lvl,money,banks,position,kills,deaths,suicides,jail,mute,clantag)) return position;
 return 0;
}

public udb_SetPosition(nickname[],new_position) {
 new pwd_hash,acc_state,lvl,money,banks,position,kills,deaths,suicides,jail,mute,clantag[MAX_STRING];
 if (udb_Load(nickname,pwd_hash,acc_state,lvl,money,banks,position,kills,deaths,suicides,jail,mute,clantag)) {
   udb_Save(nickname,pwd_hash,acc_state,lvl,money,banks,new_position,kills,deaths,suicides,jail,mute,clantag);
     return true;
  }
 return false;
}
thats how they look like in DUDB..
Yeah, but you want to save/read 3 floats extra.

Change this in your public udb_Create(nickname[],pwd[],acc_state,clantag[],Float,Float:y,Float:z)

Replace
pawn Код:
public udb_Create(nickname[],pwd[],acc_state,clantag[])
pawn Код:
public udb_Create(nickname[],pwd[],acc_state,clantag[],Float:x,Float:y,Float:z)
Replace
pawn Код:
udb_Save(nickname,udb_hash(pwd),acc_state,clantag);
pawn Код:
udb_Save(nickname,udb_hash(pwd),acc_state,clantag,x,y,z);

Change this in your public udb_Save(nickname[],pwd_hash,acc_state,clantag[])

Replace
pawn Код:
udb_Save(nickname[],pwd_hash,acc_state,clantag[])
pawn Код:
udb_Save(nickname[],pwd_hash,acc_state,clantag[],Float:x,Float:y,Float:z)
Replace
pawn Код:
strcat(tmpres,clantag);
pawn Код:
strcat(tmpres,clantag);
 format(tmpres,sizeof(tmpres),"%s;%f;%f;%f",tmpres,x,y,z);

Change public udb_Load(nickname[],&pwd_hash,&acc_state,clantag[])

Replace
pawn Код:
public udb_Load(nickname[],&pwd_hash,&acc_state,clantag[]) {
pawn Код:
public udb_Load(nickname[],&pwd_hash,&acc_state,clantag[],&Float:x,&Float:y.&Float:z)
Replace
pawn Код:
set(clantag,strtok(tmpres,i,';'));
pawn Код:
set(clantag,strtok(tmpres,i,';'));
 x=floatstr(strtok(tmpres,i,';'));
 y=floatstr(strtok(tmpres,i,';'));
 z=floatstr(strtok(tmpres,i,';'));

Change every(!)
pawn Код:
new pwd_hash,acc_state,clantag[MAX_STRING];
 if (udb_Load(nickname,pwd_hash,acc_state,clantag))
pawn Код:
new pwd_hash,acc_state,clantag[MAX_STRING],Float:x,Float:y,Float:z;
 if (udb_Load(nickname,pwd_hash,acc_state,clantag,x,y,z))
Change in all old setMethods:
pawn Код:
udb_Save(nickname,new_pwdhash,acc_state,clantag);
pawn Код:
udb_Save(nickname,new_pwdhash,acc_state,clantag,x,y,z);
pawn Код:
udb_Save(nickname,pwd_hash,new_acc_state,clantag);
pawn Код:
udb_Save(nickname,pwd_hash,new_acc_state,clantag,x,y,z);
pawn Код:
udb_Save(nickname,pwd_hash,acc_state,new_clantag);
pawn Код:
udb_Save(nickname,pwd_hash,acc_state,new_clantag,x,y,z);



Add the new getFunction:
pawn Код:
public udb_getPosition(nickname[],&Float:x,&Float:y,&Float:z) {
 new pwd_hash,acc_state,clantag[MAX_STRING];
 if (udb_Load(nickname,pwd_hash,acc_state,clantag,x,y,z)) return true;
 return false;
}
Add the new setFunction:
pawn Код:
public udb_setPosition(nickname[],Float:new_x,Float:new_y,Float:new_z) {
 new pwd_hash,acc_state,clantag[MAX_STRING].Float:x,Float:y,Float:z;
 if (udb_Load(nickname,pwd_hash,acc_state,clantag,x,y,z)) {
   udb_Save(nickname,pwd_hash,acc_state,new_clantag,new_x,new_y,new_z);
     return true;
  }
 return false;
}
Thats it!

Regrads,
Jan (DracoBlue)
Reply


Messages In This Thread
[DUDB] Userdatabase Management (Version 2.4, 4th July) // 0.2#Ready - by DracoBlue - 08.05.2006, 12:44
Re: [DUDB] Userdatabase Management (Source Included) - by Cyborgmatt - 08.05.2006, 15:07
Re: [DUDB] Userdatabase Management (Source Included) - by SidViciousII - 08.05.2006, 15:58
Re: [DUDB] Userdatabase Management (Source Included) - by DracoBlue - 14.05.2006, 17:54
Re: [DUDB] Userdatabase Management (Source Included) - by grimreaper423 - 01.06.2006, 13:11
Re: [DUDB] Userdatabase Management (Source Included) - by DracoBlue - 01.06.2006, 13:31
Re: [DUDB] Userdatabase Management (Source Included) - by grimreaper423 - 01.06.2006, 13:35
Re: [DUDB] Userdatabase Management (Source Included) - by DracoBlue - 01.06.2006, 20:48
Re: [DUDB] Userdatabase Management (Source Included) - by grimreaper423 - 01.06.2006, 20:50
Re: [DUDB] Userdatabase Management (Source Included) - by DracoBlue - 01.06.2006, 21:31
Re: [DUDB] Userdatabase Management (Source Included) - by grimreaper423 - 01.06.2006, 22:04
Re: [DUDB] Userdatabase Management (Source Included) - by Baliame - 04.06.2006, 00:12
Re: [DUDB] Userdatabase Management (Source Included) - by RamboPappa - 04.06.2006, 05:46
Re: [DUDB] Userdatabase Management (Source Included) - by DracoBlue - 04.06.2006, 09:40
Re: [DUDB] Userdatabase Management (Source Included) - by grimreaper423 - 04.06.2006, 12:11
Re: [DUDB] Userdatabase Management (Source Included) - by DracoBlue - 04.06.2006, 13:02
Re: [DUDB] Userdatabase Management (Source Included) - by RamboPappa - 04.06.2006, 14:17
Re: [DUDB] Userdatabase Management (Source Included) - by Baliame - 04.06.2006, 20:39
Re: [DUDB] Userdatabase Management (Source Included) - by DracoBlue - 04.06.2006, 21:13
Re: [DUDB] Userdatabase Management (Source Included) - by Jaanis - 30.06.2006, 18:31
Re: [DUDB] Userdatabase Management (Source Included) - by Wirrkopf - 06.07.2006, 23:15
Re: [DUDB] Userdatabase Management (Source Included) - by DracoBlue - 07.07.2006, 07:47
Re: [DUDB] Userdatabase Management (Source Included) - by DracoBlue - 31.07.2006, 16:43
Re: [DUDB] Userdatabase Management (Source Included) - by DracoBlue - 01.08.2006, 07:57
Re: [DUDB] Userdatabase Management (Source Included) - by FeaR - 01.08.2006, 08:00
Re: [DUDB] Userdatabase Management (Source Included) - by DracoBlue - 01.08.2006, 08:30
Re: [DUDB] Userdatabase Management (Source Included) - by {XN}BigPaddy - 01.08.2006, 18:01
Re: [DUDB] Userdatabase Management (Source Included) - by ProRaiL - 02.08.2006, 08:49
Re: [DUDB] Userdatabase Management (Source Included) - by yom - 02.08.2006, 14:27
Re: [DUDB] Userdatabase Management (Version 2.3, 3rd June) // 0.2#Ready - by DracoBlue - 10.06.2007, 17:12
Re: [DUDB] Userdatabase Management (Version 2.3, 3rd June) // 0.2#Ready - by GanG$Ta - 10.06.2007, 20:01
Re: [DUDB] Userdatabase Management (Version 2.3, 3rd June) // 0.2#Ready - by DracoBlue - 11.06.2007, 08:34
Re: [DUDB] Userdatabase Management (Version 2.3, 3rd June) // 0.2#Ready - by GanG$Ta - 11.06.2007, 12:42
Re: [DUDB] Userdatabase Management (Version 2.3, 3rd June) // 0.2#Ready - by jtg91 - 12.06.2007, 14:23
Re: [DUDB] Userdatabase Management (Version 2.3, 3rd June) // 0.2#Ready - by DragosLt - 23.06.2007, 14:40
Re: [DUDB] Userdatabase Management (Version 2.3, 3rd June) // 0.2#Ready - by DragosLt - 23.06.2007, 14:42
Re: [DUDB] Userdatabase Management (Version 2.3, 3rd June) // 0.2#Ready - by DracoBlue - 24.06.2007, 18:54
Re: [DUDB] Userdatabase Management (Version 2.3, 3rd June) // 0.2#Ready - by polgast - 25.06.2007, 19:53
Re: [DUDB] Userdatabase Management (Version 2.3, 3rd June) // 0.2#Ready - by jtg91 - 25.06.2007, 20:02
Re: [DUDB] Userdatabase Management (Version 2.3, 3rd June) // 0.2#Ready - by polgast - 25.06.2007, 20:05
Re: [DUDB] Userdatabase Management (Version 2.3, 3rd June) // 0.2#Ready - by jtg91 - 25.06.2007, 20:32
Re: [DUDB] Userdatabase Management (Version 2.3, 3rd June) // 0.2#Ready - by polgast - 25.06.2007, 20:42
Re: [DUDB] Userdatabase Management (Version 2.3, 3rd June) // 0.2#Ready - by DracoBlue - 28.06.2007, 15:24
Re: [DUDB] Userdatabase Management (Version 2.3, 3rd June) // 0.2#Ready - by Blitz456 - 05.07.2007, 08:44
Re: [DUDB] Userdatabase Management (Version 2.3, 3rd June) // 0.2#Ready - by bradfish - 05.07.2007, 11:51
Re: [DUDB] Userdatabase Management (Version 2.3, 3rd June) // 0.2#Ready - by Warriors_Tornado - 05.07.2007, 14:19
Re: [DUDB] Userdatabase Management (Version 2.3, 3rd June) // 0.2#Ready - by jtg91 - 05.07.2007, 15:22
Re: [DUDB] Userdatabase Management (Version 2.3, 3rd June) // 0.2#Ready - by Maikel - 05.07.2007, 17:40
Re: [DUDB] Userdatabase Management (Version 2.3, 3rd June) // 0.2#Ready - by DracoBlue - 06.07.2007, 09:49
Re: [DUDB] Userdatabase Management (Version 2.4, 4th July) // 0.2#Ready - by Goobiiify - 20.03.2010, 18:52
Re: [DUDB] Userdatabase Management (Version 2.4, 4th July) // 0.2#Ready - by Luka P. - 20.03.2010, 19:33
Re: [DUDB] Userdatabase Management (Version 2.4, 4th July) // 0.2#Ready - by Goobiiify - 20.03.2010, 20:15
Re: [DUDB] Userdatabase Management (Version 2.4, 4th July) // 0.2#Ready - by xcasio - 29.03.2010, 20:21
Re: [DUDB] Userdatabase Management (Version 2.4, 4th July) // 0.2#Ready - by AzTeCaS - 26.11.2010, 10:50
Re: [DUDB] Userdatabase Management (Version 2.4, 4th July) // 0.2#Ready - by dj_william - 01.12.2010, 21:41
Re: [DUDB] Userdatabase Management (Version 2.4, 4th July) // 0.2#Ready - by Lookin - 01.12.2010, 22:52
Re: [DUDB] Userdatabase Management (Version 2.4, 4th July) // 0.2#Ready - by dj_william - 03.12.2010, 01:16
Re: [DUDB] Userdatabase Management (Version 2.4, 4th July) // 0.2#Ready - by Scenario - 03.12.2010, 01:18
Re: [DUDB] Userdatabase Management (Version 2.4, 4th July) // 0.2#Ready - by [L3th4l] - 03.12.2010, 01:36
Re: [DUDB] Userdatabase Management (Version 2.4, 4th July) // 0.2#Ready - by Grim_ - 03.12.2010, 01:46
Re: [DUDB] Userdatabase Management (Version 2.4, 4th July) // 0.2#Ready - by Medal Of Honor team - 29.03.2011, 15:44
Re: [DUDB] Userdatabase Management (Version 2.4, 4th July) // 0.2#Ready - by Zh3r0 - 29.03.2011, 16:35
Re: [DUDB] Userdatabase Management (Version 2.4, 4th July) // 0.2#Ready - by XFlawless - 29.03.2011, 16:46
Re: [DUDB] Userdatabase Management (Version 2.4, 4th July) // 0.2#Ready - by flybox - 19.06.2011, 11:23
Respuesta: Re: [DUDB] Userdatabase Management (Version 2.4, 4th July) // 0.2#Ready - by clavador - 19.06.2011, 16:19
Re: [DUDB] Userdatabase Management (Version 2.4, 4th July) // 0.2#Ready - by DracoBlue - 19.06.2011, 22:04
Re: [DUDB] Userdatabase Management (Version 2.4, 4th July) // 0.2#Ready - by zxc1 - 04.07.2012, 18:08
Re: [DUDB] Userdatabase Management (Version 2.4, 4th July) // 0.2#Ready - by Robert West - 04.07.2012, 18:17
Re: [DUDB] Userdatabase Management (Version 2.4, 4th July) // 0.2#Ready - by zxc1 - 04.07.2012, 20:56
Re: [DUDB] Userdatabase Management (Version 2.4, 4th July) // 0.2#Ready - by Ryan_Obeles - 25.04.2013, 02:18
Re: [DUDB] Userdatabase Management (Version 2.4, 4th July) // 0.2#Ready - by xF4Life - 12.08.2013, 19:02
Re: [DUDB] Userdatabase Management (Version 2.4, 4th July) // 0.2#Ready - by perfectboy - 14.12.2015, 13:06
Re: [DUDB] Userdatabase Management (Version 2.4, 4th July) // 0.2#Ready - by DRIFT_HUNTER - 14.12.2015, 18:50

Forum Jump:


Users browsing this thread: 18 Guest(s)