medic.pwn 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624
  1. /*
  2. /$$ /$$ /$$$$$$ /$$$$$$$ /$$$$$$$
  3. | $$$ | $$ /$$__ $$ | $$__ $$| $$__ $$
  4. | $$$$| $$| $$ \__/ | $$ \ $$| $$ \ $$
  5. | $$ $$ $$| $$ /$$$$ /$$$$$$| $$$$$$$/| $$$$$$$/
  6. | $$ $$$$| $$|_ $$|______/| $$__ $$| $$____/
  7. | $$\ $$$| $$ \ $$ | $$ \ $$| $$
  8. | $$ \ $$| $$$$$$/ | $$ | $$| $$
  9. |__/ \__/ \______/ |__/ |__/|__/
  10. Medic Group Type
  11. Next Generation Gaming, LLC
  12. (created by Next Generation Gaming Development Team)
  13. * Copyright (c) 2016, Next Generation Gaming, LLC
  14. *
  15. * All rights reserved.
  16. *
  17. * Redistribution and use in source and binary forms, with or without modification,
  18. * are not permitted in any case.
  19. *
  20. *
  21. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  24. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  25. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  26. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  27. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  28. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  29. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  30. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  31. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32. */
  33. forward ShowPlayerBeaconForMedics(playerid);
  34. public ShowPlayerBeaconForMedics(playerid)
  35. {
  36. foreach(new i: Player)
  37. {
  38. if(IsAMedic(i))
  39. {
  40. SetPlayerMarkerForPlayer(i, playerid, COP_GREEN_COLOR);
  41. }
  42. }
  43. return 1;
  44. }
  45. forward HidePlayerBeaconForMedics(playerid);
  46. public HidePlayerBeaconForMedics(playerid)
  47. {
  48. foreach(new i: Player)
  49. {
  50. if(IsAMedic(i))
  51. {
  52. SetPlayerMarkerForPlayer(i, playerid, TEAM_HIT_COLOR);
  53. }
  54. }
  55. SetPlayerToTeamColor(playerid);
  56. return 1;
  57. }
  58. forward MoveEMS(playerid);
  59. public MoveEMS(playerid)
  60. {
  61. new Float:mX, Float:mY, Float:mZ,
  62. iTargetPlayerID = GetPVarInt(playerid, "MovingStretcher");
  63. GetPlayerPos(playerid, mX, mY, mZ);
  64. SetPVarFloat(iTargetPlayerID, "MedicX", mX);
  65. SetPVarFloat(iTargetPlayerID, "MedicY", mY);
  66. SetPVarFloat(iTargetPlayerID, "MedicZ", mZ);
  67. SetPVarInt(iTargetPlayerID, "MedicVW", GetPlayerVirtualWorld(playerid));
  68. SetPVarInt(iTargetPlayerID, "MedicInt", GetPlayerInterior(playerid));
  69. Streamer_UpdateEx(iTargetPlayerID, mX, mY, mZ);
  70. SetPlayerPos(iTargetPlayerID, mX, mY, mZ);
  71. SetPlayerInterior(iTargetPlayerID, GetPlayerVirtualWorld(playerid));
  72. SetPlayerVirtualWorld(iTargetPlayerID, GetPlayerVirtualWorld(playerid));
  73. ClearAnimationsEx(iTargetPlayerID);
  74. if(!IsPlayerInAnyVehicle(iTargetPlayerID)) ApplyAnimation(iTargetPlayerID, "SWAT", "gnstwall_injurd", 4.0, 0, 1, 1, 1, 0, 1);
  75. DeletePVar(iTargetPlayerID, "OnStretcher");
  76. DeletePVar(playerid, "MovingStretcher");
  77. }
  78. forward KillEMSQueue(playerid);
  79. public KillEMSQueue(playerid)
  80. {
  81. DestroyObject(GetPVarInt(playerid, "DS_OBJ"));
  82. DeletePVar(playerid, "DS_OBJ");
  83. DeletePVar(playerid, "Injured");
  84. DeletePVar(playerid, "InjuredWait");
  85. DeletePVar(playerid, "EMSAttempt");
  86. SetPVarInt(playerid, "MedicBill", 1);
  87. DeletePVar(playerid, "MedicCall");
  88. DeletePVar(playerid, "EMSWarns");
  89. DeletePVar(playerid, "_energybar");
  90. DestroyDynamic3DTextLabel(Text3D:GetPVarInt(playerid, "InjuredTL"));
  91. DeletePVar(playerid, "InjuredTL");
  92. SetCameraBehindPlayer(playerid);
  93. return 1;
  94. }
  95. forward SendEMSQueue(playerid,type);
  96. public SendEMSQueue(playerid,type)
  97. {
  98. #if defined zombiemode
  99. if(zombieevent == 1 && GetPVarType(playerid, "pIsZombie"))
  100. {
  101. KillEMSQueue(playerid);
  102. SpawnPlayer(playerid);
  103. return 1;
  104. }
  105. if(zombieevent == 1 && GetPVarType(playerid, "pZombieBit"))
  106. {
  107. KillEMSQueue(playerid);
  108. ClearAnimationsEx(playerid);
  109. MakeZombie(playerid);
  110. return 1;
  111. }
  112. #endif
  113. switch (type)
  114. {
  115. case 1:
  116. {
  117. Streamer_UpdateEx(playerid, GetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
  118. SetPlayerPos(playerid, GetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"));
  119. SetPlayerVirtualWorld(playerid, GetPVarInt(playerid,"MedicVW"));
  120. SetPlayerInterior(playerid, GetPVarInt(playerid,"MedicInt"));
  121. SetPVarInt(playerid, "EMSAttempt", -1);
  122. if(GetPlayerInterior(playerid) > 0) Player_StreamPrep(playerid, GetPVarFloat(playerid,"MedicX"), GetPVarFloat(playerid,"MedicY"), GetPVarFloat(playerid,"MedicZ"), FREEZE_TIME);
  123. GameTextForPlayer(playerid, "~r~Injured~n~~w~/accept death or /service ems", 5000, 3);
  124. ClearAnimationsEx(playerid);
  125. PlayDeathAnimation(playerid);
  126. SetHealth(playerid, 100);
  127. RemoveArmor(playerid);
  128. if(GetPVarInt(playerid, "usingfirstaid") == 1)
  129. {
  130. firstaidexpire(playerid);
  131. }
  132. SetPVarInt(playerid,"MedicCall",1);
  133. }
  134. case 2:
  135. {
  136. SetPVarInt(playerid,"EMSAttempt", 2);
  137. ClearAnimationsEx(playerid);
  138. if(!IsPlayerInAnyVehicle(playerid)) ApplyAnimation(playerid, "SWAT", "gnstwall_injurd", 4.0, 0, 1, 1, 1, 0, 1);
  139. SetHealth(playerid, 50); // Set to 50.
  140. RemoveArmor(playerid);
  141. }
  142. }
  143. return 1;
  144. }
  145. PlayDeathAnimation(playerid) {
  146. new i = random(5);
  147. switch(i) {
  148. case 0: ApplyAnimation(playerid, "KNIFE", "KILL_Knife_Ped_Die", 4.0, 0, 1, 1, 1, 0, 1);
  149. case 1: ApplyAnimation(playerid, "PED", "KO_shot_stom", 4.0, 0, 1, 1, 1, 0, 1);
  150. case 2: ApplyAnimation(playerid, "PED", "KO_shot_stom", 4.0, 0, 1, 1, 1, 0, 1);
  151. case 3: ApplyAnimation(playerid, "PED", "BIKE_fall_off", 4.1, 0, 1, 1, 1, 0, 1);
  152. case 4: ApplyAnimation(playerid, "BASEBALL", "Bat_Hit_3", 4.1, 0, 1, 1, 1, 0, 1);
  153. default: ApplyAnimation(playerid, "FIGHT_E", "Hit_fightkick_B", 4.1, 0, 1, 1, 1, 0, 1);
  154. }
  155. }
  156. Medic_GetPatient(playerid, params[]) {
  157. if(IsAMedic(playerid) || IsFirstAid(playerid))
  158. {
  159. new string[128], giveplayerid;
  160. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /getpt(patient) [player]");
  161. if(IsPlayerConnected(giveplayerid))
  162. {
  163. if (giveplayerid == playerid)
  164. {
  165. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "You cannot accept your own Emergency Dispatch call!");
  166. return 1;
  167. }
  168. if(GetPVarInt(giveplayerid,"MedicCall") == 1)
  169. {
  170. if(PlayerInfo[giveplayerid][pJailTime] > 0 && strfind(PlayerInfo[playerid][pPrisonReason], "[OOC]", true) != -1) return SendClientMessageEx(playerid, COLOR_GRAD2, "You can't use this command on jailed players.");
  171. format(string, sizeof(string), "EMS Driver %s (%s, R%d) has accepted the Emergency Dispatch call for (%d) %s.", GetPlayerNameEx(playerid),
  172. arrGroupData[PlayerInfo[playerid][pMember]][g_szGroupName], PlayerInfo[playerid][pRank], giveplayerid, GetPlayerNameEx(giveplayerid));
  173. SendMedicMessage(TEAM_MED_COLOR, string);
  174. format(string, sizeof(string), "* You have accepted EMS Call from %s, you will see the marker until you have reached it.",GetPlayerNameEx(giveplayerid));
  175. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  176. format(string, sizeof(string), "* EMS Driver %s has accepted your EMS Call; please wait at your current position.",GetPlayerNameEx(playerid));
  177. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  178. GameTextForPlayer(playerid, "~w~EMS Caller~n~~r~Go to the red marker.", 5000, 1);
  179. EMSCallTime[playerid] = 1;
  180. EMSAccepted[playerid] = giveplayerid;
  181. SetPVarInt(giveplayerid, "EMSAttempt", 1);
  182. PlayerInfo[playerid][pCallsAccepted]++;
  183. if(GetPlayerInterior(giveplayerid)) SendClientMessageEx(playerid, COLOR_GRAD1, "This person is currently in an interior.");
  184. }
  185. else
  186. {
  187. SendClientMessageEx(playerid, COLOR_WHITE, "The person has not requested any EMS attention!");
  188. }
  189. }
  190. }
  191. return 1;
  192. }
  193. stock IsAnAmbulance(carid)
  194. {
  195. if(DynVeh[carid] != -1)
  196. {
  197. new iDvSlotID = DynVeh[carid], iGroupID = DynVehicleInfo[iDvSlotID][gv_igID];
  198. if((0 <= iGroupID < MAX_GROUPS))
  199. {
  200. if(arrGroupData[iGroupID][g_iGroupType] == GROUP_TYPE_MEDIC) return 1;
  201. else if(arrGroupData[iGroupID][g_iMedicAccess] != INVALID_DIVISION) return 1;
  202. else if(carid == 416) return 1;
  203. }
  204. }
  205. return 0;
  206. }
  207. /*
  208. CMD:aid(playerid, params[]) {
  209. if(IsAMedic(playerid) || IsFirstAid(playerid)) {
  210. }
  211. else SendClientMessageEx(playerid, COLOR_GRAD2, " You are not a medic!");
  212. return 1;
  213. }
  214. */
  215. CMD:emslist(playerid, params[]) {
  216. if(IsAMedic(playerid) || IsFirstAid(playerid)) {
  217. new szZone[MAX_ZONE_NAME],
  218. x;
  219. szMiscArray[0] = 0;
  220. foreach(new i : Player) {
  221. if(GetPVarType(i, "EMSAttempt")) {
  222. GetPlayer3DZone(i, szZone, sizeof(szZone));
  223. switch(GetPVarInt(i, "EMSAttempt")) {
  224. case 1: {
  225. ListItemTrackId[playerid][x] = i;
  226. x++;
  227. format(szMiscArray, sizeof(szMiscArray), "%s{FF0000}Emergency - %s - %s\n", szMiscArray, GetPlayerNameEx(i), szZone);
  228. }
  229. case 2: {
  230. ListItemTrackId[playerid][x] = i;
  231. x++;
  232. format(szMiscArray, sizeof(szMiscArray), "%s{FFFF00}Treated - %s - %s\n", szMiscArray, GetPlayerNameEx(i), szZone);
  233. }
  234. case 3: {
  235. ListItemTrackId[playerid][x] = i;
  236. x++;
  237. format(szMiscArray, sizeof(szMiscArray), "%s{FF00FF}Rescued - %s - %s\n", szMiscArray, GetPlayerNameEx(i), szZone);
  238. }
  239. }
  240. }
  241. else if(strlen(szMiscArray) <= 1)
  242. {
  243. format(szMiscArray, sizeof(szMiscArray), "There are currently no active EMS calls.");
  244. }
  245. }
  246. ShowPlayerDialogEx(playerid, DIALOG_MEDIC_LIST, DIALOG_STYLE_LIST, "Medic | Dispatch List", szMiscArray, "Enroute", "Cancel");
  247. }
  248. else SendClientMessageEx(playerid, COLOR_GRAD1, "You are not a medic.");
  249. return 1;
  250. }
  251. CMD:loadpt(playerid, params[])
  252. {
  253. if(IsAMedic(playerid) || IsFirstAid(playerid))
  254. {
  255. if(IsPlayerInAnyVehicle(playerid))
  256. {
  257. SendClientMessageEx(playerid, COLOR_GREY, " Cannot use this while you're in a car!");
  258. return 1;
  259. }
  260. new string[128], giveplayerid, seat;
  261. if(sscanf(params, "ud", giveplayerid, seat)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /loadpt [player] [seatid]");
  262. if(IsPlayerConnected(giveplayerid))
  263. {
  264. if(giveplayerid != INVALID_PLAYER_ID)
  265. {
  266. if(!(2 <= seat <= 3))
  267. {
  268. SendClientMessageEx(playerid, COLOR_GRAD1, "The seat ID cannot be above 3 or below 2.");
  269. return 1;
  270. }
  271. if(GetPVarInt(giveplayerid, "Injured") != 1)
  272. {
  273. SendClientMessageEx(playerid, COLOR_GREY, "That patient not injured - you can't load them.");
  274. return 1;
  275. }
  276. if(IsPlayerInAnyVehicle(giveplayerid))
  277. {
  278. SendClientMessageEx(playerid, COLOR_GREY, "That patient is inside a car - you can't load them.");
  279. return 1;
  280. }
  281. if (ProxDetectorS(8.0, playerid, giveplayerid))
  282. {
  283. if(giveplayerid == playerid) { SendClientMessageEx(playerid, COLOR_GREY, "You cannot load yourself!"); return 1; }
  284. if(PlayerInfo[giveplayerid][pJailTime] > 0 && strfind(PlayerInfo[playerid][pPrisonReason], "[OOC]", true) != -1) return SendClientMessageEx(playerid, COLOR_GRAD2, "You can't use this command on jailed players.");
  285. // if(GetPVarType(playerid, "MedicAid")) return SendClientMessage(playerid, COLOR_GREY, "This patient requires aid! Use /aid [playerid] to aid them.");
  286. new carid = gLastCar[playerid];
  287. if(IsAnAmbulance(carid))
  288. {
  289. if(IsVehicleOccupied(carid, seat)) {
  290. SendClientMessageEx(playerid, COLOR_GREY, "That seat is occupied.");
  291. return 1;
  292. }
  293. if(IsPlayerInRangeOfVehicle(giveplayerid, carid, 10.0) && IsPlayerInRangeOfVehicle(playerid, carid, 10.0)) {
  294. format(string, sizeof(string), "* You were loaded by paramedic %s.", GetPlayerNameEx(playerid));
  295. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  296. format(string, sizeof(string), "* You loaded patient %s.", GetPlayerNameEx(giveplayerid));
  297. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  298. format(string, sizeof(string), "* %s loads %s in the %s.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), GetVehicleName(carid));
  299. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  300. SetPVarInt(giveplayerid, "EMSAttempt", 3);
  301. ClearAnimationsEx(giveplayerid);
  302. IsPlayerEntering{giveplayerid} = true;
  303. PutPlayerInVehicle(giveplayerid,carid,seat);
  304. TogglePlayerControllable(giveplayerid, false);
  305. }
  306. else SendClientMessageEx(playerid, COLOR_GREY, "Both you and your patient must be near the ambulance.");
  307. }
  308. else
  309. {
  310. SendClientMessageEx(playerid, COLOR_GRAD2, "Your last car needs to be an ambulance!");
  311. }
  312. }
  313. else
  314. {
  315. SendClientMessageEx(playerid, COLOR_GREY, " You're not close enough to the person or your car!");
  316. return 1;
  317. }
  318. }
  319. }
  320. else
  321. {
  322. SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
  323. return 1;
  324. }
  325. }
  326. else
  327. {
  328. SendClientMessageEx(playerid, COLOR_GRAD2, " You are not a medic!");
  329. }
  330. return 1;
  331. }
  332. CMD:triage(playerid, params[])
  333. {
  334. if(IsAMedic(playerid) || IsFirstAid(playerid))
  335. {
  336. if(PlayerInfo[playerid][pTriageTime] != 0)
  337. {
  338. SendClientMessageEx(playerid, COLOR_GREY, "You must wait for 2 minutes to use this command.");
  339. return 1;
  340. }
  341. new string[128], giveplayerid;
  342. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /triage [player]");
  343. if(IsPlayerConnected(giveplayerid))
  344. {
  345. if(playerid == giveplayerid) return SendClientMessageEx(playerid, COLOR_GRAD2, "You can't use this command on yourself.");
  346. if (ProxDetectorS(5.0, playerid, giveplayerid))
  347. {
  348. new Float: health;
  349. GetHealth(giveplayerid, health);
  350. if(health >= 85) SetHealth(giveplayerid, 100);
  351. else SetHealth(giveplayerid, health+15.0);
  352. format(string, sizeof(string), "* %s has given %s 15 health.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  353. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  354. PlayerInfo[playerid][pTriageTime] = 120;
  355. }
  356. else
  357. {
  358. SendClientMessageEx(playerid, COLOR_GREY, "That person isn't near you.");
  359. }
  360. }
  361. }
  362. return 1;
  363. }
  364. CMD:heal(playerid, params[])
  365. {
  366. new giveplayerid, price = 1000;
  367. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /heal [player]");
  368. if (giveplayerid == playerid)
  369. {
  370. SendClientMessageEx(playerid, COLOR_GRAD1, "You can't heal yourself.");
  371. return 1;
  372. }
  373. if(gettime() < GetPVarInt(playerid, "pHealTimer")) return SendClientMessage(playerid, COLOR_GRAD1, "You must wait 1 minute before you can heal again.");
  374. if (IsPlayerConnected(giveplayerid))
  375. {
  376. if(IsAMedic(playerid) || IsFirstAid(playerid))
  377. {
  378. new Float:X, Float:Y, Float:Z;
  379. GetPlayerPos(giveplayerid, X, Y, Z);
  380. if(!IsPlayerInRangeOfPoint(playerid, 10, X, Y, Z)) return SendClientMessageEx(playerid, TEAM_GREEN_COLOR," You are not near them!");
  381. if(GetPlayerCash(giveplayerid) < 1000) return SendClientMessage(playerid, COLOR_GRAD1, "That player cannot afford this treatment.");
  382. new Float:tempheal;
  383. GetHealth(giveplayerid,tempheal);
  384. if(tempheal >= 100.0)
  385. {
  386. SendClientMessageEx(playerid, TEAM_GREEN_COLOR,"That person is fully healed.");
  387. return 1;
  388. }
  389. new string[64];
  390. format(string, sizeof(string), "You healed %s for $%d.", GetPlayerNameEx(giveplayerid), price);
  391. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  392. GivePlayerCash(playerid, price / 2);
  393. Tax += price / 2;
  394. GivePlayerCash(giveplayerid, -price);
  395. SetHealth(giveplayerid, 100);
  396. PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0);
  397. PlayerPlaySound(giveplayerid, 1150, 0.0, 0.0, 0.0);
  398. format(string, sizeof(string), "You have been healed to 100 health for $%d by %s.",price, GetPlayerNameEx(playerid));
  399. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  400. SetPVarInt(playerid, "pHealTimer", gettime() + 60); // Adding a minute check.
  401. if(GetPVarType(giveplayerid, "STD"))
  402. {
  403. DeletePVar(giveplayerid, "STD");
  404. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, "* You are no longer infected with a STD because of the medic's help.");
  405. }
  406. }
  407. else
  408. {
  409. SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command.");
  410. return 1;
  411. }
  412. }
  413. else
  414. {
  415. SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
  416. }
  417. return 1;
  418. }
  419. CMD:getpt(playerid, params[])
  420. {
  421. Medic_GetPatient(playerid, params);
  422. return 1;
  423. }
  424. CMD:movept(playerid, params[])
  425. {
  426. if(IsAMedic(playerid) || IsFirstAid(playerid))
  427. {
  428. new string[128], giveplayerid;
  429. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /movepatient [player]");
  430. if(IsPlayerConnected(giveplayerid))
  431. {
  432. if(GetPVarInt(giveplayerid,"Injured") == 1)
  433. {
  434. if(IsPlayerInAnyVehicle(playerid)) return SendClientMessageEx(playerid, COLOR_GRAD2, "You can't use this command while in a vehicle.");
  435. if(PlayerInfo[giveplayerid][pJailTime] > 0 && strfind(PlayerInfo[playerid][pPrisonReason], "[OOC]", true) != -1) return SendClientMessageEx(playerid, COLOR_GRAD2, "You can't use this command on jailed players.");
  436. if(GetPVarInt(giveplayerid, "OnStretcher") == 1)
  437. {
  438. SendClientMessageEx(playerid, COLOR_GRAD2, "The person is already on a stretcher, you can't do this right now!");
  439. return 1;
  440. }
  441. new Float:mX, Float:mY, Float:mZ;
  442. GetPlayerPos(giveplayerid, mX, mY, mZ);
  443. if(!IsPlayerInRangeOfPoint(playerid, 5.0, mX, mY, mZ))
  444. {
  445. SendClientMessageEx(playerid, COLOR_GRAD2, "You have to be close to the patient to be able to move them!");
  446. return 1;
  447. }
  448. SendClientMessageEx(playerid, COLOR_GRAD2, "You have 30 seconds to move to another location or you can either press the '{AA3333}FIRE{BFC0C2}' button.");
  449. format(string, sizeof(string), "* You have been put on a stretcher by %s.", GetPlayerNameEx(playerid));
  450. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  451. format(string, sizeof(string), "* You have put %s on a stretcher, you may move them now.", GetPlayerNameEx(giveplayerid));
  452. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  453. format(string, sizeof(string), "* %s puts %s on a stretcher, tightening the belts securely.", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  454. ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  455. SetPVarInt(giveplayerid, "OnStretcher", 1);
  456. SetPVarInt(playerid, "TickEMSMove", SetTimerEx("MoveEMS", 30000, false, "d", playerid));
  457. SetPVarInt(playerid, "MovingStretcher", giveplayerid);
  458. }
  459. else
  460. {
  461. SendClientMessageEx(playerid, COLOR_GRAD2, "The person has to be injured in-order to move them!");
  462. }
  463. }
  464. }
  465. return 1;
  466. }
  467. CMD:deliverpt(playerid, params[])
  468. {
  469. if(IsAMedic(playerid) || IsFirstAid(playerid))
  470. {
  471. if(IsPlayerInAnyVehicle(playerid))
  472. {
  473. new string[128], giveplayerid;
  474. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /deliverpt [player]");
  475. new carid = GetPlayerVehicleID(playerid);
  476. new caridex = GetPlayerVehicleID(giveplayerid);
  477. if(IsAnAmbulance(carid))
  478. {
  479. if(carid == caridex)
  480. {
  481. if(IsAtDeliverPatientPoint(playerid))
  482. {
  483. if(playerid == giveplayerid)
  484. {
  485. SendClientMessageEx(playerid, COLOR_GRAD2, "You cannot deliver yourself to the hospital!");
  486. return 1;
  487. }
  488. if(GetPVarInt(giveplayerid, "Injured") == 0)
  489. {
  490. return SendClientMessageEx(playerid, COLOR_GRAD2, "That person is not injured!");
  491. }
  492. if(playerTabbed[giveplayerid] >= 1)
  493. {
  494. SendClientMessageEx(playerid, COLOR_GRAD2, "That person is paused, you can't currently deliver him!");
  495. return 1;
  496. }
  497. SetHealth(giveplayerid, 100);
  498. if(GetPVarType(giveplayerid, "STD"))
  499. {
  500. DeletePVar(giveplayerid, "STD");
  501. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, "* You are no longer infected with a STD anymore because of the hospital's help!");
  502. }
  503. GivePlayerCash(giveplayerid, -1000);
  504. GivePlayerCash(playerid, 20000);
  505. //SendClientMessageEx(giveplayerid, TEAM_CYAN_COLOR, "Doc: Your medical bill comes in at $1000. Have a nice day!");
  506. format(string,sizeof(string),"You received $20,000 for successfully delivering the patient!");
  507. SendClientMessageEx(playerid, TEAM_CYAN_COLOR, string);
  508. KillEMSQueue(giveplayerid);
  509. SetPVarInt(giveplayerid, "_HospitalBeingDelivered", 1);
  510. new iHospitalDeliver = GetClosestDeliverPatientPoint(playerid);
  511. new iHospital = ReturnDeliveryPoint(iHospitalDeliver);
  512. switch(ReturnDeliveryPointNation(iHospitalDeliver))
  513. {
  514. case 0: Tax += 1000;
  515. case 1: TRTax += 1000;
  516. }
  517. arrGroupData[PlayerInfo[playerid][pMember]][g_iBudget] -= 20000;
  518. DeliverPlayerToHospital(giveplayerid, iHospital);
  519. PlayerInfo[playerid][pPatientsDelivered]++;
  520. format(string, sizeof(string), "EMS Driver %s has successfully delivered Patient %s to the hospital.",GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid));
  521. SendGroupMessage(GROUP_TYPE_MEDIC, TEAM_MED_COLOR, string);
  522. GroupLog(PlayerInfo[playerid][pMember], string);
  523. foreach(new i: Player)
  524. {
  525. if(IsFirstAid(i))
  526. {
  527. SendClientMessage(i, TEAM_MED_COLOR, string);
  528. }
  529. }
  530. PlayerInfo[giveplayerid][pHydration] = 100;
  531. }
  532. else
  533. {
  534. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not near a deliver point - look out near the hospitals.");
  535. }
  536. }
  537. else
  538. {
  539. SendClientMessageEx(playerid, COLOR_GRAD2, "Patient must be in your car in order to deliver him.");
  540. }
  541. }
  542. else
  543. {
  544. SendClientMessageEx(playerid, COLOR_GRAD2, "You are not in an FDSA vehicle.");
  545. }
  546. }
  547. }
  548. return 1;
  549. }
  550. CMD:renderaid(playerid, params[])
  551. {
  552. if(!(0 <= PlayerInfo[playerid][pMember] < MAX_GROUPS)) return SendClientMessageEx(playerid, COLOR_GREY, "You are not in a group.");
  553. if(GetPVarInt(playerid, "MedVestKit") != 1) return SendClientMessageEx(playerid, COLOR_GRAD1, "You aren't carrying a kit.");
  554. new target;
  555. if(sscanf(params, "u", target)) return SendClientMessageEx(playerid, COLOR_GRAD2, "USAGE: /renderaid [player]");
  556. if(!IsPlayerConnected(target)) return SendClientMessageEx(playerid, COLOR_GRAD2, "Invalid player specified.");
  557. if(target == playerid) return SendClientMessageEx(playerid, COLOR_GRAD2, "You can not aid yourself!");
  558. if(!GetPVarType(target, "Injured")) return SendClientMessageEx(playerid, COLOR_GRAD2, "Player is not in a injured state.");
  559. SetPVarInt(target, "renderaid", playerid);
  560. format(szMiscArray, sizeof(szMiscArray), "* You have offered %s assistance.", GetPlayerNameEx(target));
  561. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, szMiscArray);
  562. format(szMiscArray, sizeof(szMiscArray), "* %s wants to assist you, (type /accept renderaid) to accept.", GetPlayerNameEx(playerid));
  563. SendClientMessageEx(target, COLOR_LIGHTBLUE, szMiscArray);
  564. return 1;
  565. }