Connorlolz

H System.

May 6th, 2012
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.64 KB | None | 0 0
  1. CMD:ems(playerid, params[])
  2. {
  3. new
  4. emsmsg[128],
  5. caller[MAX_PLAYER_NAME];
  6. SendClientMessage(playerid, COLOR_YELLOW, "You have called for the EMS, wait for somebody to come!");
  7. playerVariables[playerid][pPendingEMS] = 1;
  8. foreach(Player, i)
  9. {
  10. if(playerVariables[i][pGroup] == 2)
  11. {
  12. GetPlayerName(playerid, caller, sizeof caller);
  13. format(emsmsg, sizeof(emsmsg), "[Emergency]"EMBED_OOC" %s has called for the EMS! || /acceptems [playerid]", caller);
  14. SendClientMessage(i, COLOR_LIGHTRED, emsmsg);
  15. }
  16. }
  17. return 1;
  18. }
  19.  
  20. CMD:heal(playerid, params[])
  21. {
  22. new
  23. healid,
  24. msg[128],
  25. medic[MAX_PLAYER_NAME],
  26. healname[MAX_PLAYER_NAME];
  27.  
  28. if(playerVariables[playerid][pGroup] != 2) return SendClientMessage(playerid, COLOR_GREY, "You're not a medic!");
  29.  
  30. if(sscanf(params, "u", healid)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /heal [playerid]");
  31.  
  32. else if(playerVariables[playerid][pGroup] == 2)
  33. {
  34. SetPlayerHealth(healid, 100);
  35. GetPlayerName(healid, healname, sizeof healname);
  36. GetPlayerName(playerid, medic, sizeof medic);
  37. format(msg, sizeof(msg), "Paramedic %s has healed you!", medic);
  38. SendClientMessage(healid, COLOR_WHITE, msg);
  39. format(msg, sizeof(msg), "You have healed %s!", healname);
  40. SendClientMessage(playerid, COLOR_WHITE, msg);
  41. }
  42. return 1;
  43. }
  44.  
  45. CMD:cancelems(playerid, params[])
  46. {
  47. SendClientMessage(playerid, COLOR_LIGHTRED, "You have cancelled your call!");
  48. playerVariables[playerid][pEMSAssigned] = 0;
  49. playerVariables[playerid][pPendingEMS] = 0;
  50. return 1;
  51. }
  52.  
  53. CMD:acceptems(playerid, params[])
  54. {
  55. new
  56. msg[128],
  57. emsid,
  58. medic[MAX_PLAYER_NAME],
  59. caller[MAX_PLAYER_NAME],
  60. Float: x,
  61. Float: y,
  62. Float: z;
  63.  
  64. if(playerVariables[playerid][pGroup] != 2) return SendClientMessage(playerid, COLOR_GREY, "You're not a paramedic!");
  65. else if(playerVariables[playerid][pGroup] == 2)
  66. {
  67. if(playerVariables[playerid][pEMSAssigned] == 1) return SendClientMessage(playerid, COLOR_GREY, "You're already on an EMS call!");
  68. else if(playerVariables[playerid][pEMSAssigned] == 0)
  69. {
  70. if(sscanf(params, "u", emsid)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /acceptems [playerid]");
  71.  
  72. else if(playerVariables[emsid][pPendingEMS] == 0) return SendClientMessage(playerid, COLOR_GREY, "That player isn't waiting for a medic!");
  73.  
  74. else if(playerVariables[emsid][pPendingEMS] == 1)
  75. {
  76. GetPlayerName(playerid, medic, sizeof medic);
  77. format(msg, sizeof(msg), "Paramedic %s has accepted your EMS call and is en-route to your location!", medic);
  78. SendClientMessage(emsid, COLOR_YELLOW, msg);
  79. GetPlayerName(emsid, caller, sizeof caller);
  80. format(msg, sizeof(msg), "You have accepted %s's call, a checkpoint has been placed on your map!", caller);
  81. SendClientMessage(playerid, COLOR_YELLOW, msg);
  82. playerVariables[playerid][pEMSAssigned] = 1;
  83. GetPlayerPos(emsid, x, y, z);
  84. SetPlayerCheckpoint(playerid, x, y, z, 15);
  85. playerVariables[playerid][pCheckpoint] = 7;
  86. }
  87. }
  88. }
  89. return 1;
  90. }
Advertisement
Add Comment
Please, Sign In to add comment