valentine.pwn 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*
  2. /$$ /$$ /$$$$$$ /$$$$$$$ /$$$$$$$
  3. | $$$ | $$ /$$__ $$ | $$__ $$| $$__ $$
  4. | $$$$| $$| $$ \__/ | $$ \ $$| $$ \ $$
  5. | $$ $$ $$| $$ /$$$$ /$$$$$$| $$$$$$$/| $$$$$$$/
  6. | $$ $$$$| $$|_ $$|______/| $$__ $$| $$____/
  7. | $$\ $$$| $$ \ $$ | $$ \ $$| $$
  8. | $$ \ $$| $$$$$$/ | $$ | $$| $$
  9. |__/ \__/ \______/ |__/ |__/|__/
  10. Valentines Events
  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:valgifts(playerid, params[])
  34. {
  35. if(PlayerInfo[playerid][pAdmin] >= 1337 || PlayerInfo[playerid][pPR] == 2)
  36. {
  37. if(ValGifts == 0)
  38. {
  39. ValGifts = 1;
  40. format(szMiscArray, sizeof(szMiscArray), "AdmCmd: %s has enabled the /bemine command.", GetPlayerNameEx(playerid));
  41. ABroadCast(COLOR_LIGHTRED, szMiscArray, 1337);
  42. }
  43. else
  44. {
  45. ValGifts = 0;
  46. format(szMiscArray, sizeof(szMiscArray), "AdmCmd: %s has disabled the /bemine command.", GetPlayerNameEx(playerid));
  47. ABroadCast(COLOR_LIGHTRED, szMiscArray, 1337);
  48. }
  49. }
  50. return 1;
  51. }
  52. CMD:bemine(playerid, params[])
  53. {
  54. if(ValGifts == 0)
  55. {
  56. SendClientMessageEx(playerid, COLOR_GRAD2, "This command has been disabled!");
  57. return 1;
  58. }
  59. new giveplayerid, style;
  60. if(sscanf(params, "ud", giveplayerid, style)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /bemine [player] [kissing style (1-6)]");
  61. if(!IsPlayerConnected(giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "That player is not connected");
  62. if(playerid == giveplayerid) return SendClientMessageEx(playerid, COLOR_GREY, "It cannot be yourself. </3");
  63. if(!(0 < style < 7)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /bemine [player] [kissing style (1-6)]");
  64. new Float:ppFloats[3];
  65. GetPlayerPos(giveplayerid, ppFloats[0], ppFloats[1], ppFloats[2]);
  66. if(!IsPlayerInRangeOfPoint(playerid, 2, ppFloats[0], ppFloats[1], ppFloats[2]) || Spectating[giveplayerid] > 0)
  67. {
  68. SendClientMessageEx(playerid, COLOR_GREY, "You're too far away! (get real close!)");
  69. return 1;
  70. }
  71. if(PlayerInfo[playerid][pGiftTime] > 0)
  72. {
  73. format(szMiscArray, sizeof(szMiscArray),"Item: Reset Gift Timer\nYour Credits: %s\nCost: {FFD700}%s{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]), number_format(ShopItems[17][sItemPrice]), number_format(PlayerInfo[playerid][pCredits]-ShopItems[17][sItemPrice]));
  74. ShowPlayerDialogEx(playerid, DIALOG_SHOPGIFTRESET, DIALOG_STYLE_MSGBOX, "Reset Gift Timer", szMiscArray, "Purchase", "Exit" );
  75. SendClientMessageEx(playerid, COLOR_GRAD2, "You have already received a gift in the last 5 hours!");
  76. return 1;
  77. }
  78. else if(PlayerInfo[giveplayerid][pGiftTime] > 0)
  79. {
  80. SendClientMessageEx(playerid, COLOR_GRAD2, "That player has already received a gift in the last 5 hours!");
  81. return 1;
  82. }
  83. SetPVarInt(playerid, "kissvalstyle", style);
  84. SetPVarInt(giveplayerid, "kissvaloffer", playerid);
  85. SetPVarInt(giveplayerid, "kissvalsqlid", GetPlayerSQLId(playerid));
  86. format(szMiscArray, sizeof(szMiscArray), "You have requested %s to be your valentine, please wait for them to respond.", GetPlayerNameEx(giveplayerid));
  87. SendClientMessageEx(playerid, COLOR_LIGHTBLUE, szMiscArray);
  88. format(szMiscArray, sizeof(szMiscArray), "%s has requested to be your valentine, please use '/accept valentine' to approve it.", GetPlayerNameEx(playerid));
  89. SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, szMiscArray);
  90. return 1;
  91. }