30.01.2010, 20:12
Ok, Im tryna set it so when a user registers, they get $5000.. so i'v got this upon registering:
and this upon when a user logs in:
But for some reason i don't get 5000 once registered and logged in. can you spot anything wrong in the code?
pawn Код:
format(st,sizeof(st),"accounts/%s.user",name[playerid]);
dini_Create((st));
dini_IntSet((st), "Password", udb_hash(inputtext));
dini_Set((st),"Pass",inputtext);
dini_IntSet((st), "Level", 0);
dini_IntSet((st), "Cash", 5000);
dini_IntSet((st), "Skinid", 0);
dini_IntSet((st), "Deaths", 0);
dini_IntSet((st), "Kills", 0);
printf(st);
format(st, sizeof(st), "** [SERVER] Your account '%s' has been created with the password %s **", name[playerid], inputtext);
SendClientMessage(playerid, COLOR_YELLOW, st);
Entry(playerid);
pawn Код:
{
dini_Set((st),"Pass",inputtext);
stats[playerid][level] = dini_Int((name[playerid]), "Level");
stats[playerid][cash] = dini_Int((name[playerid]), "Cash");
stats[playerid][skinid] = dini_Int((name[playerid]), "Skinid");
stats[playerid][death] = dini_Int((name[playerid]), "Deaths");
stats[playerid][kill] = dini_Int((name[playerid]), "Kills");
SetPlayerMoney(playerid, stats[playerid][cash]);
SendClientMessage(playerid, COLOR_GREEN, "Welcome to Esperanza Roleplay.");
SpawnPlayer(playerid);
}