SA-MP Forums Archive
DUDB - Need a help - 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 - Need a help (/showthread.php?tid=106611)



DUDB - Need a help - Luka P. - 04.11.2009

I'm making a register/login system (using dudb - http://forum.sa-mp.com/index.php?topic=684.0)
but I don't know how to read a value after char " = ". I've ask that in DUDB topic, but nobody answers to me.

I've created the register/login command, but there is a problem when trying to read data.

pawn Код:
forward ReadPlayerData(playerid);
pawn Код:
new level[MAX_PLAYERS];
new admin[MAX_PLAYERS];
new deaths[MAX_PLAYERS];
new kills[MAX_PLAYERS];
//...
pawn Код:
public OnPlayerConnect(playerid)
{
    level[playerid] = 0;
    admin[playerid] = 0;
    deaths[playerid] = 0;
    kills[playerid] = 0;
    return 1;
}
pawn Код:
COMMAND:login(playerid,params[]) // zcmd
{
    // bla bla SendClientMsg and other stuff
    ReadPlayerData(playerid);
    return 1;
}
pawn Код:
public ReadPlayerData(playerid)
{
    new pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,sizeof(pName));

    level[playerid] = dUser(pName).("Level");
    admin[playerid] = dUser(pName).("Admin");
    deaths[playerid] = dUser(pName).("Deaths");
    kills[playerid] = dUser(pName).("Kills");

    SetPlayerScore(playerid,level[playerid]);
    //...
    return 1;
}
And I get an error "Must be assigned into array" or something like that.
I remind you, I already ask in DUDB official topic but nobody answers.