Timer For Autosave Problem
#5

Quote:
Originally Posted by phoenix0120
Try this..

Код:
public AutoSave()
{
  for(new i;i<MAX_PLAYERS;i++)
  {
	if(Logged[i] == 1)
	{
       GetPlayerName(i,PlayerName);
  	   Money[i] = GetPlayerMoney(playerid);
 	   TruckerSkin[i] = GetPlayerSkin(playerid);
  	   TruckType[i] = dini_Int(udb_encode(PlayerName), "TruckType");
  	   JobsDone[i] = dini_Int(udb_encode(PlayerName), "JobsDone");
 	   JobLevel[i] = dini_Int(udb_encode(PlayerName), "JobLevel");
        
       dini_IntSet(udb_encode(PlayerName), "Money", Money[i]);
       dini_IntSet(udb_encode(PlayerName), "TruckType", TruckType[i]);
       dini_IntSet(udb_encode(PlayerName), "JobsDone", JobsDone[i]);
       dini_IntSet(udb_encode(PlayerName), "JobLevel", JobLevel[i]);
       dini_IntSet(udb_encode(PlayerName), "Skin", TruckerSkin[i]);
	  }
    }
    SendClientMessage(playerid, COLOUR_YELLOW, "[SERVER] All Registered Accounts Have Been Auto Saved.");
}
Your code has a mixture of playerid and i. Just use this code:

pawn Код:
public AutoSave()
{
  for(new playerid;playerid<MAX_PLAYERS;playerid++)
  {
        if(IsPlayerConnected(playerid))
        {
            if(Logged[playerid] == 1)
            {
            Money[playerid] = GetPlayerMoney(playerid);
                TruckerSkin[playerid] = GetPlayerSkin(playerid);
            TruckType[playerid] = dini_Int(udb_encode(PlayerName), "TruckType");
            JobsDone[playerid] = dini_Int(udb_encode(PlayerName), "JobsDone");
                JobLevel[playerid] = dini_Int(udb_encode(PlayerName), "JobLevel");

            dini_IntSet(udb_encode(PlayerName), "Money", Money[playerid]);
            dini_IntSet(udb_encode(PlayerName), "TruckType", TruckType[playerid]);
            dini_IntSet(udb_encode(PlayerName), "JobsDone", JobsDone[playerid]);
            dini_IntSet(udb_encode(PlayerName), "JobLevel", JobLevel[playerid]);
            dini_IntSet(udb_encode(PlayerName), "Skin", TruckerSkin[playerid]);
            SendClientMessage(playerid, COLOUR_YELLOW, "[SERVER] All Registered Accounts Have Been Auto Saved.");
            }
        }
    }
}
This way you don't have to change everything to i.
Reply


Messages In This Thread
Timer For Autosave Problem - by Alec24 - 01.04.2009, 17:22
Re: Timer For Autosave Problem - by MenaceX^ - 01.04.2009, 17:30
Re: Timer For Autosave Problem - by phoenix0120 - 01.04.2009, 17:32
Re: Timer For Autosave Problem - by Alec24 - 01.04.2009, 17:37
Re: Timer For Autosave Problem - by Pyrokid - 01.04.2009, 17:42
Re: Timer For Autosave Problem - by basker - 01.04.2009, 20:13

Forum Jump:


Users browsing this thread: 1 Guest(s)