You might want to reconsider your design. The function returns the current players health, but you start with an intialization. This should be done somewhere else. The only thing this function should do is return and display the current health quantifier.
curPlayerHealth = maxPlayerHealth;
That's still not working. curPlayerHealth and maxPlayerHealth are both global.
The only reason why I made it a function is because maxPlayerHealth is set in a function before the currentPlayerHealth. Therefore since I'm setting curPlayerHealth to maxPlayerHealth, I need to set the variable before the currentPlayerHealth and after the function PlayerHealth() where maxPlayerHealth is defined.
Why not set current health equivent to max health in the same function where it's first defined? I mean, I don't understand why you need to set player health to max every time you want to query player health.
int currentPlayerHealth(int curPlayerHealth)
cout << "Current health: " << curPlayerHealth << endl;
cout << endl;
return curPlayerHealth; // not really needed since its value is the same
// as when the function was called
int maxPlayerHealth = 100;
int curPlayerHealth = maxPlayerHealth;
curPlayerHealth -= 30;
cin.get(); // to prevent the console from closing