Push button for arduino mini through RF module

I am working on a project for an RC truck.
I am controlling servos for a “turret” on top of my RC truck. I would also like to control an airsoft gun.
I have had help with controlling the servos but im not quite sure how to code the pushbutton for the gun control. The gun will have power and ground obviously but i was thinking the arduino could control when it gets a voltage so it only fires when i push the button on transmitter. Ill post my code. My code i was adding for the button is in comment brackets. I havent started the receiver code yet.

TRANSMITTER

#include <SPI.h>
#include "RF24.h" 
RF24 radio(9,10);
const uint64_t pipe = 0xE8E8F0F0E1LL; 
int msg[1]; 
int potpin_1 = A0; 
int val_1; 
int potpin_2 = A1; 
int val_2; 
/* int buttonPin = 8;
int buttonpush;           */
void setup(void){
radio.begin();
radio.openWritingPipe(pipe);
/*pinMode(buttonPin, INPUT);*/
 
}
void loop() {
val_1 = analogRead(potpin_1),val_1 = map(val_1, 0, 1023, 0, 127),msg[0] = val_1,radio.write(msg, 1);
val_2 = analogRead(potpin_2),val_2 = map(val_2, 0, 1023, 128, 255),msg[0] = val_2,radio.write(msg, 1);
/*buttonpush= digitalread(buttonPin), msg[0] = buttonpush,radio.write(msg,1); */
}

RECEIVER

#include <Servo.h>
#include <SPI.h>
#include "RF24.h"
Servo servo1;
Servo servo2;
RF24 radio(9,10);
const uint64_t pipe = 0xE8E8F0F0E1LL; 
int msg[1]; 
int data; 
int pos;
/*int buttonreceive; */
void setup()
{
servo1.attach(3); 
servo2.attach(7);
radio.begin();
radio.openReadingPipe(1,pipe); 
radio.startListening();
}
void loop()
{
if (radio.available())radio.read(msg, 1);
if (msg[0] <128 && msg[0] >-1)data = msg[0], pos = map(data, 0, 127, 7, 177),servo1.write(pos);
if (msg[0] >127 && msg[0] <255)data = msg[0], pos = map(data, 128, 254, 9, 177),servo2.write(pos);
/
}

I think i already found an error. Should i be using analog read and not digital read?

I think i already found an error. Should i be using analog read and not digital read?

For what? The transmitter will be reading from an IR remote, won’t it? That means that you will be using the IRremote library.

/* int buttonPin = 8;
int buttonpush;           */

Unless you are using the Arduino with 65000 pins, numbered -32500 to 32500, the proper type is byte. Unless the pin number will change at run time, the variable should be const.

Unless you have an Arduino that is radically different from mine, there are only two states a pin can be in, so you hardly need a variable that can hold states from -32768 ti 32767.

Learn NOW to pay attention to how much memory you are uselessly wasting.

/*buttonpush= digitalread(buttonPin), msg[0] = buttonpush,radio.write(msg,1); */

Do NOT separate statements with commas. Do NOT put more than one statement on a line.