Advertisement
Guest User

System Event Halloween

a guest
Oct 24th, 2015
1,428
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.78 KB | None | 0 0
  1. /*
  2.                                     | - - - - - - - - - - - - - - - |
  3.                                     | Halloween Event Filterscript  |
  4.                                     | Credits: Edison               |
  5.                                     | @ 2015 FilterScript           |
  6.                                     | - - - - - - - - - - - - - - - |
  7.  
  8. * RO: Un subscribe aici (https://www.youtube.com/channel/UCL1mkOOQe15fvwzfaMzfdcw) m-ar ajuta foarte mult. Multumesc!
  9. * EN: An subscribe here (https://www.youtube.com/channel/UCL1mkOOQe15fvwzfaMzfdcw) it would help a lot. Thank you!
  10.  
  11. */
  12.  
  13. #define FILTERSCRIPT
  14.  
  15. #include <a_samp>
  16.  
  17. #define COLOR_DARKMAUVE 0x623778FF
  18. #define COLOR_MAUVE 0x845F96FF
  19.  
  20. new
  21.     Timer,
  22.     Pumpkin,
  23.     Winner,
  24.     Number,
  25.     Minutes;
  26.  
  27.  
  28. new Float: RandomPositions[][3] = {
  29.     {1767.807861, -1932.837402, 13.595355},
  30.     {2132.916259, -1740.313598, 17.289062},
  31.     {1803.886352, -1590.603881, 14.095897},
  32.     {1485.622680, -1665.684692, 14.610832},
  33.     {1018.429138, -1922.505737, 12.592831},
  34.     {582.102233, -1490.797119, 15.376304},
  35.     {154.038253, -1960.985351, 3.830727},
  36.     {1394.659790, -1897.151977, 13.557967},
  37.     {2360.556640, 547.272399, 2.666161},
  38.     {2561.215332, 1175.414062, 18.718933},
  39.     {1496.425415, 1011.755920, 10.904741},
  40.     {2263.547119, 1398.863281, 42.841758},
  41.     {2035.151489, 1874.851074, 12.095868},
  42.     {2013.250122, 2206.021972, 11.507675},
  43.     {1717.909667, 1623.251953, 10.052927},
  44.     {1374.580932, 2188.983642, 11.056703},
  45.     {-1538.844360, -440.330566, 6.032049},
  46.     {-1971.358764, 213.149246, 27.124874},
  47.     {-2473.870605, 399.725463, 27.800573},
  48.     {-2756.504882, 245.252899, 7.227559},
  49.     {-2541.580810, -311.954620, 27.070434},
  50.     {-2707.994873, 377.999938, 11.979453},
  51.     {-2762.185302, 613.078186, 26.277561},
  52.     {-1318.863891, 494.018798, 18.260137}
  53. };
  54.  
  55. static const LocationsName[][256] = {
  56.     {"El Corona (LS)"},
  57.     {"Idlewood (LS)"},
  58.     {"Little Mexico (LS)"},
  59.     {"Pershing Square (LS)"},
  60.     {"Verona Beach (LS)"},
  61.     {"Rodeo (LS)"},
  62.     {"Santa Maria Beach (LS)"},
  63.     {"Verdant Bluffs (LS)"},
  64.     {"Red County (LV)"},
  65.     {"Come-A-Lot (LV)"},
  66.     {"LVA Freight Depot (LV)"},
  67.     {"Royal Casino (LV)"},
  68.     {"The Visage (LV)"},
  69.     {"The Emerald Isle (LV)"},
  70.     {"Las Venturas Airport (LV)"},
  71.     {"Redsands West (LV)"},
  72.     {"Easter Bay Airport (SF)"},
  73.     {"Cranberry Station (SF)"},
  74.     {"Queens (SF)"},
  75.     {"Ocean Flats (SF)"},
  76.     {"Avispa Country Club (SF)"},
  77.     {"City Hall (SF)"},
  78.     {"Palisades (SF)"},
  79.     {"Easter Basin (SF)"}
  80. };
  81.  
  82. #if defined FILTERSCRIPT
  83. public OnFilterScriptInit()
  84. {
  85.     Timer = SetTimer("HalloweenEvent", 600000, true);
  86.  
  87.     print("\nHalloween Event Filterscript loaded. (100%)");
  88.     print("Credits: Edison #NZTeam\n");
  89.     return 1;
  90. }
  91.  
  92. public OnFilterScriptExit()
  93. {
  94.     KillTimer(Timer);
  95.     return 1;
  96. }
  97.  
  98. #else
  99.  
  100. main()
  101. {
  102. }
  103.  
  104. #endif
  105.  
  106. public OnPlayerCommandText(playerid, cmdtext[])
  107. {
  108.     if(strcmp("/gotopumpkin", cmdtext, true, 10) == 0)
  109.     {
  110.         if(!IsPlayerAdmin(playerid)) return 1;
  111.         if(Winner == 1) return SendClientMessage(playerid, -1, "There is no pumpkin spawn.");
  112.         if(GetPlayerState(playerid) == 2) SetVehiclePos(GetPlayerVehicleID(playerid), RandomPositions[Number][0], RandomPositions[Number][1]+5, RandomPositions[Number][2]);
  113.         else SetPlayerPos(playerid, RandomPositions[Number][0], RandomPositions[Number][1]+5, RandomPositions[Number][2]);
  114.         SendClientMessage(playerid, -1, "You've been teleported near the pumpkin.");
  115.         return 1;
  116.     }
  117.     return 0;
  118. }
  119.  
  120. public OnPlayerPickUpPickup(playerid, pickupid)
  121. {
  122.     if(pickupid == Pumpkin)
  123.     {
  124.         DestroyPickup(Pumpkin);
  125.  
  126.         new
  127.             string[256],
  128.             randmoney = 50000 + random(10000),
  129.             name[MAX_PLAYER_NAME],
  130.             Hour, Minute, Second;
  131.  
  132.         Winner = 1;
  133.         GetPlayerName(playerid, name, sizeof(name));
  134.         format(string, sizeof(string), "> Pumpkin was found by %s. His wish him congratulations!", name);
  135.         SendClientMessageToAll(COLOR_MAUVE, string);
  136.         gettime(Hour, Minute, Second);
  137.         format(string, sizeof(string), "> A new pumpkin will be hidden in %d minutes.", Minutes-Minute+10);
  138.         SendClientMessageToAll(COLOR_MAUVE, string);       
  139.         format(string, sizeof(string), "You won the sum of $%d", randmoney);
  140.         SendClientMessage(playerid, 0x2C8522FF, string);
  141.         GivePlayerMoney(playerid, randmoney);
  142.     }
  143.     return 1;
  144. }
  145.  
  146. forward HalloweenEvent();
  147. public HalloweenEvent()
  148. {
  149.     new
  150.         string[256],
  151.         rand = random(sizeof(RandomPositions));
  152.  
  153.     if(Winner == 0) {
  154.         DestroyPickup(Pumpkin);
  155.         SendClientMessageToAll(-1, "Nobody has found the pumpkin.");
  156.     }
  157.  
  158.     Winner = 0;
  159.     Number = rand;
  160.     Pumpkin = CreatePickup(19320, 21, RandomPositions[rand][0], RandomPositions[rand][1], RandomPositions[rand][2]);
  161.  
  162.     SendClientMessageToAll(COLOR_DARKMAUVE, "[Halloween Event]:");
  163.     format(string, sizeof(string), "> A new pumpkin was hidding in the area: %s.", LocationsName[rand]);
  164.     SendClientMessageToAll(COLOR_MAUVE, string);
  165.     SendClientMessageToAll(COLOR_MAUVE, "> You have 10 minutes to find this pumpkin.");
  166.  
  167.     new Hour, Minute, Second;
  168.     gettime(Hour, Minute, Second);
  169.     Minutes = Minute;
  170.     return 1;
  171. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement