Facebook
From Filip, 5 Years ago, written in C++.
Embed
Download Paste or View Raw
Hits: 212
  1. new newspapers;
  2. new Float: newspapers_points[31][3] =
  3. {
  4.         {2014.7136,-1732.7236,14.2344},
  5.         {2015.9874,-1716.9380,14.0839},
  6.         {2017.2753,-1703.2111,14.2258},
  7.         {1980.9740,-1718.8757,17.0302},
  8.         {1981.3322,-1682.8601,17.0538},
  9.         {1969.9506,-1672.1547,15.9688},
  10.         {1909.8523,-1598.9189,14.2255},
  11.         {1847.8092,-1593.4821,19.1245},
  12.         {1519.5431,-1452.6843,14.2031},
  13.         {841.0347,-1625.9824,13.5469},
  14.         {795.0853,-1691.5490,14.4633},
  15.         {793.9753,-1707.6475,14.0382},
  16.         {791.6869,-1754.0050,13.4413},
  17.         {769.1723,-1745.9268,13.0773},
  18.         {653.5956,-1714.0565,14.7648},
  19.         {652.2646,-1694.1212,14.5662},
  20.         {657.2245,-1652.5627,15.4063},
  21.         {655.9882,-1636.4438,15.8617},
  22.         {652.1078,-1619.4863,15.0000},
  23.         {660.6778,-1598.7194,15.0000},
  24.         {2459.5933,-1690.6385,13.5430},
  25.         {2495.3279,-1690.4741,14.7656},
  26.         {2513.8337,-1691.1770,14.0460},
  27.         {2522.8901,-1679.1809,15.4970},
  28.         {2523.8403,-1658.2599,15.4935},
  29.         {2513.5386,-1650.1882,14.3557},
  30.         {2498.3503,-1643.6361,13.7826},
  31.         {2486.3269,-1645.8777,14.0772},
  32.         {2469.4768,-1646.9200,13.5182},
  33.         {2451.8394,-1642.5201,13.7357}
  34. };
  35.  
  36.  
  37. public OnGameModeInit()
  38. {
  39.         newspapers = CreatePickup(1210, 15, 0.0,0.0,3.4);
  40. }
  41.  
  42. public OnPlayerPickUpPickup(playerid, pickupid)
  43. {
  44.         if(pickupid == newspapers)
  45.         {
  46.                 if( playerStats[playerid][player_job] == TYPE_NEWSBOY)
  47.                 {  
  48.                         if(playerStats[playerid][player_job_cash] >= 150) return SendClientMessage(playerid, -1, "Zarobiłeś już wystarczająco na dziś.");
  49.                         if(playerStats[playerid][player_newspapers] != 0) return 1;
  50.                         cmd_me(playerid, "podnosi 20 gazet wrzucając je do torby.");
  51.                         playerStats[playerid][player_newspapers] = 20;
  52.                         ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0, 1);
  53.                         //mini tutorial trzeba dodać
  54.                        
  55.                         DisablePlayerCheckpoint(playerid);
  56.                    
  57.  
  58.                    
  59.                         new rand;
  60.                         rand = random(sizeof(newspapers_points));
  61.                         SetPlayerCheckpoint(playerid, newspapers_points[rand][0], newspapers_points[rand][1], newspapers_points[rand][2], 1.5);
  62.                    
  63.                         return 1;
  64.                 }
  65.         }
  66.         return 1;
  67. }
  68.  
  69. public OnPlayerEnterCheckpoint(playerid)
  70. {
  71.         if( playerStats[playerid][player_job] == TYPE_NEWSBOY)
  72.         {
  73.                                 if(playerStats[playerid][player_job_cash] >= 150) return SendClientMessage(playerid, -1, "Zarobiłeś już wystarczająco na dziś.");
  74.                 if(playerStats[playerid][player_newspapers] == 1)
  75.                                 {
  76.                                         new cash = 5 + random(10);
  77.                                         playerStats[playerid][player_newspapers] -= 1;
  78.                                         playerStats[playerid][player_job_cash] += cash;
  79.  
  80.                                         SendClientMessage(playerid, -1, sprintf("Odłożyłeś ostatnią gazetę. Zarobiłeś $%d. Udaj się do urzędu pracy o następne.\nLimit: $%d/$150.", cash, playerStats[playerid][player_job_cash]));
  81.                                         return 0;
  82.                                 }
  83.                                 if(playerStats[playerid][player_job_cash] >= 150) return SendClientMessage(playerid, -1, "Zarobiłeś już wystarczająco na dziś.");
  84.                 new cash = 5 + random(10);
  85.                 playerStats[playerid][player_newspapers] -= 1;
  86.                 playerStats[playerid][player_job] += cash;
  87.                                 SendClientMessage(playerid, -1, sprintf("Odłożyłeś gazetę. Zarobiłeś $%d. Udaj się do urzędu pracy o następne.\nLimit: $%d/$150.", cash, playerStats[playerid][player_job_cash]));
  88.                 cmd_ame(playerid, "odkłada gazetę.");
  89.                 ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0, 1);
  90.                 DisablePlayerCheckpoint(playerid);
  91.  
  92.                 new rand;
  93.                 rand = random(sizeof(newspapers_points));
  94.                 SetPlayerCheckpoint(playerid, newspapers_points[rand][0], newspapers_points[rand][1], newspapers_points[rand][2], 1.5);
  95.         }
  96.         return 1;
  97. }