SA-MP Forums Archive
how to add numbers together using dini - 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: how to add numbers together using dini (/showthread.php?tid=96522)



how to add numbers together using dini - [mad]MLK - 08.09.2009

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



Re: how to add numbers together using dini - ilikepie2221 - 08.09.2009

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.


Re: how to add numbers together using dini - iLinx - 09.09.2009

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