How to reset a public static integer?

Hey everyone
I am making a racing and driving game in which you are awarded cash if you finish first in a race. When the player takes first place in a race, a variable called “public static int FirstPos” changes to 1.
This is the code where this change takes place -

void OnTriggerExit(Collider other){

 if(other.tag == "CarPos"){
 positionDisplay.GetComponent<Text>().text = "Position - 1/2";
 FirstPos = 1;
 }
}

This variable is again referenced in the Race Finish Trigger, which awards the player $500 if this value equals 1 in the previous script. Here is the code for when the cash is given -

    FinalFirstPos = PosUp.FirstPos;
    if (FinalFirstPos == 1){
   GlobalCash.TotalCash += 500;
   PlayerPrefs.SetInt("SavedCash", GlobalCash.TotalCash);
   }

This all works fine until i win a race because when I do, the integral value is set to 1 and from then on, even if I lose races I still get cash. How can I fix this? Is there a way to reset that value back to 0? I’ve tried creating FirstPos = 0 in the first script (which has a similar if statement in the second script which adds 0 cash) but that does not work. Any ideas?

Hello,
you can set FinalFirstPos to 0 when you give the cash.

if (FinalFirstPos == 1) {
	FinalFirstPos = 0;
	GlobalCash.TotalCash += 500;
	PlayerPrefs.SetInt("SavedCash", GlobalCash.TotalCash);
}

Good luck