Help please (/getmats stuff)
#1

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
Reply
#2

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

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

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

I'm not very familiar with dini though.
Reply
#4

Please help me.....
Reply
#5

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

It didnt work
Reply
#7

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.
Reply
#8

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)