SA-MP Forums Archive
Help please (/getmats stuff) - 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: Help please (/getmats stuff) (/showthread.php?tid=104656)



Help please (/getmats stuff) - Tyler_Idy - 25.10.2009

FIXED! I CANT BELIVE I DID IT!
Fixed version below...
Код:
public OnPlayerEnterCheckpoint(playerid)
{
  new pName[24], PlayerFile[50], pMatPackages[50], pJob[50], pMats[50];

	GetPlayerName(playerid, pName, sizeof(pName));
	format(PlayerFile, sizeof(PlayerFile), "/users/%s.ini", pName);

  if(!dini_Exists(PlayerFile)) return 0;

  if(dini_Exists(PlayerFile))
  {
		pMatPackages[24] = dini_Int(PlayerFile, "MaterialPackages");
  		pJob[24] = dini_Int(PlayerFile, "Job");
  		pMats[24] = dini_Int(PlayerFile, "Materials");

  	if(PlayerInfo[playerid][Job] == 1)
		{
			if(PlayerInfo[playerid][MaterialPackages] == 10)
			{
			  	PlayerInfo[playerid][MaterialPackages] = 0;
			  	PlayerInfo[playerid][Materials] += 250;
			  	SendClientMessage(playerid, COLOR_WHITE, "You have bought some material packages");
			  	dini_IntSet(PlayerFile, "MaterialPackages", 0);
			  	dini_IntSet(PlayerFile, "Materials", PlayerInfo[playerid][Materials]);
			  	SetPlayerCheckpoint(playerid, 1319.0309,1251.1731,10.8203, 1.5);
			}
			else
			{
			SendClientMessage(playerid, COLOR_BRIGHTRED, "You arn't at the materials package pickup!");
			}
		}
		else
		{
		SendClientMessage(playerid, COLOR_BRIGHTRED, "You already have some packages, go drop them off!");
		}
	}
	return 1;
}
how do i make it so it reads the file and just add 250 mats instead of Setting it to 250, cuz then it cant accumulate. then you would never get over 250


Re: Help please (/getmats stuff) - Redgie - 25.10.2009

Use [ code ] and [ /code ] to make it readable and structured enough for people to help you


Re: Help please (/getmats stuff) - Joel_Krantz - 25.10.2009

Код:
dini_IntSet(PlayerFile, "Materials", 250);
to

Код:
dini_IntSet(PlayerFile, "Materials", +250);
?

I'm not very familiar with dini though.


Re: Help please (/getmats stuff) - Tyler_Idy - 25.10.2009

Please help me.....


Re: Help please (/getmats stuff) - Tyler_Idy - 25.10.2009

Quote:
Originally Posted by Emilio [Temp Acc
]
Код:
dini_IntSet(PlayerFile, "Materials", +250);
What i did to fix:
Код:
dini_IntSet(PlayerFile, "Materials", += 250);
Didnt Work!



Re: Help please (/getmats stuff) - Tyler_Idy - 25.10.2009

It didnt work


Re: Help please (/getmats stuff) - Smithy - 25.10.2009

Quote:
Originally Posted by Tyler_Idy
Please help me.....
Quote:
Originally Posted by Tyler_Idy
It didnt work
Quote:
Originally Posted by Tyler_Idy
Quote:
Originally Posted by Emilio [Temp Acc
]
Код:
dini_IntSet(PlayerFile, "Materials", +250);
Didnt Work!
Please do not triple post.


Re: Help please (/getmats stuff) - Tyler_Idy - 25.10.2009

Quote:

Please do not triple post.

sorry it was by accident...

but seriously i need help, no one has done anything helpfull at all!!!!!!!!!!!!!!!!!!!!!!!!!!!1