how to add numbers together using dini
#1

hey i have this:

Код:
    level[playerid] = dini_Int(file, "level");
    serverpoints[playerid] = dini_Int(file, "serverpoints");
		SetPlayerScore(playerid, dini_Int(file, "score"));
		GivePlayerMoney(playerid, dini_Int(file, "money")-GetPlayerMoney(playerid));
		new str[128]; format(str, sizeof(str), "You have successfully logged in , you currently have %d Server Points", serverpoints[playerid]);
    SendClientMessage(playerid, COLOR_YELLOW, str);
    printf("%s (%i) logged in with password %s", pname, playerid, params);
  }

how could i make it so i can add the points they have in there file to the points im going to give eg they have 50 points in there file and i want to give them 50 how would i make it add them togethere
Reply
#2

maybe use the "+" sign? lol. like:

pawn Код:
new x = 1;
new y = 2;
new z;
z = x + y;
Then save z.

EDIT: Of course, you'll have to make sure they ARE numeric using IsNumeric.
Reply
#3

Quote:
Originally Posted by ilikepie2221
maybe use the "+" sign? lol. like:

pawn Код:
new x = 1;
new y = 2;
new z;
z = x + y;
Then save z.

EDIT: Of course, you'll have to make sure they ARE numeric using IsNumeric.
lols :]
back to grade 1 xD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)