Save with Dudb? - 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: Save with Dudb? (
/showthread.php?tid=78942)
Save with Dudb? -
Cabby - 24.05.2009
Hi, i want to save my Teams with dudb. But the problem is that when i save a team, it wont save problably, it saves. But wrong team. Heres my code
Above main:
pawn Код:
#define TEAM_LSPD 2
#define TEAM_CIVIL 1
pawn Код:
public OnPlayerConnect(playerid)
{
new formatZ[256];
format(formatZ,sizeof(formatZ),"%s",PlayerName(playerid));
if(!udb_Exists(formatZ))
{
udb_Create(formatZ,"209010");
}
gTeam[playerid] = dUserINT(formatZ).("PlayerTeam");
ClearVars(playerid);
SyncCheckpoints(playerid);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
new formatZ2[256];
format(formatZ2,sizeof(formatZ2),"%s",PlayerName(playerid));
dUserSetINT(formatZ2).("PlayerTeam",gTeam[playerid]);
return 1;
}
stock PlayerName(playerid)
{
new name[255];
GetPlayerName(playerid, name, 255);
return name;
}
I would also like to ask if it possible to save dudb files in a folder like \\Teams\\%s
Re: Save with Dudb? -
miokie - 24.05.2009
The folder thing has already been explained in the DUDB topic.