bartender.pwn 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. /$$ /$$ /$$$$$$ /$$$$$$$ /$$$$$$$
  3. | $$$ | $$ /$$__ $$ | $$__ $$| $$__ $$
  4. | $$$$| $$| $$ \__/ | $$ \ $$| $$ \ $$
  5. | $$ $$ $$| $$ /$$$$ /$$$$$$| $$$$$$$/| $$$$$$$/
  6. | $$ $$$$| $$|_ $$|______/| $$__ $$| $$____/
  7. | $$\ $$$| $$ \ $$ | $$ \ $$| $$
  8. | $$ \ $$| $$$$$$/ | $$ | $$| $$
  9. |__/ \__/ \______/ |__/ |__/|__/
  10. Bartender System
  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. CMD:selldrink(playerid, params[])
  34. {
  35. if(PlayerInfo[playerid][pJob] == 19 || PlayerInfo[playerid][pJob2] == 19 || PlayerInfo[playerid][pJob3] == 19)
  36. {
  37. if(IsAtBar(playerid))
  38. {
  39. new string[128], giveplayerid;
  40. if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /selldrink [player]");
  41. if(IsPlayerConnected(giveplayerid))
  42. {
  43. if(playerid == giveplayerid)
  44. {
  45. return SendClientMessageEx(playerid, COLOR_GREY, " You can't sell drinks to yourself.");
  46. }
  47. if (ProxDetectorS(8.0, playerid, giveplayerid))
  48. {
  49. DrinkOffer[giveplayerid] = playerid;
  50. format(string, sizeof(string), "* Bartender %s has offered has offered to pour you a drink. /accept drink to select a drink.", GetPlayerNameEx(playerid));
  51. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
  52. format(string, sizeof(string), "* You have offered %s a drink.",GetPlayerNameEx(giveplayerid));
  53. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
  54. }
  55. else
  56. {
  57. return SendClientMessageEx(playerid, COLOR_GREY, " That person is not near you!");
  58. }
  59. }
  60. else
  61. {
  62. return SendClientMessageEx(playerid, COLOR_GREY, " That person is not connected!");
  63. }
  64. }
  65. else
  66. {
  67. SendClientMessageEx(playerid, COLOR_GREY, " You are not at a Bar!");
  68. return 1;
  69. }
  70. }
  71. else
  72. {
  73. SendClientMessageEx(playerid, COLOR_GREY, " You are not a bartender!");
  74. return 1;
  75. }
  76. return 1;
  77. }