Need some help here....
#1

Well, im making a Gang-Safe system, i have a command /gangbankbalance it is supposed to show you the Money, Materials and Drugs amount in the Gangs Bank, i have the scriptfile there, i manually edit'd the scriptfile making the shit like 100 money 50 mats w/e ya get what im saying
it should print whatever the Scriptfile Contains, (money,mats,drugs)
However, it only prints: Money: 0 Mats: 0 Drugs: 0

Heres the bits of script:

Код:
enum dSafe1
{
	MoneyAmmount,
	MatsAmmount,
	DrugsAmmount,
};
new safe1[dSafe1];
Код:
		if(strcmp(cmd,"/gangbankbalance",true)==0)
  {
 	if(IsPlayerConnected(playerid))
	 	  {
		if(PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5)
		  {
		  format(string, sizeof(string), "*Money: $%d Mats: %d Drugs: %d",safe1[MoneyAmmount] ,safe1[MatsAmmount] ,safe1[DrugsAmmount]);
			SendClientMessage(playerid, COLOR_WHITE, string);
		  }
		  }
		  }
Код:
public LoadGangSafe1()
{
	new arrCoords[4][64];
	new strFromFile2[256];
	new File: file = fopen("safe1.ini", io_read);
	if (file)
	{
		fread(file, strFromFile2);
		split(strFromFile2, arrCoords, ',');
		safe1[MoneyAmmount] = strval(arrCoords[0]);
		safe1[MatsAmmount] = strval(arrCoords[1]);
		safe1[DrugsAmmount] = strval(arrCoords[2]);
		fclose(file);
	}
	return 1;
}

public SaveGangSafe1()
{
	new coordsstring[256];
	format(coordsstring, sizeof(coordsstring), "%d,%d,%d", safe1[MoneyAmmount], safe1[MatsAmmount], safe1[DrugsAmmount]);
	new File: file2 = fopen("safe1.ini", io_write);
	fwrite(file2, coordsstring);
	fclose(file2);
	return 1;
}
when the scriptfile has this:
Код:
2,100,5
Anything you all see thats wrong with it?
Reply
#2

No help?
Reply
#3

edit'd first post, hopefully itll make more sense so i can get some help
Reply
#4

Why don't you try and use something like dini?
Reply
#5

Could you elaborate? Never heard of that before...

&+ Im also somewhat looking for an explanation as to why this wont work so i can avoid it in the future
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)