SA-MP Forums Archive
How to get a Value from a dini - 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: How to get a Value from a dini (/showthread.php?tid=74643)



How to get a Value from a dini - Mr_Assassin - 24.04.2009

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  new cmd[256];
	new idx;
	cmd=strtok(cmdtext,idx);


if(strcmp(cmd,"/balance",true) == 0)
	{
	  new playername[24];
	  GetPlayerName(playerid,playername,sizeof(playername));
	  new file[256];
	  format(file,sizeof(file),"/BankAccount/%s.xcu",udb_encode(playername));
	  if(!dini_Exists(file))
	  {
	    SendClientMessage(playerid,light_green,"You don't have a bank account! Use /register [password]");
	    return 1;
	  }
	  if(!BankLogged[playerid])
	  {
	    SendClientMessage(playerid,light_green,"You are not logged in! Use /login [password]");
	    return 1;
	  }
		new balance=dini_Int(file,"balance");
		format(file,sizeof(file),"Bank Balance : $%d",balance); 
// I want to get a Value from a file,
// Basically the money in the bank account so i can SetPlayerColor(playerid, TEAM_CRIMINAL_COLOR1); if over 50000 let say
		SendClientMessage(playerid,light_green,file);
		return 1;

	}
Is this possible get a Value from a file samp02Xserver.win32\scriptfiles\BankAccount user.XCU File
Any help would be most appreciated Thanks