Advertisement
Guest User

Sursa calls

a guest
Apr 13th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.78 KB | None | 0 0
  1. // Command
  2. CMD:calls(playerid, params[]) {
  3. new fid = PlayerInfo[playerid][pMember];
  4. if(fid == 0) return SCM(playerid, COLOR_LGREEN, "Eroare: Nu faci parte dintr-o factiune!");
  5. if(fid != 14 && fid != 12 && fid != 13 && fid != 8 && fid != 7) return SCM(playerid, COLOR_LGREEN, "Eroare: Aceasta comanda nu este disponibila factiunii tale!");
  6.  
  7. new
  8. szDialog[512], szDialog2[512], x,
  9. szZone[128], Float: Pos[3], Float:distance;
  10.  
  11. strcat(szDialog2, "Player\tLocation\n");
  12.  
  13. switch(fid) {
  14. case 12,14: {
  15. foreach(Player, i) {
  16. if(IsPlayerConnected(i) && TaxiService[i] == 1 && AcceptedTaxiService[i] == 0) {
  17. SelectedPlayers[playerid][x] = i;
  18. distance = GetDistanceBetweenPlayers(playerid,i);
  19. GetPlayerPos(i, Pos[0], Pos[1], Pos[2]);
  20. GetPlayer3DZone2(Pos[0], Pos[1], Pos[2], szZone, sizeof(szZone));
  21. format(szDialog, sizeof(szDialog), "%s (%d)\t%s - %0.1fm\n", GetName(i), i, szZone, distance);
  22. strcat(szDialog2, szDialog);
  23. x++;
  24. }
  25. }
  26. }
  27. case 13: {
  28. foreach(Player, i) {
  29. if(IsPlayerConnected(i) && MedicCall[i] == i) {
  30. SelectedPlayers[playerid][x] = i;
  31. distance = GetDistanceBetweenPlayers(playerid,i);
  32. GetPlayerPos(i, Pos[0], Pos[1], Pos[2]);
  33. GetPlayer3DZone2(Pos[0], Pos[1], Pos[2], szZone, sizeof(szZone));
  34. format(szDialog, sizeof(szDialog), "%s (%d)\t%s - %0.1fm\n", GetName(i), i, szZone, distance);
  35. strcat(szDialog2, szDialog);
  36. x++;
  37. }
  38. }
  39. }
  40. case 8: {
  41. foreach(Player, i) {
  42. if(IsPlayerConnected(i) && MechanicCall[i] == i) {
  43. SelectedPlayers[playerid][x] = i;
  44. distance = GetDistanceBetweenPlayers(playerid,i);
  45. GetPlayerPos(i, Pos[0], Pos[1], Pos[2]);
  46. GetPlayer3DZone2(Pos[0], Pos[1], Pos[2], szZone, sizeof(szZone));
  47. format(szDialog, sizeof(szDialog), "%s (%d)\t%s - %0.1fm\n", GetName(i), i, szZone, distance);
  48. strcat(szDialog2, szDialog);
  49. x++;
  50. }
  51. }
  52. }
  53. case 7: {
  54. foreach(Player, i) {
  55. if(IsPlayerConnected(i) && InstructorCall[i] == 1) {
  56. SelectedPlayers[playerid][x] = i;
  57. distance = GetDistanceBetweenPlayers(playerid,i);
  58. GetPlayerPos(i, Pos[0], Pos[1], Pos[2]);
  59. GetPlayer3DZone2(Pos[0], Pos[1], Pos[2], szZone, sizeof(szZone));
  60. format(szDialog, sizeof(szDialog), "%s (%d)\t%s - %0.1fm\n", GetName(i), i, szZone, distance);
  61. strcat(szDialog2, szDialog);
  62. x++;
  63. }
  64. }
  65. }
  66. }
  67. if(x == 0) return SCM(playerid, COLOR_LGREEN, "Eroare: Nimeni nu a apelat momentan la serviciile factiunii tale!");
  68.  
  69. new title[64];
  70. format(title, sizeof(title), "%s's calls: %d", FactionName(fid), x);
  71. ShowPlayerDialog(playerid, DIALOG_CALLS, DIALOG_STYLE_TABLIST_HEADERS, title, szDialog2, "Select", "Cancel");
  72. return 1;
  73. }
  74.  
  75. // Dialog
  76. case DIALOG_CALLS: {
  77. if(!response) return 1;
  78. new id = SelectedPlayers[playerid][listitem];
  79. if(!IsPlayerConnected(id) || id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, "Acel player nu este conectat!");
  80. switch(PlayerInfo[playerid][pMember]) {
  81. case 12,14: {
  82. if(TaxiService[id] == 1 && AcceptedTaxiService[id] == 0) {
  83. if(PlayerInfo[playerid][pMember] != 12 || PlayerInfo[playerid][pMember] != 14) return 1;
  84. if(TaxiService[id] == 0) return SCM(playerid, COLOR_GREY, "Acel player nu a apelat la acest serviciu!");
  85. if(AcceptedService[playerid] != -1) return SCM(playerid, COLOR_GREY, "Ai acceptat deja o comanda, pentru a renunta la cea curenta, foloseste '/cancel command'.");
  86. if(AcceptedTaxiService[id] == 1) return SCM(playerid, COLOR_GREY, "Comanda acelui player a fost acceptat de catre alt membru al factiunii.");
  87. if(!FactionVehicle(playerid)) return SCM(playerid, COLOR_GREY, "Nu esti intr-un vehicul ce apartine factiunii tale!");
  88. AcceptedTaxiService[id] = 1;
  89. AcceptedService[playerid] = id;
  90. targetfind[playerid] = id;
  91. UsedFind[playerid] = 1;
  92. format(string, sizeof(string), "**(( Taxi Dispatch: Taximetristul %s (%d) i-a acceptat comanda lui %s (%d). ))**", GetName(playerid), playerid, GetName(id), id);
  93. SendFactionMessage(12, 0x2C6CBFFf, string);
  94. format(string, sizeof(string), "**(( Uber Dispatch: Uber %s (%d) i-a acceptat comanda lui %s (%d). ))**", GetName(playerid), playerid, GetName(id), id);
  95. SendFactionMessage(14, 0x2C6CBFFf, string);
  96. format(string, sizeof(string), "* Taximetristul %s ti-a preluat comanda.", GetName(playerid));
  97. SCM(id, COLOR_YELLOW, string);
  98. CP[playerid] = 53;
  99. }
  100. else return SCM(playerid, COLOR_LGREEN, "Eroare: Acel player nu a apelat la serviciile factiunii tale sau comanda lui a fost accepta de altcineva!");
  101. }
  102. case 13: {
  103. if(MedicCall[id] == id) {
  104. if(PlayerInfo[playerid][pMember] != 13) return SendClientMessage(playerid, COLOR_WHITE, "Nu esti medic!");
  105. if(MedicCallTime[playerid] > 0) return SendClientMessage(playerid, COLOR_WHITE, "You have already accepted a medic call.");
  106. if(IsAnAmbulance(GetPlayerVehicleID(playerid))) return SendClientMessage(playerid,COLOR_WHITE, "You're not in ambulance car.");
  107. if(MedicCall[id] != id) return SendClientMessage(playerid,COLOR_WHITE, "This player has not called ambulance.");
  108. format(string, sizeof(string), "**(( Paramedic Dispatch: Paramedic %s (%d) i-a acceptat comanda lui %s (%d). ))**",GetName(playerid), playerid, GetName(id), id);
  109. SendFactionMessage(13, COLOR_LIGHTBLUE, string);
  110. format(string, sizeof(string), "* Medicul %s ti-a acceptat comanda.",sendername);
  111. SendClientMessage(MedicCall[id], COLOR_YELLOW, string);
  112. new Float:X,Float:Y,Float:Z;
  113. GetPlayerPos(MedicCall[id], X, Y, Z);
  114. SetPlayerCheckpointEx(playerid, X, Y, Z, 5);
  115. MedicCallTime[playerid] = 1;
  116. MedicCall[id] = -1;
  117. CP[playerid] = 53;
  118. }
  119. else return SCM(playerid, COLOR_LGREEN, "Eroare: Acel player nu a apelat la serviciile factiunii tale sau comanda lui a fost accepta de altcineva!");
  120. }
  121. case 8: {
  122. if(MechanicCall[id] == id) {
  123. if(CP[playerid] != 0) return ShowPlayerDialog(playerid, DIALOG_CHECKPOINT, DIALOG_STYLE_MSGBOX, "Checkpoint", "Ai deja un checkpoint activ.\nDoresti sa-l anulezi? Daca da, apasa pe 'Ok'.", "Ok", "Exit");
  124. if(PlayerInfo[playerid][pMember] != 8) return SendClientMessage(playerid, COLOR_GREY, "Nu faci parte din factiunea mecanic.");
  125. if(MechanicCallTime[playerid] == 1) return SendClientMessage(playerid, COLOR_WHITE, "Ai acceptat deja un apel!");
  126. if(MechanicCall[id] != id) return SCM(playerid,COLOR_WHITE,"Acel player nu a apelat la acest serviciu!");
  127. format(string, sizeof(string), "**(( TTC Dispatch: Tow Truck Member %s (%d) i-a acceptat comanda lui %s (%d). ))**", GetName(playerid), playerid, GetName(id), id);
  128. SendFactionMessage(8, COLOR_LIGHTBLUE, string);
  129. format(string, sizeof(string), "* Mecanicul %s a acceptat apelul tau.",sendername);
  130. SendClientMessage(MechanicCall[id], COLOR_WHITE, string);
  131. new Float:X,Float:Y,Float:Z;
  132. GetPlayerPos(MechanicCall[id], X, Y, Z);
  133. SetPlayerCheckpointEx(playerid, X, Y, Z, 5);
  134. UsedFind[playerid] = 1;
  135. targetfind[playerid] = id;
  136. MechanicCall[id] = -1;
  137. CP[playerid] = 53;
  138. }
  139. else return SCM(playerid, COLOR_LGREEN, "Eroare: Acel player nu a apelat la serviciile factiunii tale sau comanda lui a fost accepta de altcineva!");
  140. }
  141. case 7: {
  142. if(InstructorCall[id] == 1) {
  143. if(InstructorCall[id] == 0) return SendClientMessage(playerid, COLOR_WHITE, "Acel player nu a apelat la un instructor.");
  144. if(PlayerInfo[playerid][pMember] != 7) return SendClientMessage(playerid, COLOR_GREY, "Nu faci parte din factiunea car mechanic.");
  145. if(CP[playerid] != 0) return ShowPlayerDialog(playerid, DIALOG_CHECKPOINT, DIALOG_STYLE_MSGBOX, "Checkpoint", "Ai deja un checkpoint activ.\nDoresti sa-l anulezi? Daca da, apasa pe 'Ok'.", "Ok", "Exit");
  146. format(string, sizeof(string), "**(( SI Dispatch: Instructor %s (%d) i-a acceptat comanda lui %s (%d). ))**", GetName(playerid), playerid, GetName(id), id);
  147. SendFactionMessage(7, COLOR_LIGHTBLUE, string);
  148. format(string, sizeof(string), "* I-ai acceptat apelul lui %s.",GetName(id));
  149. SendClientMessage(playerid, COLOR_WHITE, string);
  150. format(string, sizeof(string), "* Instructorul %s a acceptat apelul tau.",GetName(playerid));
  151. SendClientMessage(id, COLOR_YELLOW, string);
  152. new Float:X,Float:Y,Float:Z;
  153. GetPlayerPos(InstructorCall[id], X, Y, Z);
  154. SetPlayerCheckpointEx(playerid, X, Y, Z, 5);
  155. UsedFind[playerid] = 1;
  156. targetfind[playerid] = id;
  157. InstructorCall[id] = 0;
  158. CP[playerid] = 53;
  159. }
  160. else return SCM(playerid, COLOR_LGREEN, "Eroare: Acel player nu a apelat la serviciile factiunii tale sau comanda lui a fost accepta de altcineva!");
  161. }
  162. }
  163. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement