SA-MP Forums Archive
djson problem. - 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: djson problem. (/showthread.php?tid=153005)



djson problem. - MafiaGuy™ - 06.06.2010

pawn Код:
forward OnPlayerRegister(playerid, password[]);
public OnPlayerRegister(playerid, password[])
{
    if(IsPlayerConnected(playerid))
    {
      new string[128];
      format(string, sizeof(string), "users/%s.json", PlayerName(playerid));
        if(!djIsSet(string, "Key"))
        {
          djCreateFile(string);
          djSet(string,"Key",password);
          djSetInt(string, "Cash", PlayerInfo[playerid][pCash]);
          djSetInt(string, "Account", PlayerInfo[playerid][pAccount]);
          djSetInt(string, "AdminLevel", PlayerInfo[playerid][pAdmin]);
          djSetInt(string, "Level", PlayerInfo[playerid][pLevel]);
          djSetInt(string, "Experience", PlayerInfo[playerid][pExp]);
          djSetInt(string, "Kills", PlayerInfo[playerid][pKills]);
          djSetInt(string, "Gun1", PlayerInfo[playerid][pGun1]);
          djSetInt(string, "Gun2", PlayerInfo[playerid][pGun2]);
          djSetInt(string, "Gun3", PlayerInfo[playerid][pGun3]);
          djSetInt(string, "Gun4", PlayerInfo[playerid][pGun4]);
          djSetInt(string, "Gun5", PlayerInfo[playerid][pGun5]);
          and so on....
The script compiles right.. but when i register and open the file i just find:
Код:
{ }
:S



Re: djson problem. - MafiaGuy™ - 06.06.2010

Now all under: djson_GameModeInit(); wont load. Any ideas ?

i putted it under ongamemodeinit at first position