Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Nunca retire os creditos
- by: ForT/dimmy_
- */
- #include <a_samp>
- #include <DOF2>
- #define TempoHospital 90 //deine o tempo em segundos
- new TempoHospitalizado[MAX_PLAYERS];
- new Hospital[MAX_PLAYERS];
- new PickEntrada, PickSaida;
- new Spaawnado[MAX_PLAYERS];
- new Float:HospitalizadoSpawns[8][4] ={
- {367.5977,173.7776,1054.2555,272.0597},// 1
- {364.7985,174.2894,1054.2555,90.8313},// 2
- {364.8961,156.5384,1054.2555,91.9765},// 3
- {367.6027,156.2279,1054.2555,267.8217},// 4
- {360.0002,173.6618,1054.2555,270.4934},// 5
- {356.8971,173.8542,1054.2555,90.5766},// 6
- {357.0970,156.0924,1054.2555,92.2307},// 7
- {359.7027,155.9858,1054.2555,273.5864}};// 8
- public OnFilterScriptInit()
- {
- print("\n---------------------------------------");
- print("• Filter Script (Hospital Regional) •");
- print(" By: ForT/dimmy_");
- print("---------------------------------------\n");
- return true;
- }
- public OnFilterScriptExit()
- {
- DOF2_Exit();
- return 1;
- }
- public OnGameModeInit()
- {
- SetTimer("TirarHospital", 1000, 1);
- Create3DTextLabel("{FF0000}(Hospital Regional de Los Santos)\n{FFFFFF}[ENTRADA]",0xFF0000FF,1154.0349,-1771.5258,16.5992,25.0,0);
- Create3DTextLabel("{FF0000}(Hospital Regional de Los Santos)\n{FFFFFF}[SAIDA]",0xFF0000FF,369.6563,165.0458,1053.2078,25.0,0);
- PickEntrada = CreatePickup(1318,23,1154.0349,-1771.5258,16.5992,-1); // ENRADA
- PickSaida = CreatePickup(1318,23,369.6563,165.0458,1053.2078,-1); // SAIDA
- //................[objetos]...............
- CreateObject(14597,358.69921875,165.099609375,1054.1999511719,0,0,0);
- CreateObject(1999,347.89999389648,163,1052.1999511719,0,0,180);
- CreateObject(1703,346.20001220703,167.39999389648,1052.1999511719,0,0,0);
- CreateObject(1703,349.70001220703,167.39999389648,1052.1999511719,0,0,0);
- CreateObject(1671,347,164,1052.6999511719,0,0,20);
- CreateObject(2167,348.79998779297,162.19999694824,1052.1999511719,0,0,180);
- CreateObject(2002,346,165.39999389648,1052.1999511719,0,0,90);
- CreateObject(2209,351.39999389648,162.80000305176,1052.1999511719,0,0,0);
- CreateObject(1806,351.60000610352,164,1052.1999511719,0,0,210);
- CreateObject(2894,351.5,162.80000305176,1053,0,0,0);
- CreateObject(11427,372.39999389648,165.10000610352,1059.4000244141,0,0,0.75);
- CreateObject(3383,356.39999389648,173.69999694824,1052.1999511719,0,0,270.75);
- CreateObject(3383,360.5,173.80000305176,1052.1999511719,0,0,89.4970703125);
- CreateObject(3383,368.10000610352,174,1052.1999511719,0,0,90);
- CreateObject(3383,364.29998779297,174,1052.1999511719,0,0,269.75);
- CreateObject(3383,368.10000610352,156.30000305176,1052.1999511719,0,0,90.25);
- CreateObject(3383,364.39999389648,156.30000305176,1052.1999511719,0,0,270.24719238281);
- CreateObject(3383,356.60000610352,156,1052.1999511719,0,0,270);
- CreateObject(3383,360.20001220703,156,1052.1999511719,0,0,90);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- Spaawnado[playerid] = 0;
- TempoHospitalizado[playerid] = 0;
- ChecarHospital(playerid);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- new nome[34];
- new string[74];
- GetPlayerName(playerid, nome, 24);
- format(string, sizeof(string), "Tempo %s", nome);
- DOF2_SetInt("Hospitalizados.txt", string, TempoHospitalizado[playerid]);
- DOF2_SaveFile();
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- Spaawnado[playerid] = 1;
- SetTimerEx("checkhosp", 600, false, "i", playerid);
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- SendClientMessage(playerid, 0xBFC0C2FF, "[Informação] Você será internado no hospital: {FFFFFF}(Hospital Regional de Los Santos)");
- TempoHospitalizado[playerid] = TempoHospital;
- Hospital[playerid] = 1;
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- if(pickupid == PickEntrada)
- {
- SetPlayerPos(playerid, 365.6755,165.2340,1053.2151);
- SetPlayerFacingAngle(playerid, 89.6936);
- SetPlayerInterior(playerid, 10);
- SetPlayerVirtualWorld(playerid, 0);
- return true;
- }
- if(pickupid == PickSaida)
- {
- SetPlayerPos(playerid, 1154.2516,-1767.0458,16.5938);
- SetPlayerFacingAngle(playerid, 1.1203);
- SetPlayerInterior(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- return true;
- }
- return 1;
- }
- forward checkhosp(playerid);
- public checkhosp(playerid)
- {
- if(TempoHospitalizado[playerid] > 0)
- {
- new rand;
- GameTextForPlayer(playerid, "~r~Hospitalizado em LS", 5000, 6);
- SetPlayerVirtualWorld(playerid, 0);
- SetPlayerInterior(playerid, 10);
- rand = random(sizeof(HospitalizadoSpawns));
- SetPlayerPos(playerid, HospitalizadoSpawns[rand][0], HospitalizadoSpawns[rand][1], HospitalizadoSpawns[rand][2]); // Warp the player
- SetPlayerFacingAngle(playerid, HospitalizadoSpawns[rand][3]);
- TogglePlayerControllable(playerid, 0);
- return true;
- }
- return 1;
- }
- forward TirarHospital();
- public TirarHospital()
- {
- new string[128];
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(TempoHospitalizado[i] > 0 && Spaawnado[i] > 0)
- {
- TempoHospitalizado[i] --;
- format(string, sizeof(string), "~r~Tempo hospital~n~~w~%d", TempoHospitalizado[i]);
- GameTextForPlayer(i, string , 1200, 3);
- ApplyAnimation(i,"CRACK","crckdeth2",4.1,0,1,1,1,1);
- }
- if(TempoHospitalizado[i] <= 0 && Hospital[i] > 0 && Spaawnado[i] > 0)
- {
- Hospitalizadao(i);
- }
- }
- }
- return true;
- }
- forward ChecarHospital(playerid);
- public ChecarHospital(playerid)
- {
- new string[74];
- new nome[MAX_PLAYER_NAME];
- GetPlayerName(playerid, nome, sizeof(nome));
- format(string, sizeof(string), "Hospitalizados.txt");
- if(!DOF2_FileExists(string))
- {
- DOF2_CreateFile(string);
- }
- format(string, sizeof string, "Tempo %s", nome);
- TempoHospitalizado[playerid] = DOF2_GetInt("Hospitalizados.txt", string);
- if(TempoHospitalizado[playerid] > 0)
- {
- Hospital[playerid] = 1;
- }
- return true;
- }
- forward Hospitalizadao(playerid);
- public Hospitalizadao(playerid)
- {
- if(Hospital[playerid] > 0 && TempoHospitalizado[playerid] <= 1 && Spaawnado[playerid] > 0)
- {
- TempoHospitalizado[playerid] = 0;
- TogglePlayerControllable(playerid, 1);
- SendClientMessage(playerid, -1, "Você ja recebeu alta do Hospital, e está completamente recuperado.");
- SetPlayerPos(playerid, 357.6348,165.1096,1053.2151);
- SetPlayerFacingAngle(playerid, 270.1344);
- Hospital[playerid] = 0;
- ClearAnimations(playerid, 1);
- return true;
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement