Can someone explain this to me?
#1

I got this. It adds/gives the player 1 exp but how does it work? i dont get it. the ++ probably gives him 1 but how?
how would i make it give him more than 1. i dont get it :/. I would be glad if somebody could explain me how it works

pawn Код:
Player[i][EXP]++;
Reply
#2

++ is used to increase the value by 1 ... if you want to add more than 1, you should do like:
pawn Код:
Player[i][EXP] += X;
, where X = your value. That means it adds X amount to it`s value.
Reply
#3

Quote:
Originally Posted by antonio112
Посмотреть сообщение
++ is used to increase the value by 1 ... if you want to add more than 1, you should do like:
pawn Код:
Player[i][EXP] += X;
, where X = your value. That means it adds X amount to it`s value.
Oh i see thank you so much so if i wanted to take some it would just be "-= X"?
Reply
#4

pawn Код:
// Let's say Player[i][EXP] is 0

Player[i][EXP] // is the same as 0

Player[i][EXP]+ // Is the same as 0+

Player[i][EXP]++ // Is the same as 0+1 or Player[i][EXP]+Player[i][EXP]+1

// So lets say the value is 1 already

Player[i][EXP]++ // Is the same as Player[i][EXP]+Player[i][EXP]+1;
Reply
#5

Thanks antonio112 and Mike Garber, it helped me allot
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)