Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Sistema de carteira de motorista e radar feito por Darth_Vader, mantenha os créditos porfavor //
- #include <a_samp>
- // Modelo do veículo
- #define VMedic 416
- // Variaveis
- new PacientePoint[MAX_PLAYERS], TerminarMissao[MAX_PLAYERS], PacientesCurados[MAX_PLAYERS], TempoSaiudoCarro[MAX_PLAYERS], Contar[MAX_PLAYERS],
- Paciente[MAX_PLAYERS], ContarBatidas[MAX_PLAYERS], bool:IsAMed[MAX_PLAYERS], bool:Trabalhando[MAX_PLAYERS], bool:SaiudoCarro[MAX_PLAYERS],
- ParamedicoPickup, String[128], Float:x, Float:y, Float:z;
- // Localização e skin dos pacientes
- enum TPacientes
- {
- LocalPaciente[50],
- Float:PaciX,
- Float:PaciY,
- Float:PaciZ
- }
- new APacientes[][TPacientes] =
- {
- {"Old Venturas Strip", 2250.7146,2158.7766,10.8203},
- {"The Visage", 2024.2467,1920.5061,12.3389},
- {"Las Venturas Airport - A", 1725.4508,1528.3914,10.8203},
- {"Las Venturas Airport - B", 1712.5109,1266.7162,10.7140},
- {"Caligula's Palace", 2081.6206,1703.4639,10.8203},
- {"The Strip", 2160.4744,2068.6152,10.8203},
- {"Redsands East", 2048.5957,2121.2590,10.8203},
- {"The Emerald Isle", 2128.7043,2354.6108,10.6719},
- {"The Camel's Toe", 2150.8528,1365.1405,10.8203},
- {"The Pink Swan", 2035.8386,1174.2395,10.8203}
- };
- new SkinPaciente[] =
- {
- 1,
- 4,
- 6,
- 15,
- 20,
- 21,
- 78,
- 101
- };
- public OnGameModeInit()
- {
- // Mantenha os créditos porfavor //
- print("\n\n Sistema de carteira de motorista e radar feito por Darth_Vader\n\n");
- // Pickup do emprego
- ParamedicoPickup = CreatePickup(1581, 2, 1607.2861, 1817.0649, 10.8203), Create3DTextLabel("{00FF7F}Aproxime-se para torna-se um\n{FFFFFF}paramedico", -1, 1607.2861, 1817.0649, 10.8203, 15, 0, 0);
- // Veiculos
- AddStaticVehicle(VMedic, 1617.0050, 1830.9409, 10.9694, 179, 1, 3);
- AddStaticVehicle(VMedic, 1612.6760, 1830.9409, 10.4505, 179, 1, 3);
- AddStaticVehicle(VMedic, 1608.5352, 1830.9409, 10.4505, 179, 1, 3);
- AddStaticVehicle(VMedic, 1604.2271, 1830.9409, 10.4505, 179, 1, 3);
- AddStaticVehicle(VMedic, 1600.1797, 1830.9409, 10.4505, 179, 1, 3);
- AddStaticVehicle(VMedic, 1596.1735, 1830.9409, 10.4505, 179, 1, 3);
- return 1;
- }
- // Mantenha os créditos porfavor //
- public OnPlayerConnect(playerid) return SendClientMessage(playerid, -1, "Esse servidor possui um sistema de carteira de motorista feito por Darth_Vader");
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- if(newstate == PLAYER_STATE_DRIVER)
- {
- if(GetVehicleModel(vehicleid) == VMedic && IsAMed[playerid] == false) return SendClientMessage(playerid, -1, "{FF0000}Voce nao pode usar um veiculo de Paramedico."), RemovePlayerFromVehicle(playerid);
- if(GetVehicleModel(vehicleid) == VMedic && IsAMed[playerid] == true && Trabalhando[playerid] == false && PacientesCurados[playerid] < 5) return SetTimerEx("ComecarTrabalho", 5000, false, "i", playerid);
- if(Trabalhando[playerid] == true && SaiudoCarro[playerid] == true) return KillTimer(TempoSaiudoCarro[playerid]);
- }
- if(Trabalhando[playerid] == true && newstate != PLAYER_STATE_DRIVER) return SaiudoCarro[playerid] = true, Contar[playerid] = 60, TempoSaiudoCarro[playerid] = SetTimerEx("ForadoCarro", 1000, true, "i", playerid);
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- if(PacientePoint[playerid])
- {
- if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, "{FF0000}({FFFFFF}ERRO{FF0000})Você tem que estar de pé para cuidar do {FFFFFF}paciente{FF0000}.");
- ApplyAnimation(playerid,"MEDIC","CPR",4.1,0,1,1,1,1);
- SetTimerEx("SonsdoTrabalho", 3176, false, "i", playerid), ContarBatidas[playerid] = 1;
- TerminarMissao[playerid] = SetTimerEx("FimdoTrabalho", 6000, false, "i", playerid);
- GameTextForPlayer(playerid,"Fazendo massagem cardiaca..", 6000, 5);
- DisablePlayerCheckpoint(playerid), KillTimer(TempoSaiudoCarro[playerid]);
- }
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(newkeys==KEY_CTRL_BACK) return AcabarTrabalho(playerid);
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- if(pickupid == ParamedicoPickup)
- {
- if(IsAMed[playerid] == false) return IsAMed[playerid] = true, SetPlayerSkin(playerid, 276);
- }
- return 1;
- }
- forward ComecarTrabalho(playerid);
- public ComecarTrabalho(playerid)
- {
- new Rand;
- Trabalhando[playerid] = true, Rand = random(sizeof(APacientes));
- format(String, sizeof(String), "{00FF7F}Paciente desmaiado na redondezas de {FFFFFF}%s{00FF7F}.", APacientes[Rand][LocalPaciente]);
- SendClientMessage(playerid, -1, String);
- x = APacientes[Rand][PaciX], y = APacientes[Rand][PaciY], z = APacientes[Rand][PaciZ];
- Paciente[playerid] = CreateActor(SkinPaciente[random(sizeof(SkinPaciente))], x, y, z, 0.60);
- ApplyActorAnimation(Paciente[playerid],"PED","EV_dive",4.0,0,1,1, 1,0);
- PacientePoint[playerid] = SetPlayerCheckpoint(playerid, x, y, z, 1.0);
- return 1;
- }
- forward SonsdoTrabalho(playerid);
- public SonsdoTrabalho(playerid)
- {
- if(ContarBatidas[playerid] == 1) return ContarBatidas[playerid]++, PlayerPlaySound(playerid, 1163, 0, 0 , 0), SetTimerEx("SonsdoTrabalho", 1176, false, "i", playerid);
- if(ContarBatidas[playerid] == 2) return ContarBatidas[playerid]++, PlayerPlaySound(playerid, 1163, 0, 0 , 0), SetTimerEx("SonsdoTrabalho", 1176, false, "i", playerid);
- if(ContarBatidas[playerid] == 3) return ContarBatidas[playerid] = 0, PlayerPlaySound(playerid, 1163, 0, 0 , 0);
- return 0;
- }
- forward FimdoTrabalho(playerid);
- public FimdoTrabalho(playerid)
- {
- GivePlayerMoney(playerid, 4500), SetPlayerScore(playerid, GetPlayerScore(playerid)+1);
- ClearActorAnimations(Paciente[playerid]), PacientesCurados[playerid]++;
- ApplyActorAnimation(Paciente[playerid], "PED", "IDLE_tired", 3.0, 1, 0, 0, 0, 10000);
- GetPlayerPos(playerid, x, y, z), SetPlayerPos(playerid, x, y, z+1),
- SendClientMessage(playerid, -1, "{A9C4E4}Você ganhou {00FF00}R${FFFFFF}4500 {A9C4E4}+ {FFFFFF}1 {A9C4E4}score por ter curado o paciente.");
- TempoSaiudoCarro[playerid] = SetTimerEx("ForadoCarro", 1000, true, "i", playerid), SaiudoCarro[playerid] = true;
- if(PacientesCurados[playerid] < 5) return SetTimerEx("RemoverPaciente", 8000, false, "i", playerid), SetTimerEx("ComecarTrabalho", 11000, false, "i" , playerid);
- else if(PacientesCurados[playerid] == 5)
- {
- new Nome[24];
- GetPlayerName(playerid, Nome, sizeof(Nome));
- format(String, sizeof(String), "{00FF7F}O Medico {FFFFFF}%s {00FF7F}curou 5 pacientes.", Nome);
- SendClientMessageToAll(-1, String);
- Trabalhando[playerid] = false, PacientesCurados[playerid] = 0, SetTimerEx("RemoverPaciente", 4000, false, "i", playerid), KillTimer(TempoSaiudoCarro[playerid]), KillTimer(TerminarMissao[playerid]);
- }
- return 0;
- }
- forward ForadoCarro(playerid);
- public ForadoCarro(playerid)
- {
- new TextoContar[128];
- if(Contar[playerid] == 0) return SetTimerEx("AcabarTrabalho", 1000, false, "i", playerid);
- if(Contar[playerid] > 0)
- {
- Contar[playerid]--;
- }
- format(TextoContar, sizeof(TextoContar), "~g~Voce tem ~w~%i ~g~para voltar para o veiculo!", Contar[playerid]);
- GameTextForPlayer(playerid, TextoContar, 1000, 4);
- return 1;
- }
- forward AcabarTrabalho(playerid);
- public AcabarTrabalho(playerid) return DisablePlayerCheckpoint(playerid), RemoverPaciente(playerid), KillTimer(TempoSaiudoCarro[playerid]), Trabalhando[playerid] = false, PacientesCurados[playerid] = 0, KillTimer(TerminarMissao[playerid]);
- forward RemoverPaciente(playerid);
- public RemoverPaciente(playerid) return DestroyActor(Paciente[playerid]);
Advertisement
Add Comment
Please, Sign In to add comment