01.08.2006, 08:30
Quote:
Originally Posted by FeaR
pawn Код:
|
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)
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)
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)
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))
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;
}
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;
}
Regrads,
Jan (DracoBlue)