Posts: 107
Threads: 34
Joined: Jun 2011
Reputation:
0
hi guys i wanna ask how to count correctly, if i wrote in my dialog as example 2514 number so every 1000 i add + 45 but if player write 2001 so he got counted result 2091 so how to make that i got no idea
Posts: 6,236
Threads: 310
Joined: Jan 2011
Reputation:
0
You should define dialog IDs. NEVER use literal constant numbers (I think they're called that).
Generally, the dialogs in a gamemode start at 0 and filterscripts/includes should use 1000 or 5000 etc. It's hard to do really without conflicts.
Posts: 107
Threads: 34
Joined: Jun 2011
Reputation:
0
not dialog id, i talking about string(integer) i wrote in dialog if in dialog i wrote 2001 so specific count system she will count that method every 1000 she will add 45 so if i wrote 2001 so that she makes 2091 (2001+((45+45)because result got 2000)) = 2091 so how make that system?
Posts: 6,236
Threads: 310
Joined: Jan 2011
Reputation:
0
Not entirely sure what you mean. From what I understand you want to get the value of what was entered and add 45 per 1000?
value = strval(inputtext);
value = value + (45*(value / 1000))
Tested it, works fine.
If you want to add it for every value (i.e. 500 will add 22.5 (half of 45)) then:
new value = strval(inputtext);
value = floatround(value + (0.045*(value)));
Posts: 107
Threads: 34
Joined: Jun 2011
Reputation:
0
MP2 thanks very much you help me save a lot of space. Thanks.