How to increase enum by a specific number - 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)
+--- Thread: How to increase enum by a specific number (
/showthread.php?tid=580075)
How to increase enum by a specific number -
TheTerminator - 02.07.2015
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.
Re: How to increase enum by a specific number -
LetsOWN[PL] - 02.07.2015
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.
Re: How to increase enum by a specific number -
TheTerminator - 02.07.2015
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!