Adding to a variable (DINI)
#1

Okay, here is my problem.

I am using Dini to make a material system. Every time someone picks up the materials, I want it to add a set number (300) to the current total of materials in the player's .ini file, the variable being "Jobs". Here is the code I have:

Код:
format(string, sizeof(string),"/xadmin/Users/%s.ini", udb_encode(PlayerName));
new number = dini_Int(string, "Job");

       if(number == 6)
	   {
	       dini_IntSet(string, "MatA", 300);
		   SendClientMessage(playerid, COLOR_RED,"You've recieved 300 A Materials for your packages!");
	   }
It just sets the value to 300 every time. I want it to add 300 to the total. Any clue as to how?

Thank you ahead of time.
Reply
#2

Try this.
pawn Код:
dini_IntSet(string, "MatA", dini_Int(string, "MatA")+300);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)