[Question] Proper Usage of "+" and "-"

Alright, so I’ve been scripting this command called .nudge, which basically moves you a certain amount of units in the x, y, or z direction (RBAC.h edits, Player.cpp edits, Player.h edits, and a custom command file cs_nudge.cpp included). In addition, I’ve been trying to script a command that allows whoever uses the command to redefine the distance that the command “nudges” them to (.modify nudge edit). The problem I’ve been having is when I try compiling the core, it fails as a result of me not understanding how to use the + and - functions properly (see: cs_nudge.cpp). If you look at where I scripted HandleNudgeZCommand, I attempted to implement these functions by allowing .nudge z up $distance to add the selected nudge distance to the default (3), and for .nudge z down $distance to subtract the distance from the default. My question is: how should I reformat it so that it makes this possible and allows the core to compile? Thank you in advance.

remove the ; characters before the + and -

You use ; at the end of the line or a function call to mark the end of an operation.

This means that currently the code like z = player->GetPositionZ(); + player->GetNudgeDistance();

actually translates to

z = player->GetPositionZ();

  • player->GetNudgeDistance();

which makes no sense at all.

Yeah, I noticed that typo as I went back into the file. Thank you for the help.