How to get a Value from a dini
#1

Код:
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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)