CMD:test(playerid, params[]) { new string[256], tmp2[256]; format(string,sizeof(string),"/accs/%s.ini",udb_encode(params)); INI:string[](name[], value[]) { INI_Int("Lotto", tmp2); } format(string,sizeof(string),"Lotto: %d ", tmp2); SendClientMessage(playerid, -1, string); return 1; }
CMD:test(playerid, params[])
{
new string[256], tmp2[256];
format(string,sizeof(string),"/accs/%s.ini",udb_encode(params));
new INI:File = INI_Open(string);
INI_WriteInt(File, "Lotto", tmp2);
INI_Close(File);
format(string,sizeof(string),"Lotto: %d ", tmp2);
SendClientMessage(playerid, -1, string);
return 1;
}
public LoadUser_data(playerid,name[],value[])
{
INI_Int("MDP",PlayerInfo[playerid][pMDP]);
INI_Int("Admin",PlayerInfo[playerid][pAdminlvl]);
INI_Int("Cash",PlayerInfo[playerid][pCash]);
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
INI_Int("Score",PlayerInfo[playerid][pScore]);
SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
INI_Int("Log",PlayerInfo[playerid][pLog]);
INI_Int("Register",PlayerInfo[playerid][pRegister]);
INI_Int("VIP",PlayerInfo[playerid][pVIP]);
INI_Int("Kill",PlayerInfo[playerid][pKill]);
INI_Int("Death",PlayerInfo[playerid][pDeath]);
INI_Int("Kick",PlayerInfo[playerid][pKick]);
INI_Int("Ban",PlayerInfo[playerid][pBan]);
INI_String("IP",PlayerInfo[playerid][pIP], 16);
INI_String("LastIP",PlayerInfo[playerid][pLastIP], 16);
INI_Int("Banque", PlayerInfo[playerid][pBanque]);
INI_Float("PosX", PlayerInfo[playerid][pX]);
INI_Float("PosY", PlayerInfo[playerid][pY]);
INI_Float("PosZ", PlayerInfo[playerid][pZ]);
return 1;
}
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
What about when i want to get a info from a ini file where no players are connected ?
|
If the file name isn't dynamic (player names etc..), you can use INI_Load.
|
If the file name isn't dynamic (player names etc..), you can use INI_Load.
|