My code has some error

Hello, I´m sorry for my bad inglish, but I have some problems with my code

//SENSOR DISTANCIA
// 1: Encender balizas para distancia menor a 80 cm
// 2: Buzzer encendido para distancia menor a 80cm
// 3: Encender motor dispensador de gas pimienta para distancia menor a 20cm
//SENSOR PIR
// 1: Encender balizas cuando se registre movimiento
// 2: Encender buzzer cuando se registre movimiento

int Distancia = 0;
int pirsensor = 0;
long readUltrasonicDistance(int triggerPin, int echoPin)
{
pinMode(triggerPin, OUTPUT);
digitalWrite(triggerPin, LOW);
delayMicroseconds(2);

digitalWrite(triggerPin, HIGH);
delayMicroseconds(10);
digitalWrite(triggerPin, LOW);
pinMode(echoPin, INPUT);

return pulseIn(echoPin, HIGH);
}

void setup()
{
pinMode(8, OUTPUT); //MOTOR
pinMode(2, OUTPUT); //LED 1
pinMode(3, OUTPUT); //BUZZER
Serial.begin(9600);
pinMode(6, OUTPUT); //LED 2
pinMode(7, INPUT); //SENSOR PIR

}

void loop() {
Distancia = 0.01723 * readUltrasonicDistance(11, 10);
if (Distancia <= 80) {
digitalWrite(2, HIGH);
digitalWrite(6, HIGH);
if (Distancia <= 20) {
digitalWrite(8, HIGH);
tone(3, 932, 250);
delay(500);
} else {
digitalWrite(8, LOW);
digitalWrite(2, LOW);
digitalWrite(6, LOW);
}
Serial.println(Distancia);
delay(100);

// SENSOR PIR
pirsensor = digitalRead(7);
if (pirsensor == HIGH)
{
digitalWrite(6, HIGH);
digitalWrite(2, HIGH);
tone(3, 932, 250);
delay(500);
}
else
{
digitalWrite(6, LOW);
digitalWrite(2, LOW);
}

delay(10);
}

int codigo;
bool flag=false;
float temperatura=0,0;

void setup()
{
pinMode(13,OUTPUT);
pinMode(12,OUTPUT);
pinMode(11,OUTPUT);
Serial.begin(9600);
}
void loop()
if(flag==false)
{
Serial.println("INGRESE LA CLAVE PARA ACTIVAR LA ALARMA");
delay(500);

codigo=Serial.parseInt();

if(codigo==4321)
{
 Serial.println("ALARMA ACTIVADA"); 
 flag=true;

}

else
{
temperatura=(analogRead(A0) * (500.0 / 1023.0) ) - 50.0;
if(temperatura >= 40)
{
alarma_activada();

}
}

}

void alarma_activada()
{
Serial.println("PRESENCIA DE POSIBLE INCENDIO");

}
While(flag==true)
{
digitalWrite(11, LOW);
digitalWrite(12, HIGH);
digitalWrite(13, HIGH);
delay(1000);

digitalWrite(11, HIGH);
digitalWrite(12, LOW);
digitalWrite(13, LOW);
delay(1000);
}
Serial.println("INGRESE LA CLAVE PARA DESACTIVAR LA ALARMA");
codigo=Serial.printl();

if(codigo==1234)
{
flag=false;
Serial.println("ALARMA DESACTIVADA");
digitalWrite(11, LOW);
}

Errors:

In function 'void loop()':
79:21: error: expected unqualified-id before numeric constant
82:2: error: a function-definition is not allowed here before '{' token
89:3: error: expected initializer before 'if'
116:2: error: a function-definition is not allowed here before '{' token
120:3: error: 'While' was not declared in this scope
120:3: note: suggested alternative: '__file'
133:18: error: 'class HardwareSerial' has no member named 'printl'; did you mean 'print'?
140:3: error: expected '}' at end of input exit status 1

I would appreciate it very much if you could help me or guide me, thanks

Your loop function does not have an opening curly brace: {

This should be a dot instead of a comma: float temperatura=0,0;
There are two functions called setup().
There are two functions called loop().
The first loop() is missing a '}' at the end.
The second loop() is missing a '{' at the begin and a '}' at the end.
The function alarma_activada() has a closing '}', but the function is not finished.
A While-statement is not with a capital 'W', it is while.
Typing mistake: Serial.printl();

Topic closed.

Please do NOT cross post / duplicate as it wastes peoples time and efforts to have more than one post for a single topic.

Continued cross posting could result in a time out from the forum.

Could you also take a few moments to Learn How To Use The Forum.

Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.