10.05.2009, 01:20
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:
when the scriptfile has this:
Anything you all see thats wrong with it?
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;
}
Код:
2,100,5

