Advertisement
Rei_Ayanami

Evento

Nov 12th, 2020
657
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.14 KB | None | 0 0
  1. #if defined Event Footer
  2. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  3. :: Evento Pickup By Rei Ayanami ::
  4. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  5. #endif
  6. #include < a_samp >
  7. #include < zcmd >
  8.  
  9. #define LBLUE 0x00BBF6AA
  10. #define RED 0xFF0000AA
  11.  
  12. #define Star_D 1000
  13.  
  14. enum ServerData
  15. {
  16. //--------------------------------------------------------------------------
  17. EstrelaE, rodaE, OvoE
  18. //--------------------------------------------------------------------------
  19. }
  20.  
  21. new Estrela, Roda, Ovo, ServerInfo[ServerData];
  22.  
  23. public OnFilterScriptInit() return printf("\n*** PickUp Event - by Rei Ayanami - Carregado(a) ***\n");
  24. public OnFilterScriptExit() return printf("\n*** PickUp Event - by Rei Ayanami - Descarregado(a)***\n");
  25.  
  26. CMD:iniciarev(playerid, params[])
  27. {
  28. if(IsPlayerAdmin(playerid)) return
  29. ShowPlayerDialog(playerid, Star_D, DIALOG_STYLE_LIST, "{00FF00}PickUp {00BBF6}Evento", "{00FF00}PickUp: {00BBF6}Estrela\n{00FF00}PickUp: {00BBF6}Roda\n{00FF00}PickUp: {00BBF6}Ovo", "Selecione", "Cancelar");
  30. //--------------------------------------------------------------------------
  31. SendClientMessage(playerid, RED, "ERRO: Você deve ser um Administrador RCON para usar este comando!");
  32. //--------------------------------------------------------------------------
  33. return 1;
  34. }
  35. CMD:finalev(playerid, params[])
  36. {
  37. if(ServerInfo[EstrelaE] == 1)
  38. {
  39. DestroyPickup(Estrela);
  40. SendClientMessage(playerid, LBLUE, "{00FF00}Evento interrompido!");
  41. return 1;
  42. }
  43. else if(ServerInfo[rodaE] == 1)
  44. {
  45. DestroyPickup(Roda);
  46. SendClientMessage(playerid, LBLUE, "{00FF00}Evento interrompido!");
  47. return 1;
  48. }
  49. else if(ServerInfo[OvoE] == 1)
  50. {
  51. DestroyPickup(Ovo);
  52. SendClientMessage(playerid, LBLUE, "{00FF00}Evento interrompido!");
  53. return 1;
  54. }
  55. else return SendClientMessage(playerid, RED, "ERRO: Não há nenhum evento iniciado!");
  56. }
  57.  
  58. public OnPlayerPickUpPickup(playerid, pickupid)
  59. {
  60. new sStr[200];
  61. //--------------------------------------------------------------------------
  62. if(pickupid == Estrela)
  63. {
  64. DestroyPickup(Estrela);
  65. //----------------------------------------------------------------------
  66. format(sStr, sizeof(sStr), "{07f70b}Vencedor do evento {ffffff}[%s] {07f70b}encontrou a pickup Estrela escondida", ReturnName(playerid));
  67. SendClientMessageToAll(RED, sStr);
  68. GivePlayerMoney(playerid, 100000);
  69. ServerInfo[EstrelaE] = 0;
  70. }
  71. //--------------------------------------------------------------------------
  72. if(pickupid == Roda)
  73. {
  74. DestroyPickup(Roda);
  75. //----------------------------------------------------------------------
  76. format(sStr, sizeof(sStr), "{07f70b}Vencedor do evento {ffffff}[%s] {07f70b}encontrou a pickup Roda escondida", ReturnName(playerid));
  77. SendClientMessageToAll(RED, sStr);
  78. GivePlayerMoney(playerid, 100000);
  79. ServerInfo[rodaE] = 0;
  80. }
  81. //--------------------------------------------------------------------------
  82. if(pickupid == Ovo)
  83. {
  84. DestroyPickup(Ovo);
  85. //----------------------------------------------------------------------
  86. format(sStr, sizeof(sStr), "{07f70b}Vencedor do evento {ffffff}[%s] {07f70b}encontrou a pickup Ovo escondida", ReturnName(playerid));
  87. SendClientMessageToAll(RED, sStr);
  88. GivePlayerMoney(playerid, 100000);
  89. ServerInfo[OvoE] = 0;
  90. }
  91. }
  92. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  93. {
  94. new Float:x, Float:y, Float:z;
  95. GetPlayerPos(playerid, x, y, z);
  96. //--------------------------------------------------------------------------
  97. switch(dialogid)
  98. {
  99. case Star_D:
  100. {
  101. if(response)
  102. {
  103. switch(listitem)
  104. {
  105. case 0:
  106. {
  107. if(ServerInfo[EstrelaE] == 1 || ServerInfo[rodaE] == 1 || ServerInfo[OvoE] == 1) return
  108. SendClientMessage(playerid, RED, "ERRO: Já existe um evento iniciado!");
  109. //------------------------------------------------------
  110. Estrela = CreatePickup(1247, 23, x+2, y, z);
  111. SendClientMessage(playerid, LBLUE, "••• {00FF00}O evento Pickup foi {00BBF6}Colocado{00FF00}! {00BBF6}•••");
  112. ServerInfo[EstrelaE] = 1;
  113. }
  114. //----------------------------------------------------------
  115. case 1:
  116. {
  117. if(ServerInfo[EstrelaE] == 1 || ServerInfo[rodaE] == 1 || ServerInfo[OvoE] == 1) return
  118. SendClientMessage(playerid, RED, "ERRO: Já existe um evento iniciado!");
  119. //------------------------------------------------------
  120. Roda = CreatePickup(1073, 23, x+2, y, z);
  121. SendClientMessage(playerid, LBLUE, "••• {00FF00}O evento Pickup foi {00FF00}Colocado! {00BBF6}•••");
  122. ServerInfo[rodaE] = 1;
  123. }
  124. //----------------------------------------------------------
  125. case 2:
  126. {
  127. if(ServerInfo[EstrelaE] == 1 || ServerInfo[rodaE] == 1 || ServerInfo[OvoE] == 1) return
  128. SendClientMessage(playerid, RED, "ERRO: Já existe um evento iniciado!");
  129. //------------------------------------------------------
  130. Ovo = CreatePickup(19341, 23, x+2, y, z);
  131. SendClientMessage(playerid, LBLUE, "••• {00FF00}O evento Pickup foi {00BBF6}Colocado{00FF00}! {00BBF6}•••");
  132. ServerInfo[OvoE] = 1;
  133. }
  134. }
  135. }
  136. }
  137. }
  138. return 1;
  139. }
  140.  
  141. stock ReturnName(playerid)
  142. {
  143. new pName[MAX_PLAYER_NAME];
  144. GetPlayerName(playerid, pName, sizeof(pName));
  145. return pName;
  146. }
  147. #if defined Event Footer
  148. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  149. :: Evento Pickup By Rei Ayanami ::
  150. ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  151. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement