Advertisement
Guest User

[FS] ╬ Hospital ╬

a guest
Oct 13th, 2012
1,452
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.51 KB | None | 0 0
  1. /*Nunca retire os creditos
  2. by: ForT/dimmy_
  3. */
  4.  
  5.  
  6. #include <a_samp>
  7. #include <DOF2>
  8.  
  9. #define TempoHospital 90 //deine o tempo em segundos
  10. new TempoHospitalizado[MAX_PLAYERS];
  11. new Hospital[MAX_PLAYERS];
  12. new PickEntrada, PickSaida;
  13. new Spaawnado[MAX_PLAYERS];
  14. new Float:HospitalizadoSpawns[8][4] ={
  15. {367.5977,173.7776,1054.2555,272.0597},// 1
  16. {364.7985,174.2894,1054.2555,90.8313},// 2
  17. {364.8961,156.5384,1054.2555,91.9765},// 3
  18. {367.6027,156.2279,1054.2555,267.8217},// 4
  19. {360.0002,173.6618,1054.2555,270.4934},// 5
  20. {356.8971,173.8542,1054.2555,90.5766},// 6
  21. {357.0970,156.0924,1054.2555,92.2307},// 7
  22. {359.7027,155.9858,1054.2555,273.5864}};// 8
  23.  
  24. public OnFilterScriptInit()
  25. {
  26. print("\n---------------------------------------");
  27. print("• Filter Script (Hospital Regional) •");
  28. print(" By: ForT/dimmy_");
  29. print("---------------------------------------\n");
  30. return true;
  31. }
  32. public OnFilterScriptExit()
  33. {
  34. DOF2_Exit();
  35. return 1;
  36. }
  37. public OnGameModeInit()
  38. {
  39. SetTimer("TirarHospital", 1000, 1);
  40. Create3DTextLabel("{FF0000}(Hospital Regional de Los Santos)\n{FFFFFF}[ENTRADA]",0xFF0000FF,1154.0349,-1771.5258,16.5992,25.0,0);
  41. Create3DTextLabel("{FF0000}(Hospital Regional de Los Santos)\n{FFFFFF}[SAIDA]",0xFF0000FF,369.6563,165.0458,1053.2078,25.0,0);
  42. PickEntrada = CreatePickup(1318,23,1154.0349,-1771.5258,16.5992,-1); // ENRADA
  43. PickSaida = CreatePickup(1318,23,369.6563,165.0458,1053.2078,-1); // SAIDA
  44. //................[objetos]...............
  45. CreateObject(14597,358.69921875,165.099609375,1054.1999511719,0,0,0);
  46. CreateObject(1999,347.89999389648,163,1052.1999511719,0,0,180);
  47. CreateObject(1703,346.20001220703,167.39999389648,1052.1999511719,0,0,0);
  48. CreateObject(1703,349.70001220703,167.39999389648,1052.1999511719,0,0,0);
  49. CreateObject(1671,347,164,1052.6999511719,0,0,20);
  50. CreateObject(2167,348.79998779297,162.19999694824,1052.1999511719,0,0,180);
  51. CreateObject(2002,346,165.39999389648,1052.1999511719,0,0,90);
  52. CreateObject(2209,351.39999389648,162.80000305176,1052.1999511719,0,0,0);
  53. CreateObject(1806,351.60000610352,164,1052.1999511719,0,0,210);
  54. CreateObject(2894,351.5,162.80000305176,1053,0,0,0);
  55. CreateObject(11427,372.39999389648,165.10000610352,1059.4000244141,0,0,0.75);
  56. CreateObject(3383,356.39999389648,173.69999694824,1052.1999511719,0,0,270.75);
  57. CreateObject(3383,360.5,173.80000305176,1052.1999511719,0,0,89.4970703125);
  58. CreateObject(3383,368.10000610352,174,1052.1999511719,0,0,90);
  59. CreateObject(3383,364.29998779297,174,1052.1999511719,0,0,269.75);
  60. CreateObject(3383,368.10000610352,156.30000305176,1052.1999511719,0,0,90.25);
  61. CreateObject(3383,364.39999389648,156.30000305176,1052.1999511719,0,0,270.24719238281);
  62. CreateObject(3383,356.60000610352,156,1052.1999511719,0,0,270);
  63. CreateObject(3383,360.20001220703,156,1052.1999511719,0,0,90);
  64. return 1;
  65. }
  66.  
  67. public OnPlayerConnect(playerid)
  68. {
  69. Spaawnado[playerid] = 0;
  70. TempoHospitalizado[playerid] = 0;
  71. ChecarHospital(playerid);
  72. return 1;
  73. }
  74.  
  75. public OnPlayerDisconnect(playerid, reason)
  76. {
  77. new nome[34];
  78. new string[74];
  79. GetPlayerName(playerid, nome, 24);
  80. format(string, sizeof(string), "Tempo %s", nome);
  81. DOF2_SetInt("Hospitalizados.txt", string, TempoHospitalizado[playerid]);
  82. DOF2_SaveFile();
  83. return 1;
  84. }
  85.  
  86. public OnPlayerSpawn(playerid)
  87. {
  88. Spaawnado[playerid] = 1;
  89. SetTimerEx("checkhosp", 600, false, "i", playerid);
  90. return 1;
  91. }
  92.  
  93. public OnPlayerDeath(playerid, killerid, reason)
  94. {
  95. SendClientMessage(playerid, 0xBFC0C2FF, "[Informação] Você será internado no hospital: {FFFFFF}(Hospital Regional de Los Santos)");
  96. TempoHospitalizado[playerid] = TempoHospital;
  97. Hospital[playerid] = 1;
  98. return 1;
  99. }
  100.  
  101. public OnPlayerPickUpPickup(playerid, pickupid)
  102. {
  103. if(pickupid == PickEntrada)
  104. {
  105. SetPlayerPos(playerid, 365.6755,165.2340,1053.2151);
  106. SetPlayerFacingAngle(playerid, 89.6936);
  107. SetPlayerInterior(playerid, 10);
  108. SetPlayerVirtualWorld(playerid, 0);
  109. return true;
  110. }
  111. if(pickupid == PickSaida)
  112. {
  113. SetPlayerPos(playerid, 1154.2516,-1767.0458,16.5938);
  114. SetPlayerFacingAngle(playerid, 1.1203);
  115. SetPlayerInterior(playerid, 0);
  116. SetPlayerVirtualWorld(playerid, 0);
  117. return true;
  118. }
  119. return 1;
  120. }
  121.  
  122. forward checkhosp(playerid);
  123. public checkhosp(playerid)
  124. {
  125. if(TempoHospitalizado[playerid] > 0)
  126. {
  127. new rand;
  128. GameTextForPlayer(playerid, "~r~Hospitalizado em LS", 5000, 6);
  129. SetPlayerVirtualWorld(playerid, 0);
  130. SetPlayerInterior(playerid, 10);
  131. rand = random(sizeof(HospitalizadoSpawns));
  132. SetPlayerPos(playerid, HospitalizadoSpawns[rand][0], HospitalizadoSpawns[rand][1], HospitalizadoSpawns[rand][2]); // Warp the player
  133. SetPlayerFacingAngle(playerid, HospitalizadoSpawns[rand][3]);
  134. TogglePlayerControllable(playerid, 0);
  135. return true;
  136. }
  137. return 1;
  138. }
  139. forward TirarHospital();
  140. public TirarHospital()
  141. {
  142. new string[128];
  143. for(new i = 0; i < MAX_PLAYERS; i++)
  144. {
  145. if(IsPlayerConnected(i))
  146. {
  147. if(TempoHospitalizado[i] > 0 && Spaawnado[i] > 0)
  148. {
  149. TempoHospitalizado[i] --;
  150. format(string, sizeof(string), "~r~Tempo hospital~n~~w~%d", TempoHospitalizado[i]);
  151. GameTextForPlayer(i, string , 1200, 3);
  152. ApplyAnimation(i,"CRACK","crckdeth2",4.1,0,1,1,1,1);
  153. }
  154. if(TempoHospitalizado[i] <= 0 && Hospital[i] > 0 && Spaawnado[i] > 0)
  155. {
  156. Hospitalizadao(i);
  157. }
  158. }
  159. }
  160. return true;
  161. }
  162. forward ChecarHospital(playerid);
  163. public ChecarHospital(playerid)
  164. {
  165. new string[74];
  166. new nome[MAX_PLAYER_NAME];
  167. GetPlayerName(playerid, nome, sizeof(nome));
  168. format(string, sizeof(string), "Hospitalizados.txt");
  169. if(!DOF2_FileExists(string))
  170. {
  171. DOF2_CreateFile(string);
  172. }
  173. format(string, sizeof string, "Tempo %s", nome);
  174. TempoHospitalizado[playerid] = DOF2_GetInt("Hospitalizados.txt", string);
  175. if(TempoHospitalizado[playerid] > 0)
  176. {
  177. Hospital[playerid] = 1;
  178. }
  179. return true;
  180. }
  181. forward Hospitalizadao(playerid);
  182. public Hospitalizadao(playerid)
  183. {
  184. if(Hospital[playerid] > 0 && TempoHospitalizado[playerid] <= 1 && Spaawnado[playerid] > 0)
  185. {
  186. TempoHospitalizado[playerid] = 0;
  187. TogglePlayerControllable(playerid, 1);
  188. SendClientMessage(playerid, -1, "Você ja recebeu alta do Hospital, e está completamente recuperado.");
  189. SetPlayerPos(playerid, 357.6348,165.1096,1053.2151);
  190. SetPlayerFacingAngle(playerid, 270.1344);
  191. Hospital[playerid] = 0;
  192. ClearAnimations(playerid, 1);
  193. return true;
  194. }
  195. return 1;
  196. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement