call.pwn 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
  2. switch( dialogid ) {
  3. case DIALOGID_MAP_NEW: {
  4. if( !response ) {
  5. return 1;
  6. }
  7. if( isempty(inputtext) || strcmp(inputtext, NEWMAP_COMMAND) != 0 ) {
  8. SendClientMessage(playerid, RGBA_RED, "ERROR: You did not enter the correct command into the textfield!");
  9. ShowMapNewDialog(playerid, dialogid);
  10. } else {
  11. new
  12. objects_removed,
  13. vehicles_removed,
  14. pickups_removed,
  15. actors_removed,
  16. buildings_recreated,
  17. attachments_removed
  18. ;
  19. NewMap(
  20. .objects_removed = objects_removed,
  21. .vehicles_removed = vehicles_removed,
  22. .pickups_removed = pickups_removed,
  23. .actors_removed = actors_removed,
  24. .buildings_recreated = buildings_recreated,
  25. .attachments_removed = attachments_removed,
  26. .playerid = playerid
  27. );
  28. format(g_ClientMessage, sizeof g_ClientMessage, "[%i] %s has started a new map.", playerid, ret_GetPlayerName(playerid));
  29. SendClientMessageToAll(RGBA_WHITE, g_ClientMessage);
  30. format(g_ClientMessage, sizeof g_ClientMessage, "Reset: %i Object(s), %i Vehicle(s), %i or more Pickup(s), %i Actor(s), %i Building(s) recreated.", objects_removed, vehicles_removed, pickups_removed, actors_removed, buildings_recreated);
  31. SendClientMessageToAll(RGBA_WHITE, g_ClientMessage);
  32. if( attachments_removed > 0 ) {
  33. format(g_ClientMessage, sizeof g_ClientMessage, "+ %i or more of your attachment(s).", attachments_removed);
  34. SendClientMessage(playerid, RGBA_WHITE, g_ClientMessage);
  35. }
  36. if( buildings_recreated > 0 ) {
  37. SendClientMessageToAll(RGBA_ORANGE, "Please note that you need to reconnect to see recreated buildings.");
  38. }
  39. g_MapLoadedID = INVALID_MAP_ID;
  40. RefreshMapLoadedTextdraw();
  41. }
  42. return 1;
  43. }
  44. }
  45. #if defined mnew_OnDialogResponse
  46. return mnew_OnDialogResponse(playerid, dialogid, response, listitem, inputtext);
  47. #else
  48. return 0;
  49. #endif
  50. }
  51. #if defined _ALS_OnDialogResponse
  52. #undef OnDialogResponse
  53. #else
  54. #define _ALS_OnDialogResponse
  55. #endif
  56. #define OnDialogResponse mnew_OnDialogResponse
  57. #if defined mnew_OnDialogResponse
  58. forward mnew_OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]);
  59. #endif