festival.pwn 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. /*
  2. /$$ /$$ /$$$$$$ /$$$$$$$ /$$$$$$$
  3. | $$$ | $$ /$$__ $$ | $$__ $$| $$__ $$
  4. | $$$$| $$| $$ \__/ | $$ \ $$| $$ \ $$
  5. | $$ $$ $$| $$ /$$$$ /$$$$$$| $$$$$$$/| $$$$$$$/
  6. | $$ $$$$| $$|_ $$|______/| $$__ $$| $$____/
  7. | $$\ $$$| $$ \ $$ | $$ \ $$| $$
  8. | $$ \ $$| $$$$$$/ | $$ | $$| $$
  9. |__/ \__/ \______/ |__/ |__/|__/
  10. Fall Festival
  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. #include <YSI\y_hooks>
  34. #define DIALOG_BALLOON (6019)
  35. forward RemoveTicket(playerid);
  36. public RemoveTicket(playerid) if(PlayerInfo[playerid][bTicket]) PlayerInfo[playerid][bTicket]--;
  37. CMD:@@balloon@@(playerid, params[])
  38. {
  39. if(!PlayerInfo[playerid][bTicket])
  40. {
  41. new string[128];
  42. format(string, sizeof(string),"Item: Balloon Ride Ticket\nYour Credits: %s\nCost: {FFD700}5{A9C4E4}\nCredits Left: %s", number_format(PlayerInfo[playerid][pCredits]), number_format(PlayerInfo[playerid][pCredits]-5));
  43. ShowPlayerDialogEx(playerid, DIALOG_BALLOON, DIALOG_STYLE_MSGBOX, "Purchase Balloon Ticket", string, "Purchase", "Cancel");
  44. return 0;
  45. }
  46. return 1;
  47. }
  48. CMD:giveticket(playerid, params[])
  49. {
  50. if(PlayerInfo[playerid][pAdmin] < 1338 && PlayerInfo[playerid][pPR] < 2 && PlayerInfo[playerid][pShopTech] < 3) return SendClientMessageEx(playerid, -1, "You are not authorized to use this command!");
  51. new target, amount;
  52. if(sscanf(params, "ud", target, amount)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /giveticket [player] [amount]");
  53. PlayerInfo[target][bTicket] += amount;
  54. new string[128];
  55. format(string, sizeof(string), "You have given %s %d balloon ride tickets.", GetPlayerNameEx(target), amount);
  56. SendClientMessageEx(playerid, -1, string);
  57. format(string, sizeof(string), "%s has given you %d balloon ride tickets.", GetPlayerNameEx(playerid), amount);
  58. SendClientMessageEx(target, -1, string);
  59. format(string, sizeof(string), "[GIVETICKET] %s gave %s(%d) %d balloon ride tickets.", GetPlayerNameEx(playerid), GetPlayerNameEx(target), GetPlayerSQLId(target), amount);
  60. Log("logs/admin.log", string);
  61. return 1;
  62. }
  63. hook OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
  64. if(arrAntiCheat[playerid][ac_iFlags][AC_DIALOGSPOOFING] > 0) return 1;
  65. if(dialogid == DIALOG_BALLOON)
  66. {
  67. if(!response) return 1;
  68. if(PlayerInfo[playerid][pCredits] < 5) return SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough credits to purchase this item. Visit shop.ng-gaming.net to purchase credits.");
  69. new string[128];
  70. GivePlayerCredits(playerid, -5, 1);
  71. PlayerInfo[playerid][bTicket]++;
  72. format(string, sizeof(string), "[BTICKET] [User: %s(%i)] [IP: %s] [Credits: %s] [Price: 5]", GetPlayerNameEx(playerid), GetPlayerSQLId(playerid), GetPlayerIpEx(playerid), number_format(PlayerInfo[playerid][pCredits]));
  73. Log("logs/credits.log", string), print(string);
  74. SendClientMessageEx(playerid, COLOR_CYAN, "You have purchased a Balloon Ride ticket for 5 credits.");
  75. }
  76. return 0;
  77. }
  78. CMD:corndog(playerid, params[])
  79. {
  80. if(!IsPlayerInRangeOfPoint(playerid, 5.0, 1468.1566,-76.7717,23.2247)) return SendClientMessage(playerid, COLOR_GREY, "You are not at a corn dog stand.");
  81. if(GetPlayerCash(playerid) < 2000) return SendClientMessage(playerid, COLOR_GREY, "You need $2000 to buy a corn dog.");
  82. SendClientMessageEx(playerid, COLOR_GRAD4, "You have purchased a 'Corn Dog' for $2000.");
  83. GivePlayerCash(playerid, -2000);
  84. new Float:health;
  85. GetHealth(playerid, health);
  86. if(health < 100)
  87. {
  88. if(health > 90) SetHealth(playerid, 100);
  89. else SetHealth(playerid, health + 10.0);
  90. }
  91. return 1;
  92. }
  93. CMD:pizza(playerid, params[])
  94. {
  95. if(!IsPlayerInRangeOfPoint(playerid, 5.0, 1477.4579,-70.6260,23.2188)) return SendClientMessage(playerid, COLOR_GREY, "You are not at a pizza stand.");
  96. if(GetPlayerCash(playerid) < 2000) return SendClientMessage(playerid, COLOR_GREY, "You need $2000 to buy a pizza.");
  97. SendClientMessageEx(playerid, COLOR_GRAD4, "You have purchased a 'Pizza' for $2000.");
  98. GivePlayerCash(playerid, -2000);
  99. new Float:health;
  100. GetHealth(playerid, health);
  101. if(health < 100)
  102. {
  103. if(health > 90) SetHealth(playerid, 100);
  104. else SetHealth(playerid, health + 10.0);
  105. }
  106. return 1;
  107. }
  108. CMD:frieddough(playerid, params[])
  109. {
  110. if(!IsPlayerInRangeOfPoint(playerid, 5.0, 1465.0697,-86.3609,23.2247)) return SendClientMessage(playerid, COLOR_GREY, "You are not at a fried dough stand.");
  111. if(GetPlayerCash(playerid) < 2000) return SendClientMessage(playerid, COLOR_GREY, "You need $2000 to buy a fried dough.");
  112. SendClientMessageEx(playerid, COLOR_GRAD4, "You have purchased a 'Fried Dough' for $2000.");
  113. GivePlayerCash(playerid, -2000);
  114. new Float:health;
  115. GetHealth(playerid, health);
  116. if(health < 100)
  117. {
  118. if(health > 90) SetHealth(playerid, 100);
  119. else SetHealth(playerid, health + 10.0);
  120. }
  121. return 1;
  122. }