How to increase enum by a specific number
#1

Hi.

I know that I can increase an enum with the 2 '+''s.

pawn Код:
PlayerInfo[playerid][pExperience2]++;
What do I write so that this increases by 100? Sort of like this:

pawn Код:
PlayerInfo[playerid][pExperience2]+ 100;
Thanks.
Reply
#2

Quote:
Originally Posted by TheTerminator
Посмотреть сообщение
Hi.

I know that I can increase an enum with the 2 '+''s.

pawn Код:
PlayerInfo[playerid][pExperience2]++;
What do I write so that this increases by 100? Sort of like this:

pawn Код:
PlayerInfo[playerid][pExperience2]+ 100;
Thanks.
Hello.
Do you know anything about += -= *= /= operators, yet? Apparently - You should.

pawn Код:
PlayerInfo[playerid][pExperience2] += 100; // Increase pExperience2 by 100
Greetings.
Reply
#3

I actually did that, but wasn't sure if it would actually work since I couldn't be bothered to spend time making new commands to test it out.

Thank you!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)