PHP код:
if(strcmp(cmd, "/reanimar",true)==0)
{
if(PlayerInfo[playerid][Emprego] == 2)
{
for(new i; i < MAX_PLAYERS; i++)
{
new giveplayerid, Float: x, Float: y, Float: z;
if(PlayerSolicitoMedico[i] == true)
{
GetPlayerPos(i, x, y, z);
if(PlayerToPoint(2.0, playerid, x, y, z))
{
SendClientMessage(giveplayerid, -1, "O mйdico estб tentando reanima-lo.");
SendClientMessage(playerid, -1, "Vocк estб tentando reanimando o player");
Controle(playerid, 0);
ApplyAnimation(playerid,"MEDIC","CPR",4.1,0,1,1,0,8000);
ApplyAnimation(playerid,"MEDIC","CPR",4.1,0,1,1,0,8000);
PlayerSolicitoMedico[giveplayerid] = false;
SetTimerEx("LevaPacAmbulancia", 8000, 0, "i", playerid);
printf("%d",giveplayerid);
return true;
} else return SendClientMessage(playerid, -1, "Vocк nгo estб perto de nenhuma vitima.");
}
}
return true;
} else return SendClientMessage(playerid, -1, "Vocк nгo й Mйdico.");
}
forward LevaPacAmbulancia(playerid);
public LevaPacAmbulancia(playerid){
new giveplayerid;
SendClientMessage(playerid, COR_LARANJA, "Vocк conseguiu reanimar a vitima, entre na ambulвncia e dк /subir paciente.");
ReanimarPac[playerid] = true;
Controle(playerid, 1);
SetPlayerHealth(giveplayerid, 100);
printf("%d",giveplayerid);
for(new m; m<MAX_PLAYERS; m++)
{
if(PlayerInfo[m][Emprego] == 2)
{
RemovePlayerMapIcon(m, 0);
return true;
}
}
return 1;
}
if(strcmp(cmd, "/subir",true)==0)
{
new x_tmp[32];
x_tmp = strtok(cmdtext, idx);
if(!strlen(x_tmp))
{
SendClientMessage(playerid, COR_LARANJA, "Use: /subir [serviзo]");
SendClientMessage(playerid, COR_AMARELO, "Serviзos: /subir paciente || /subir suspeito");
return true;
}
if(strcmp(x_tmp, "paciente", true) == 0)
{
if(PlayerInfo[playerid][Emprego] == 2)
{
if(ReanimarPac[playerid] == true)
{
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
if(IsPlayerInAnyVehicle(playerid) && GetVehicleModel(vehicleid) == 416)
{
new Float: x,Float: y,Float: z;
new giveplayerid;
GetPlayerPos(giveplayerid, x, y, z);
if(PlayerToPoint(10.0, playerid, x, y, z))
{
KillTimer(TimerMorto[giveplayerid]);
Controle(giveplayerid, 0);
PutPlayerInVehicle(giveplayerid, vehicleid, 2);
SendClientMessage(playerid, -1, "O paciente estб na ambulвncia leve-o imediatamente para o Hospital mais prуximo.");
SetPlayerCheckpoint(playerid, 1178.4418,-1308.8868,13.7748, 10.0);
PacienteAmbulancia[playerid] = true;
printf("%d",giveplayerid);
return true;
} else return SendClientMessage(playerid, -1, "Vocк precisa estar perto da vitima.");
} else return SendClientMessage(playerid, -1, "Vocк precisa estar em uma ambulвncia.");
} else return SendClientMessage(playerid, -1, "Vocк nгo reanimou nenhuma vitima.");
} else return SendClientMessage(playerid, -1, "Vocк nгo й Mйdico.");
}
return 1;
}