Advertisement
LostProphet

Events - Updated

Jul 28th, 2011
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 46.04 KB | None | 0 0
  1. using System;
  2. using GTA;
  3.  
  4. namespace ScriptEvents
  5. {
  6.     public enum Race
  7.     {
  8.         SouthBroker,
  9.         AirportRun,
  10.         DukesBoulevard,
  11.         SouthAlgonquin,
  12.         StarJunction,
  13.         RoadToBohan,
  14.         NorthAlderney,
  15.         Elevated,
  16.         SouthAlderney
  17.     }
  18.  
  19.     public enum VehicleType
  20.     {
  21.         Bike,
  22.         Boat,
  23.         Car,
  24.         Helicopter,
  25.         Plane
  26.     }
  27.  
  28.     //GET_TIME_SINCE
  29.  
  30.     public static class Events
  31.     {
  32.         #region Private fields
  33.  
  34.         private static Player localPlayer = Game.LocalPlayer;
  35.         private static Ped localCharacter = Game.LocalPlayer.Character;
  36.  
  37.         // Variables for tracking Player/Character property values.
  38.         private static int playerMoney, timesArrested, timesDied, wantedLevel, missionsCompleted, missionsFailed, weaponAmmo, daysPassed, vehiclesExported, pigeonsExterminated, timesDrunk, stuntJumpsCompleted, stuntJumpsFound, photosTaken, savesMade, textsReceived, weaponsPickedUp, sentEmails, receivedEmails, firstAidCollected, pedsKilled, vehicleFlips, headshotKills, tiresPopped, bridgesFlownUnder;
  39.         private static float playerHealth, playerVehicleHealth, gameProgress, payAndSprayPaid, clothesBought, foodBought, taxisPaidFor;
  40.         private static bool playerInVehicle, playerClimbing, playerSwimming, playerPressingHorn, playerIsRagdoll, playerShooting, sirenActive;
  41.         private static Vehicle playerLastVehicle;
  42.         private static Weapon playerCurrentWeapon;
  43.         private static Ped playerPedTarget;
  44.         private static GTA.Timer eventsTimer;
  45.  
  46.         private static FloatStatistic[] missionStatistic = { FloatStatistic.ROMAN_MISSION_PROGRESS, FloatStatistic.VLAD_MISSION_PROGRESS, FloatStatistic.JACOB_MISSION_PROGRESS, FloatStatistic.FAUSTIN_MISSION_PROGRESS, FloatStatistic.MANNY_MISSION_PROGRESS, FloatStatistic.ELIZABETA_MISSION_PROGRESS, FloatStatistic.DWAYNE_MISSION_PROGRESS, FloatStatistic.BRUCIE_MISSION_PROGRESS, FloatStatistic.PLAYBOY_MISSION_PROGRESS, FloatStatistic.FRANCIS_MISSION_PROGRESS, FloatStatistic.ULPC_MISSION_PROGRESS, FloatStatistic.PACKIE_MISSION_PROGRESS, FloatStatistic.RAY_MISSION_PROGRESS, FloatStatistic.GERRY_MISSION_PROGRESS, FloatStatistic.DERRICK_MISSION_PROGRESS, FloatStatistic.BERNIE_MISSION_PROGRESS, FloatStatistic.BELL_MISSION_PROGRESS, FloatStatistic.GAMBETTI_MISSION_PROGRESS, FloatStatistic.JIMMY_MISSION_PROGRESS };
  47.         private static float[] missionProgress = new float[missionStatistic.Length];
  48.  
  49.         private static FloatStatistic[] respectStatistic = { FloatStatistic.ROMAN_RESPECT, FloatStatistic.JACOB_RESPECT, FloatStatistic.DWAYNE_RESPECT, FloatStatistic.BRUCIE_RESPECT, FloatStatistic.PACKIE_RESPECT, FloatStatistic.RESPECT_TOTAL /*Where is this displayed or used?*/ };
  50.         private static float[] respectProgress = new float[respectStatistic.Length];
  51.  
  52.         private static FloatStatistic[] likeStatistic = { FloatStatistic.ROMAN_LIKE, FloatStatistic.JACOB_LIKE, FloatStatistic.DWAYNE_LIKE, FloatStatistic.BRUCIE_LIKE, FloatStatistic.PACKIE_LIKE };
  53.         private static float[] likeProgress = new float[likeStatistic.Length];
  54.  
  55.         private static FloatStatistic[] fondnessStatistic = { FloatStatistic.CARMEN_ORTIZ_FONDNESS, FloatStatistic.ALEX_CHILTON_FONDNESS, FloatStatistic.KIKI_JENKINS_FONDNESS, FloatStatistic.MICHELLE_FONDNESS, FloatStatistic.KATE_FONDNESS };
  56.         private static float[] fondnessProgress = new float[fondnessStatistic.Length];
  57.  
  58.         private static FloatStatistic[] trustStatistic = { FloatStatistic.CARMEN_TRUST, FloatStatistic.ALEX_TRUST, FloatStatistic.KIKI_TRUST, FloatStatistic.MICHELLE_TRUST, FloatStatistic.KATE_TRUST };
  59.         private static float[] trustProgress = new float[trustStatistic.Length];
  60.  
  61.         private static FloatStatistic[] recordStatistic = { FloatStatistic.SOUTH_BROKER_RECORD, FloatStatistic.AIRPORT_RUN_RECORD, FloatStatistic.DUKES_BOULEVARD_RECORD, FloatStatistic.SOUTH_ALGONQUIN_RECORD, FloatStatistic.STAR_JUNCTION_RECORD, FloatStatistic.ROAD_TO_BOHAN_RECORD, FloatStatistic.NORTH_ALDERNEY_RECORD, FloatStatistic.ELEVATED_RECORD, FloatStatistic.SOUTH_ALDERNEY_RECORD };
  62.         private static float[] recordProgress = new float[recordStatistic.Length]; // Don't know the format, maybe bugged, need to get to the races to check it I guess.
  63.  
  64.         private static IntegerStatistic[] vehicleStolenStatistic = { IntegerStatistic.CARS_STOLEN, IntegerStatistic.BIKES_STOLEN, IntegerStatistic.BOATS_STOLEN, IntegerStatistic.HELICOPTERS_STOLEN };
  65.         private static int[] vehiclesStolen = new int[vehicleStolenStatistic.Length];
  66.  
  67.         private static IntegerStatistic[] racesWonStatistic = { IntegerStatistic.SOUTH_BROKER_WINS, IntegerStatistic.AIRPORT_RUN_WINS, IntegerStatistic.DUKES_BOULEVARD_WINS, IntegerStatistic.SOUTH_ALGONQUIN_WINS, IntegerStatistic.STAR_JUNCTION_WINS, IntegerStatistic.ROAD_TO_BOHAN_WINS, IntegerStatistic.NORTH_ALDERNEY_WINS, IntegerStatistic.ELEVATED_WINS, IntegerStatistic.SOUTH_ALDERNEY_WINS };
  68.         private static int[] racesWon = new int[racesWonStatistic.Length];
  69.  
  70.         private static IntegerStatistic[] racesFinishedStatistic = { IntegerStatistic.SOUTH_BROKER_RACES, IntegerStatistic.AIRPORT_RUN_RACES, IntegerStatistic.DUKES_BOULEVARD_RACES, IntegerStatistic.SOUTH_ALGONQUIN_RACES, IntegerStatistic.STAR_JUNCTION_RACES, IntegerStatistic.ROAD_TO_BOHAN_RACES, IntegerStatistic.NORTH_ALDERNEY_RACES, IntegerStatistic.ELEVATED_RACES, IntegerStatistic.SOUTH_ALDERNEY_RACES };
  71.         private static int[] racesFinished = new int[racesFinishedStatistic.Length];
  72.  
  73.         private static IntegerStatistic[] explodedStatistic = { IntegerStatistic.BIKES_EXPLODED, IntegerStatistic.BOATS_EXPLODED, IntegerStatistic.CARS_EXPLODED, IntegerStatistic.HELICOPTERS_EXPLODED, IntegerStatistic.PLANES_EXPLODED };
  74.         private static int[] explodedProgress = new int[explodedStatistic.Length];
  75.  
  76.         #endregion
  77.  
  78.         #region Constructor
  79.  
  80.         static Events()
  81.         {
  82.             eventsTimer = new GTA.Timer(30);
  83.             eventsTimer.Tick += new EventHandler(EventsTimer_Tick);
  84.             eventsTimer.Start();
  85.  
  86.             //localPlayer = Game.LocalPlayer;
  87.             //localCharacter = Game.LocalPlayer.Character;
  88.  
  89.             #region Statistics
  90.  
  91.             for (int i = 0; i < missionStatistic.Length; i++)
  92.             {
  93.                 missionProgress[i] = Game.GetFloatStatistic(missionStatistic[i]);
  94.             }
  95.  
  96.             for (int i = 0; i < respectStatistic.Length; i++)
  97.             {
  98.                 respectProgress[i] = Game.GetFloatStatistic(respectStatistic[i]);
  99.             }
  100.  
  101.             for (int i = 0; i < likeStatistic.Length; i++)
  102.             {
  103.                 likeProgress[i] = Game.GetFloatStatistic(likeStatistic[i]);
  104.             }
  105.  
  106.             for (int i = 0; i < fondnessStatistic.Length; i++)
  107.             {
  108.                 fondnessProgress[i] = Game.GetFloatStatistic(fondnessStatistic[i]);
  109.             }
  110.  
  111.             for (int i = 0; i < trustStatistic.Length; i++)
  112.             {
  113.                 trustProgress[i] = Game.GetFloatStatistic(trustStatistic[i]);
  114.             }
  115.  
  116.             for (int i = 0; i < recordStatistic.Length; i++)
  117.             {
  118.                 recordProgress[i] = Game.GetFloatStatistic(recordStatistic[i]);
  119.             }
  120.  
  121.             for (int i = 0; i < vehicleStolenStatistic.Length; i++)
  122.             {
  123.                 vehiclesStolen[i] = Game.GetIntegerStatistic(vehicleStolenStatistic[i]);
  124.             }
  125.  
  126.             for (int i = 0; i < racesWonStatistic.Length; i++)
  127.             {
  128.                 racesWon[i] = Game.GetIntegerStatistic(racesWonStatistic[i]);
  129.             }
  130.  
  131.             for (int i = 0; i < racesFinishedStatistic.Length; i++)
  132.             {
  133.                 racesFinished[i] = Game.GetIntegerStatistic(racesFinishedStatistic[i]);
  134.             }
  135.  
  136.             for (int i = 0; i < explodedStatistic.Length; i++)
  137.             {
  138.                 explodedProgress[i] = Game.GetIntegerStatistic(explodedStatistic[i]);
  139.             }
  140.  
  141.             payAndSprayPaid = Game.GetFloatStatistic(FloatStatistic.SPENT_ON_PAY_N_SPRAY);
  142.             clothesBought = Game.GetFloatStatistic(FloatStatistic.SPENT_BUYING_CLOTHES);
  143.             foodBought = Game.GetFloatStatistic(FloatStatistic.SPENT_ON_FOOD);
  144.             taxisPaidFor = Game.GetFloatStatistic(FloatStatistic.SPENT_ON_TAXIS);
  145.  
  146.             daysPassed = Game.GetIntegerStatistic(IntegerStatistic.DAYS_PASSED);
  147.             vehiclesExported = Game.GetIntegerStatistic(IntegerStatistic.VEHICLES_EXPORTED);
  148.             pigeonsExterminated = Game.GetIntegerStatistic(IntegerStatistic.PIGEONS_EXTERMINATED);
  149.             timesDrunk = Game.GetIntegerStatistic(IntegerStatistic.TIMES_GOT_DRUNK);
  150.             stuntJumpsCompleted = Game.GetIntegerStatistic(IntegerStatistic.STUNT_JUMPS_COMPLETED);
  151.             stuntJumpsFound = Game.GetIntegerStatistic(IntegerStatistic.STUNT_JUMPS_FOUND);
  152.  
  153.             //racesWon = Game.GetIntegerStatistic(IntegerStatistic.NUMBER_OF_RACES_WON);
  154.             //racesLost = Game.GetIntegerStatistic(IntegerStatistic.NUMBER_OF_RACES_LOST);
  155.  
  156.             //PIGEONS_EXTERMINATED = 361,
  157.  
  158.             #endregion
  159.  
  160.             if (localPlayer.isActive)
  161.             {
  162.                 timesArrested = Game.GetIntegerStatistic(IntegerStatistic.TIMES_BUSTED); //STARS_ATTAINED = 278, //STARS_EVADED = 279,
  163.                 timesDied = Game.GetIntegerStatistic(IntegerStatistic.TIMES_DIED);
  164.                 weaponsPickedUp = Game.GetIntegerStatistic(IntegerStatistic.WEAPONS_PICKED_UP);
  165.                 missionsCompleted = Game.GetIntegerStatistic(IntegerStatistic.MISSIONS_PASSED);
  166.                 missionsFailed = Game.GetIntegerStatistic(IntegerStatistic.MISSIONS_FAILED);
  167.                 gameProgress = Game.GetFloatStatistic(FloatStatistic.GAME_PROGRESS);
  168.                 sentEmails = Game.GetIntegerStatistic(IntegerStatistic.EMAILS_SENT);
  169.                 receivedEmails = Game.GetIntegerStatistic(IntegerStatistic.EMAILS_RECEIVED);
  170.                 firstAidCollected = Game.GetIntegerStatistic(IntegerStatistic.FIRST_AID_COLLECTED);
  171.                 pedsKilled = Game.GetIntegerStatistic(IntegerStatistic.PEOPLE_KILLED);
  172.                 vehicleFlips = Game.GetIntegerStatistic(IntegerStatistic.FLIPS_DONE_IN_A_VEHICLE);
  173.                 headshotKills = Game.GetIntegerStatistic(IntegerStatistic.KILLS_BY_HEADSHOTS);
  174.                 tiresPopped = Game.GetIntegerStatistic(IntegerStatistic.TIRES_POPPED_BY_GUNSHOT);
  175.                 bridgesFlownUnder = Game.GetIntegerStatistic(IntegerStatistic.NUMBER_OF_BRIDGES_FLOWN_UNDER);
  176.  
  177.                 wantedLevel = localPlayer.WantedLevel;
  178.                 weaponAmmo = localCharacter.Weapons.Current.Ammo;
  179.                 playerHealth = localCharacter.Health;
  180.                 playerMoney = localPlayer.Money;
  181.                 playerClimbing = GTA.Native.Function.Call<bool>("IS_PED_CLIMBING", localCharacter);
  182.                 playerSwimming = localCharacter.isSwimming;
  183.                 playerCurrentWeapon = localCharacter.Weapons.Current;
  184.                 playerPedTarget = localPlayer.GetTargetedPed();
  185.                 playerPressingHorn = localPlayer.isPressingHorn;
  186.                 playerIsRagdoll = localCharacter.isRagdoll;
  187.                 playerShooting = localCharacter.isShooting;
  188.                 playerInVehicle = localCharacter.isInVehicle();
  189.  
  190.                 if (playerInVehicle)
  191.                 {
  192.                     playerVehicleHealth = localCharacter.CurrentVehicle.Health;
  193.                     playerLastVehicle = localCharacter.CurrentVehicle;
  194.                     sirenActive = localCharacter.CurrentVehicle.SirenActive;
  195.                 }
  196.                 else
  197.                 {
  198.                     playerVehicleHealth = 0f;
  199.                     playerLastVehicle = null;
  200.                     sirenActive = false;
  201.                 }
  202.             }
  203.             else
  204.             {
  205.                 // TODO: Reset events etc.
  206.             }
  207.         }
  208.  
  209.         #endregion
  210.  
  211.         #region Delegates
  212.  
  213.         public delegate void HealthChangedEvent(float newHealth, float oldHealth);
  214.         public delegate void MoneyChangedEvent(int newAmount, int oldAmount);
  215.         public delegate void WeaponChangedEvent(Weapon newWeapon, Weapon oldWeapon);
  216.         public delegate void VehicleChangedEvent(Vehicle vehicle);
  217.         public delegate void WantedLevelChangedEvent(int wantedLevel);
  218.         public delegate void JackedEvent(Vehicle vehicle);
  219.         public delegate void ArrestedEvent(int wantedLevel);
  220.         public delegate void ClimbingEvent(Vector3 position);
  221.         public delegate void WaterEvent(Vector3 position);
  222.         public delegate void MissionEvent();
  223.         public delegate void PedGunTargetEvent(Ped ped, Weapon weapon);
  224.         public delegate void PlayerMeleeEvent();
  225.         public delegate void HornPressEvent(); // Maybe add duration ?
  226.         public delegate void PlayerRagdolEvent(); // Anim changed event ?
  227.         public delegate void PlayerShootEvent(Weapon weapon, int newAmmo, int oldAmmo); // Maybe switch this up to not use ammo or missed hit...?  (integer) //BULLETS_FIRED = 287, //BULLETS_HIT = 288
  228.         public delegate void DeathEvent(Vector3 position);
  229.         public delegate void GameProgessEvent(float newProgress, float oldProgress); // What is: //TOTAL_PROGRESS = 110, ??
  230.         public delegate void MissionProgressEvent(FloatStatistic mission, float newProgress, float oldProgress);
  231.         public delegate void RespectChangedEvent(FloatStatistic respect, float newRespect, float oldRespect);
  232.         public delegate void LikeChangedEvent(FloatStatistic like, float newRespect, float oldRespect);
  233.         public delegate void FondnessChangedEvent(FloatStatistic fondness, float newFondness, float oldFondness);
  234.         public delegate void TrustChangedEvent(FloatStatistic trust, float newTrust, float oldTrust);
  235.         public delegate void RecordChangedEvent(FloatStatistic record, float newRecord, float oldRecord);
  236.         public delegate void PayAndSprayEvent(int spent); // Only fixing vehicle damage (paying money) will fire this event! (//PAY_N_SPRAY_VISITS = 282, what is this?)
  237.         public delegate void BuyClothesEvent(int spent, int total); // ^^
  238.         public delegate void BuyFoodEvent(int spent, int total);
  239.         public delegate void PaidForTaxiEvent(int spent); // Maybe add total?
  240.         public delegate void DayPassedEvent(int days);
  241.         public delegate void VehicleExportedEvent(Model model, int total);
  242.         public delegate void VehicleStolenEvent(Vehicle vehicle, int type);
  243.         public delegate void RaceFinishedEvent(Race race, bool won, int total); //public delegate void RaceFinishedEvent(int race, bool won, int total);
  244.         public delegate void PigeonEvent(int total);
  245.         public delegate void DrunkEvent(Vector3 position);
  246.  
  247.         public delegate void SirenEvent();
  248.         public delegate void StuntJumpEvent(Vector3 position);
  249.         public delegate void PhotoTakenEvent();
  250.         public delegate void SaveEvent();
  251.         public delegate void TextReceivedEvent();
  252.         public delegate void WeaponPickUpEvent();
  253.         public delegate void EmailEvent();
  254.         public delegate void FirstAidCollectedEvent();
  255.         public delegate void VehicleExplodedEvent(VehicleType vehicleType);
  256.         public delegate void PedKilledEvent();
  257.         public delegate void VehicleFlipEvent(Vehicle currentVehicle);
  258.         public delegate void HeadshotKillEvent();
  259.         public delegate void TirePoppedEvent();
  260.         public delegate void FlyUnderBridgeEvent();
  261.  
  262.         public delegate void SpawnEvent(Vector3 position);
  263.  
  264.         //BOWLING_DEFEATS
  265.         //BOWLING_DRAWS
  266.         //BOWLING_HIGH_SCORE
  267.         //BOWLING_PERFECTS
  268.         //BOWLING_SPARES
  269.         //BOWLING_STRIKES
  270.         //BOWLING_WINS
  271.  
  272.         //BURGERS_EATEN
  273.         //CARS_SOLD_TO_STEVIE
  274.         //DARTS_BULLSEYE
  275.         //DARTS_DEFEATS
  276.         //DARTS_WINS
  277.         //ENEMY_GANG_MEMBERS_KILLED
  278.         //GIRLS_DUMPED
  279.         //HOTDOGS_EATEN
  280.         //PROSTITUTE_VISITS
  281.  
  282.         #endregion
  283.  
  284.         #region Events
  285.  
  286.         public static event DrunkEvent OnPlayerGetDrunk = null;
  287.         public static event PigeonEvent OnPlayerExterminatedPigeon = null;
  288.         public static event RaceFinishedEvent OnPlayerCompleteRace = null;
  289.         public static event VehicleStolenEvent OnPlayerStealVehicle = null;
  290.         public static event DayPassedEvent OnDayPassed = null;
  291.         public static event GameProgessEvent OnGameProgressChanged = null;
  292.         public static event MissionProgressEvent OnMissionProgressChanged = null;
  293.         public static event RespectChangedEvent OnPlayerRespectChanged = null;
  294.         public static event LikeChangedEvent OnPlayerLikeChanged = null;
  295.         public static event FondnessChangedEvent OnPlayerFondnessChanged = null;
  296.         public static event TrustChangedEvent OnPlayerTrustChanged = null;
  297.         public static event RecordChangedEvent OnPlayerRaceRecordChanged = null;
  298.         public static event PayAndSprayEvent OnPlayerVehicleRepaired = null;
  299.         public static event BuyClothesEvent OnPlayerBoughtClothes = null;
  300.         public static event BuyFoodEvent OnPlayerBoughtFood = null;
  301.         public static event PaidForTaxiEvent OnPlayerPayTaxiFare = null;
  302.         public static event VehicleExportedEvent OnPlayerExportVehicle = null;
  303.         public static event HealthChangedEvent OnPlayerHealthChanged = null, OnVehicleHealthChanged = null;
  304.         public static event VehicleChangedEvent OnPlayerEnterVehicle = null, OnPlayerExitVehicle = null;
  305.         public static event MoneyChangedEvent OnPlayerMoneyChanged = null;
  306.         public static event WeaponChangedEvent OnPlayerWeaponChanged = null;
  307.         public static event JackedEvent OnPlayerJacked = null;
  308.         public static event ArrestedEvent OnPlayerArrested = null;
  309.         public static event DeathEvent OnPlayerDied = null;
  310.         public static event WantedLevelChangedEvent OnPlayerWantedLevelChanged = null;
  311.         public static event ClimbingEvent OnPlayerStartClimbing = null, OnPlayerStopClimbing = null;
  312.         public static event MissionEvent OnPlayerMissionCompleted = null, OnPlayerMissionFailed = null;
  313.         public static event WaterEvent OnPlayerStartSwimming = null, OnPlayerStopSwimming = null;
  314.         public static event PedGunTargetEvent OnPlayerTargetPedWithGun = null;
  315.         public static event PlayerMeleeEvent OnPlayerMelee = null;
  316.         public static event HornPressEvent OnPlayerPressHorn = null;
  317.         public static event PlayerRagdolEvent OnPlayerStartRagdoll = null, OnPlayerStopRagdoll = null;
  318.         public static event PlayerShootEvent OnPlayerShootWeapon = null;
  319.  
  320.         public static event SirenEvent OnSirenActivate = null, OnSirenDeactivate = null;
  321.         public static event StuntJumpEvent OnStuntJumpCompleted = null, OnStuntJumpFound = null;
  322.         public static event PhotoTakenEvent OnPhotoTaken = null;
  323.         public static event SaveEvent OnSave = null;
  324.         public static event TextReceivedEvent OnTextReceived = null;
  325.         public static event WeaponPickUpEvent OnWeaponPickup = null;
  326.         public static event EmailEvent OnEmailSent = null, OnEmailReceived = null;
  327.         public static event FirstAidCollectedEvent OnFirstAidCollected = null;
  328.         public static event VehicleExplodedEvent OnVehicleExploded = null;
  329.         public static event PedKilledEvent OnPedKilled = null;
  330.         public static event VehicleFlipEvent OnVehicleFlip = null;
  331.         public static event HeadshotKillEvent OnHeadshotKill = null;
  332.         public static event TirePoppedEvent OnTirePopped = null;
  333.         public static event FlyUnderBridgeEvent OnFlyUnderBridge = null;
  334.  
  335.         public static event SpawnEvent OnSpawn = null;
  336.  
  337.         #endregion
  338.  
  339.         #region Private Methods
  340.  
  341.         private static void EventsTimer_Tick(object sender, EventArgs e)
  342.         {
  343.             if (localPlayer.isActive)
  344.             {
  345.                 if (OnPlayerHealthChanged != null)
  346.                 {
  347.                     if (localCharacter.Health != playerHealth)
  348.                     {
  349.                         OnPlayerHealthChanged(localCharacter.Health, playerHealth);
  350.                         playerHealth = localCharacter.Health;
  351.                     }
  352.                 }
  353.  
  354.                 if (OnPlayerJacked != null)
  355.                 {
  356.                     if (GTA.Native.Function.Call<bool>("IS_PED_BEING_JACKED", localCharacter))
  357.                         OnPlayerJacked(playerLastVehicle);
  358.                 }
  359.  
  360.                 if (OnPlayerArrested != null)
  361.                 {
  362.                     if (Game.GetIntegerStatistic(IntegerStatistic.TIMES_BUSTED) > timesArrested)
  363.                     {
  364.                         timesArrested = Game.GetIntegerStatistic(IntegerStatistic.TIMES_BUSTED);
  365.                         OnPlayerArrested(localPlayer.WantedLevel);
  366.                     }
  367.                 }
  368.  
  369.                 if (OnPlayerMissionCompleted != null)
  370.                 {
  371.                     if (Game.GetIntegerStatistic(IntegerStatistic.MISSIONS_PASSED) > missionsCompleted)
  372.                     {
  373.                         missionsCompleted = Game.GetIntegerStatistic(IntegerStatistic.MISSIONS_PASSED);
  374.                         OnPlayerMissionCompleted();
  375.                     }
  376.                 }
  377.  
  378.                 if (OnPlayerMissionFailed != null)
  379.                 {
  380.                     if (Game.GetIntegerStatistic(IntegerStatistic.MISSIONS_FAILED) > missionsFailed)
  381.                     {
  382.                         missionsFailed = Game.GetIntegerStatistic(IntegerStatistic.MISSIONS_FAILED);
  383.                         OnPlayerMissionFailed();
  384.                     }
  385.                 }
  386.  
  387.                 if (OnPlayerMoneyChanged != null)
  388.                 {
  389.                     if (localPlayer.Money != playerMoney)
  390.                     {
  391.                         OnPlayerMoneyChanged(localPlayer.Money, playerMoney);
  392.                         playerMoney = localPlayer.Money;
  393.                     }
  394.                 }
  395.  
  396.                 if (OnPlayerWeaponChanged != null)
  397.                 {
  398.                     if (localCharacter.Weapons.Current != playerCurrentWeapon)
  399.                     {
  400.                         //if (localCharacter.Weapons.Current == Weapon.Misc_Object)
  401.                         //    OnPlayerWeaponChanged(Weapon.Unarmed, playerCurrentWeapon);
  402.                         //else
  403.                         //    OnPlayerWeaponChanged(localCharacter.Weapons.Current, playerCurrentWeapon);
  404.                         Weapon currentWeapon = localCharacter.Weapons.Current;
  405.                         OnPlayerWeaponChanged(((currentWeapon == Weapon.Misc_Object) ? Weapon.Unarmed : currentWeapon), playerCurrentWeapon);
  406.  
  407.                         playerCurrentWeapon = localCharacter.Weapons.Current;
  408.                     }
  409.                 }
  410.  
  411.                 if (OnPlayerEnterVehicle != null)
  412.                 {
  413.                     if (localCharacter.isInVehicle())
  414.                     {
  415.                         if (!playerInVehicle)
  416.                         {
  417.                             OnPlayerEnterVehicle(localCharacter.CurrentVehicle);
  418.                             playerInVehicle = true;
  419.                             playerVehicleHealth = localCharacter.CurrentVehicle.Health;
  420.                             playerLastVehicle = localCharacter.CurrentVehicle;
  421.                         }
  422.                     }
  423.                 }
  424.  
  425.                 if (OnPlayerExitVehicle != null)
  426.                 {
  427.                     if (!localCharacter.isInVehicle())
  428.                     {
  429.                         if (playerInVehicle)
  430.                         {
  431.                             OnPlayerExitVehicle(playerLastVehicle);
  432.                             playerInVehicle = false;
  433.                         }
  434.                     }
  435.                 }
  436.  
  437.                 if (OnVehicleHealthChanged != null)
  438.                 {
  439.                     if (localCharacter.isInVehicle())
  440.                     {
  441.                         if (playerVehicleHealth != localCharacter.CurrentVehicle.Health)
  442.                         {
  443.                             OnVehicleHealthChanged(localCharacter.CurrentVehicle.Health, playerVehicleHealth);
  444.                             playerVehicleHealth = localCharacter.CurrentVehicle.Health;
  445.                         }
  446.                     }
  447.                     else
  448.                         playerVehicleHealth = 0f;
  449.                 }
  450.  
  451.                 // Maybe use health event for ..? (newHealth < 0)
  452.                 // Spawned event?
  453.  
  454.                 if (OnPlayerDied != null)
  455.                 {
  456.                     if (Game.GetIntegerStatistic(IntegerStatistic.TIMES_DIED) != timesDied)
  457.                     {
  458.                         OnPlayerDied(localCharacter.Position);
  459.                         timesDied = Game.GetIntegerStatistic(IntegerStatistic.TIMES_DIED);
  460.                     }
  461.                 }
  462.  
  463.                 if (OnPlayerStartClimbing != null)
  464.                 {
  465.                     if (GTA.Native.Function.Call<bool>("IS_PED_CLIMBING", localCharacter))
  466.                     {
  467.                         if (!playerClimbing)
  468.                         {
  469.                             OnPlayerStartClimbing(localCharacter.Position);
  470.                             playerClimbing = true;
  471.                         }
  472.                     }
  473.                 }
  474.  
  475.                 if (OnPlayerStopClimbing != null)
  476.                 {
  477.                     if (!GTA.Native.Function.Call<bool>("IS_PED_CLIMBING", localCharacter))
  478.                     {
  479.                         if (playerClimbing)
  480.                         {
  481.                             playerClimbing = false;
  482.                             OnPlayerStopClimbing(localCharacter.Position);
  483.                         }
  484.                     }
  485.                 }
  486.  
  487.                 if (OnPlayerStartSwimming != null)
  488.                 {
  489.                     if (localCharacter.isSwimming)
  490.                     {
  491.                         if (!playerSwimming)
  492.                         {
  493.                             OnPlayerStartSwimming(localCharacter.Position);
  494.                             playerSwimming = true;
  495.                         }
  496.                     }
  497.                 }
  498.  
  499.                 if (OnPlayerStopSwimming != null)
  500.                 {
  501.                     if (!localCharacter.isSwimming)
  502.                     {
  503.                         if (playerSwimming)
  504.                         {
  505.                             playerSwimming = false;
  506.                             OnPlayerStopSwimming(localCharacter.Position);
  507.                         }
  508.                     }
  509.                 }
  510.  
  511.                 if (OnPlayerWantedLevelChanged != null)
  512.                 {
  513.                     if (localPlayer.WantedLevel != wantedLevel)
  514.                     {
  515.                         wantedLevel = localPlayer.WantedLevel;
  516.                         OnPlayerWantedLevelChanged(wantedLevel);
  517.                     }
  518.                 }
  519.  
  520.                 if (OnPlayerTargetPedWithGun != null)
  521.                 {
  522.                     Ped victim = localPlayer.GetTargetedPed();
  523.  
  524.                     if (Game.Exists(victim))
  525.                     {
  526.                         if (victim != playerPedTarget)
  527.                         {
  528.                             playerPedTarget = victim;
  529.                             OnPlayerTargetPedWithGun(victim, localCharacter.Weapons.Current);
  530.                         }
  531.                     }
  532.                     else
  533.                         playerPedTarget = null;
  534.                 }
  535.  
  536.                 if (OnPlayerMelee != null)
  537.                 {
  538.                     if (localCharacter.isInMeleeCombat)
  539.                         OnPlayerMelee();
  540.                 }
  541.  
  542.                 if (OnPlayerPressHorn != null) // Add start stop or duration ...?
  543.                 {
  544.                     if (localPlayer.isPressingHorn)
  545.                     {
  546.                         if (!playerPressingHorn)
  547.                             OnPlayerPressHorn();
  548.  
  549.                         playerPressingHorn = true;
  550.                     }
  551.                     else
  552.                         playerPressingHorn = false;
  553.                 }
  554.  
  555.                 if (OnPlayerStartRagdoll != null) // Seemes to work, needs more testing for situations like falling etc.
  556.                 {
  557.                     if (localCharacter.isRagdoll)
  558.                     {
  559.                         if (!playerIsRagdoll)
  560.                             OnPlayerStartRagdoll();
  561.  
  562.                         playerIsRagdoll = true;
  563.                     }
  564.                 }
  565.  
  566.                 if (OnPlayerStopRagdoll != null)
  567.                 {
  568.                     if (!localCharacter.isRagdoll)
  569.                     {
  570.                         if (playerIsRagdoll)
  571.                         {
  572.                             OnPlayerStopRagdoll();
  573.                             playerIsRagdoll = false;
  574.                         }
  575.                     }
  576.                 }
  577.  
  578.                 if (OnPlayerShootWeapon != null) // Misses shots because of timer "interval", shots are damn quick, need to rethink this!
  579.                 {
  580.                     if (localCharacter.isShooting)
  581.                     {
  582.                         if (!playerShooting)
  583.                         {
  584.                             OnPlayerShootWeapon(localCharacter.Weapons.Current, localCharacter.Weapons.Current.Ammo, (weaponAmmo = localCharacter.Weapons.Current.Ammo));
  585.                             playerShooting = true;
  586.                         }
  587.                     }
  588.                     else
  589.                         playerShooting = false;
  590.                 }
  591.  
  592.                 if (OnGameProgressChanged != null) // Need to think about saves here...?
  593.                 {
  594.                     if (Game.GetFloatStatistic(FloatStatistic.GAME_PROGRESS) > gameProgress)
  595.                     {
  596.                         OnGameProgressChanged(Game.GetFloatStatistic(FloatStatistic.GAME_PROGRESS), gameProgress);
  597.                         gameProgress = Game.GetFloatStatistic(FloatStatistic.GAME_PROGRESS);
  598.                     }
  599.                 }
  600.  
  601.                 if (OnMissionProgressChanged != null)
  602.                 {
  603.                     for (int i = 0; i < missionStatistic.Length; i++) //for (int i = 0; i < 19; i++)
  604.                     {
  605.                         if (Game.GetFloatStatistic(missionStatistic[i]) > missionProgress[i])
  606.                         {
  607.                             OnMissionProgressChanged(missionStatistic[i], Game.GetFloatStatistic(missionStatistic[i]), missionProgress[i]);
  608.                             missionProgress[i] = Game.GetFloatStatistic(missionStatistic[i]);
  609.                         }
  610.                     }
  611.                 }
  612.  
  613.                 if (OnPlayerRespectChanged != null)
  614.                 {
  615.                     for (int i = 0; i < respectStatistic.Length; i++) //for (int i = 0; i < 6; i++) // No break here, we want all that have changed to be fired not just the one we find first.
  616.                     {
  617.                         if (Game.GetFloatStatistic(respectStatistic[i]) > respectProgress[i])
  618.                         {
  619.                             OnPlayerRespectChanged(respectStatistic[i], Game.GetFloatStatistic(respectStatistic[i]), respectProgress[i]);
  620.                             respectProgress[i] = Game.GetFloatStatistic(respectStatistic[i]);
  621.                         }
  622.                     }
  623.                 }
  624.  
  625.                 if (OnPlayerLikeChanged != null)
  626.                 {
  627.                     for (int i = 0; i < likeStatistic.Length; i++) //for (int i = 0; i < 5; i++)
  628.                     {
  629.                         if (Game.GetFloatStatistic(likeStatistic[i]) > likeProgress[i])
  630.                         {
  631.                             OnPlayerLikeChanged(likeStatistic[i], Game.GetFloatStatistic(likeStatistic[i]), likeProgress[i]);
  632.                             likeProgress[i] = Game.GetFloatStatistic(likeStatistic[i]);
  633.                         }
  634.                     }
  635.                 }
  636.  
  637.                 if (OnPlayerFondnessChanged != null)
  638.                 {
  639.                     for (int i = 0; i < fondnessStatistic.Length; i++) //for (int i = 0; i < 5; i++)
  640.                     {
  641.                         if (Game.GetFloatStatistic(fondnessStatistic[i]) > fondnessProgress[i])
  642.                         {
  643.                             OnPlayerFondnessChanged(fondnessStatistic[i], Game.GetFloatStatistic(fondnessStatistic[i]), fondnessProgress[i]);
  644.                             fondnessProgress[i] = Game.GetFloatStatistic(fondnessStatistic[i]);
  645.                         }
  646.                     }
  647.                 }
  648.  
  649.                 if (OnPlayerTrustChanged != null)
  650.                 {
  651.                     for (int i = 0; i < trustStatistic.Length; i++) //for (int i = 0; i < 5; i++)
  652.                     {
  653.                         if (Game.GetFloatStatistic(trustStatistic[i]) > trustProgress[i])
  654.                         {
  655.                             OnPlayerTrustChanged(trustStatistic[i], Game.GetFloatStatistic(trustStatistic[i]), trustProgress[i]);
  656.                             trustProgress[i] = Game.GetFloatStatistic(trustStatistic[i]);
  657.                         }
  658.                     }
  659.                 }
  660.  
  661.                 if (OnPlayerRaceRecordChanged != null)
  662.                 {
  663.                     for (int i = 0; i < recordStatistic.Length; i++) //for (int i = 0; i < 9; i++)
  664.                     {
  665.                         if (Game.GetFloatStatistic(recordStatistic[i]) > recordProgress[i])
  666.                         {
  667.                             OnPlayerRaceRecordChanged(recordStatistic[i], Game.GetFloatStatistic(recordStatistic[i]), recordProgress[i]);
  668.                             recordProgress[i] = Game.GetFloatStatistic(recordStatistic[i]);
  669.                         }
  670.                     }
  671.                 }
  672.  
  673.                 if (OnPlayerVehicleRepaired != null)
  674.                 {
  675.                     if (Game.GetFloatStatistic(FloatStatistic.SPENT_ON_PAY_N_SPRAY) > payAndSprayPaid)
  676.                     {
  677.                         OnPlayerVehicleRepaired((int)Game.GetFloatStatistic(FloatStatistic.SPENT_ON_PAY_N_SPRAY));
  678.                         payAndSprayPaid = Game.GetFloatStatistic(FloatStatistic.SPENT_ON_PAY_N_SPRAY);
  679.                     }
  680.                 }
  681.  
  682.                 if (OnPlayerBoughtClothes != null)
  683.                 {
  684.                     if (Game.GetFloatStatistic(FloatStatistic.SPENT_BUYING_CLOTHES) > clothesBought)
  685.                     {
  686.                         OnPlayerBoughtClothes((int)(Game.GetFloatStatistic(FloatStatistic.SPENT_BUYING_CLOTHES) - clothesBought), (int)Game.GetFloatStatistic(FloatStatistic.SPENT_BUYING_CLOTHES));
  687.                         clothesBought = Game.GetFloatStatistic(FloatStatistic.SPENT_BUYING_CLOTHES);
  688.                     }
  689.                 }
  690.  
  691.                 if (OnPlayerBoughtFood != null)
  692.                 {
  693.                     if (Game.GetFloatStatistic(FloatStatistic.SPENT_ON_FOOD) > foodBought)
  694.                     {
  695.                         OnPlayerBoughtFood((int)(Game.GetFloatStatistic(FloatStatistic.SPENT_ON_FOOD) - foodBought), (int)Game.GetFloatStatistic(FloatStatistic.SPENT_ON_FOOD));
  696.                         foodBought = Game.GetFloatStatistic(FloatStatistic.SPENT_ON_FOOD);
  697.                     }
  698.                 }
  699.  
  700.                 if (OnPlayerPayTaxiFare != null)
  701.                 {
  702.                     if (Game.GetFloatStatistic(FloatStatistic.SPENT_ON_TAXIS) > taxisPaidFor)
  703.                     {
  704.                         OnPlayerPayTaxiFare((int)(Game.GetFloatStatistic(FloatStatistic.SPENT_ON_TAXIS) - taxisPaidFor));
  705.                         taxisPaidFor = Game.GetFloatStatistic(FloatStatistic.SPENT_ON_TAXIS);
  706.                     }
  707.                 }
  708.  
  709.                 if (OnDayPassed != null)
  710.                 {
  711.                     if (Game.GetIntegerStatistic(IntegerStatistic.DAYS_PASSED) > daysPassed)
  712.                     {
  713.                         OnDayPassed(Game.GetIntegerStatistic(IntegerStatistic.DAYS_PASSED));
  714.                         daysPassed = Game.GetIntegerStatistic(IntegerStatistic.DAYS_PASSED);
  715.                     }
  716.                 }
  717.  
  718.                 if (OnPlayerExportVehicle != null)
  719.                 {
  720.                     if (Game.GetIntegerStatistic(IntegerStatistic.VEHICLES_EXPORTED) > vehiclesExported)
  721.                     {
  722.                         if (Game.Exists(playerLastVehicle))
  723.                             OnPlayerExportVehicle(playerLastVehicle.Model.ToString(), Game.GetIntegerStatistic(IntegerStatistic.VEHICLES_EXPORTED));
  724.                         else
  725.                             OnPlayerExportVehicle(" Unavailable ", Game.GetIntegerStatistic(IntegerStatistic.VEHICLES_EXPORTED));
  726.  
  727.                         vehiclesExported = Game.GetIntegerStatistic(IntegerStatistic.VEHICLES_EXPORTED);
  728.                     }
  729.                 }
  730.  
  731.                 if (OnPlayerStealVehicle != null)
  732.                 {
  733.                     for (int i = 0; i < vehicleStolenStatistic.Length; i++)
  734.                     {
  735.                         if (Game.GetIntegerStatistic(vehicleStolenStatistic[i]) > vehiclesStolen[i])
  736.                         {
  737.                             // Game.Exists() maybe needed and a != null check in the script ...?
  738.                             OnPlayerStealVehicle(localCharacter.CurrentVehicle, i);
  739.                             vehiclesStolen[i] = Game.GetIntegerStatistic(vehicleStolenStatistic[i]);
  740.                         }
  741.                     }
  742.                 }
  743.  
  744.                 if (OnPlayerCompleteRace != null)
  745.                 {
  746.                     for (int i = 0; i < racesFinishedStatistic.Length; i++)
  747.                     {
  748.                         if (Game.GetIntegerStatistic(racesFinishedStatistic[i]) != racesFinished[i])
  749.                         {
  750.                             //if (Game.GetIntegerStatistic(racesWonStatistic[i]) != racesWon[i])
  751.                             //    OnPlayerCompleteRace((Race)i, true, Game.GetIntegerStatistic(racesFinishedStatistic[i]));
  752.                             //else
  753.                             //    OnPlayerCompleteRace((Race)i, false, Game.GetIntegerStatistic(racesFinishedStatistic[i]));
  754.  
  755.                             OnPlayerCompleteRace((Race)i, (Game.GetIntegerStatistic(racesWonStatistic[i]) > racesWon[i]), Game.GetIntegerStatistic(racesFinishedStatistic[i]));
  756.  
  757.                             racesFinished[i] = Game.GetIntegerStatistic(racesFinishedStatistic[i]);
  758.                             racesWon[i] = Game.GetIntegerStatistic(racesWonStatistic[i]);
  759.                         }
  760.                     }
  761.                 }
  762.  
  763.                 if (OnPlayerExterminatedPigeon != null)
  764.                 {
  765.                     if (Game.GetIntegerStatistic(IntegerStatistic.PIGEONS_EXTERMINATED) != pigeonsExterminated)
  766.                     {
  767.                         OnPlayerExterminatedPigeon(Game.GetIntegerStatistic(IntegerStatistic.PIGEONS_EXTERMINATED));
  768.                         pigeonsExterminated = Game.GetIntegerStatistic(IntegerStatistic.PIGEONS_EXTERMINATED);
  769.                     }
  770.                 }
  771.  
  772.                 if (OnPlayerGetDrunk != null)
  773.                 {
  774.                     if (Game.GetIntegerStatistic(IntegerStatistic.TIMES_GOT_DRUNK) != timesDrunk)
  775.                     {
  776.                         OnPlayerGetDrunk(localCharacter.Position); // params...?
  777.                         timesDrunk = Game.GetIntegerStatistic(IntegerStatistic.TIMES_GOT_DRUNK);
  778.                     }
  779.                 }
  780.  
  781.                 if (OnSirenActivate != null)
  782.                 {
  783.                     if (localCharacter.isInVehicle())
  784.                     {
  785.                         if (localCharacter.CurrentVehicle.SirenActive)
  786.                         {
  787.                             if (!sirenActive)
  788.                                 OnSirenActivate();
  789.  
  790.                             sirenActive = true;
  791.                         }
  792.                     }
  793.                 }
  794.  
  795.                 if (OnSirenDeactivate != null)
  796.                 {
  797.                     if (localCharacter.isInVehicle())
  798.                     {
  799.                         if (!localCharacter.CurrentVehicle.SirenActive)
  800.                         {
  801.                             if (sirenActive)
  802.                             {
  803.                                 OnSirenDeactivate();
  804.                                 sirenActive = false;
  805.                             }
  806.                         }
  807.                     }
  808.                 }
  809.  
  810.                 if (OnStuntJumpCompleted != null)
  811.                 {
  812.                     if (Game.GetIntegerStatistic(IntegerStatistic.STUNT_JUMPS_COMPLETED) > stuntJumpsCompleted)
  813.                     {
  814.                         OnStuntJumpCompleted(localCharacter.Position);
  815.                         stuntJumpsCompleted = Game.GetIntegerStatistic(IntegerStatistic.STUNT_JUMPS_COMPLETED);
  816.                     }
  817.                 }
  818.  
  819.                 if (OnStuntJumpFound != null)
  820.                 {
  821.                     if (Game.GetIntegerStatistic(IntegerStatistic.STUNT_JUMPS_FOUND) > stuntJumpsFound)
  822.                     {
  823.                         OnStuntJumpFound(localCharacter.Position);
  824.                         stuntJumpsFound = Game.GetIntegerStatistic(IntegerStatistic.STUNT_JUMPS_FOUND);
  825.                     }
  826.                 }
  827.  
  828.                 if (OnPhotoTaken != null)
  829.                 {
  830.                     if (Game.GetIntegerStatistic(IntegerStatistic.PHOTOS_TAKEN) > photosTaken)
  831.                     {
  832.                         OnPhotoTaken();
  833.                         photosTaken = Game.GetIntegerStatistic(IntegerStatistic.PHOTOS_TAKEN);
  834.                     }
  835.                 }
  836.  
  837.                 if (OnSave != null)
  838.                 {
  839.                     if (Game.GetIntegerStatistic(IntegerStatistic.SAVES_MADE) > savesMade)
  840.                     {
  841.                         OnSave();
  842.                         savesMade = Game.GetIntegerStatistic(IntegerStatistic.SAVES_MADE);
  843.                     }
  844.                 }
  845.  
  846.                 if (OnTextReceived != null)
  847.                 {
  848.                     if (Game.GetIntegerStatistic(IntegerStatistic.TEXTS_RECEIVED) > textsReceived)
  849.                     {
  850.                         OnTextReceived();
  851.                         textsReceived = Game.GetIntegerStatistic(IntegerStatistic.TEXTS_RECEIVED);
  852.                     }
  853.                 }
  854.  
  855.                 if (OnWeaponPickup != null)
  856.                 {
  857.                     if (Game.GetIntegerStatistic(IntegerStatistic.WEAPONS_PICKED_UP) > weaponsPickedUp)
  858.                     {
  859.                         OnWeaponPickup();
  860.                         weaponsPickedUp = Game.GetIntegerStatistic(IntegerStatistic.WEAPONS_PICKED_UP);
  861.                     }
  862.                 }
  863.  
  864.                 if (OnEmailSent != null)
  865.                 {
  866.                     if (Game.GetIntegerStatistic(IntegerStatistic.EMAILS_SENT) > sentEmails)
  867.                     {
  868.                         OnEmailSent();
  869.                         sentEmails = Game.GetIntegerStatistic(IntegerStatistic.EMAILS_SENT);
  870.                     }
  871.                 }
  872.  
  873.                 if (OnEmailReceived != null)
  874.                 {
  875.                     if (Game.GetIntegerStatistic(IntegerStatistic.EMAILS_RECEIVED) > receivedEmails)
  876.                     {
  877.                         OnEmailReceived();
  878.                         receivedEmails = Game.GetIntegerStatistic(IntegerStatistic.EMAILS_RECEIVED);
  879.                     }
  880.                 }
  881.  
  882.                 if (OnFirstAidCollected != null)
  883.                 {
  884.                     if (Game.GetIntegerStatistic(IntegerStatistic.FIRST_AID_COLLECTED) > firstAidCollected)
  885.                     {
  886.                         OnFirstAidCollected();
  887.                         firstAidCollected = Game.GetIntegerStatistic(IntegerStatistic.FIRST_AID_COLLECTED);
  888.                     }
  889.                 }
  890.  
  891.                 if (OnVehicleExploded != null)
  892.                 {
  893.                     for (int i = 0; i < explodedStatistic.Length; i++)
  894.                     {
  895.                         if (Game.GetIntegerStatistic(explodedStatistic[i]) > explodedProgress[i])
  896.                         {
  897.                             OnVehicleExploded((VehicleType)explodedStatistic[i]);
  898.                             explodedProgress[i] = Game.GetIntegerStatistic(explodedStatistic[i]);
  899.                         }
  900.                     }
  901.                 }
  902.  
  903.                 if (OnPedKilled != null)
  904.                 {
  905.                     if (Game.GetIntegerStatistic(IntegerStatistic.PEOPLE_KILLED) > pedsKilled)
  906.                     {
  907.                         OnPedKilled();
  908.                         pedsKilled = Game.GetIntegerStatistic(IntegerStatistic.PEOPLE_KILLED);
  909.                     }
  910.                 }
  911.  
  912.                 if (OnVehicleFlip != null)
  913.                 {
  914.                     if (Game.GetIntegerStatistic(IntegerStatistic.FLIPS_DONE_IN_A_VEHICLE) > vehicleFlips)
  915.                     {
  916.                         OnVehicleFlip(localCharacter.CurrentVehicle);
  917.                         vehicleFlips = Game.GetIntegerStatistic(IntegerStatistic.FLIPS_DONE_IN_A_VEHICLE);
  918.                     }
  919.                 }
  920.  
  921.                 if (OnHeadshotKill != null)
  922.                 {
  923.                     if (Game.GetIntegerStatistic(IntegerStatistic.KILLS_BY_HEADSHOTS) > headshotKills)
  924.                     {
  925.                         OnHeadshotKill();
  926.                         headshotKills = Game.GetIntegerStatistic(IntegerStatistic.KILLS_BY_HEADSHOTS);
  927.                     }
  928.                 }
  929.  
  930.                 if (OnTirePopped != null)
  931.                 {
  932.                     if (Game.GetIntegerStatistic(IntegerStatistic.TIRES_POPPED_BY_GUNSHOT) > tiresPopped)
  933.                     {
  934.                         OnTirePopped();
  935.                         tiresPopped = Game.GetIntegerStatistic(IntegerStatistic.TIRES_POPPED_BY_GUNSHOT);
  936.                     }
  937.                 }
  938.  
  939.                 if (OnFlyUnderBridge != null)
  940.                 {
  941.                     if (Game.GetIntegerStatistic(IntegerStatistic.NUMBER_OF_BRIDGES_FLOWN_UNDER) > bridgesFlownUnder)
  942.                     {
  943.                         OnFlyUnderBridge();
  944.                         bridgesFlownUnder = Game.GetIntegerStatistic(IntegerStatistic.NUMBER_OF_BRIDGES_FLOWN_UNDER);
  945.                     }
  946.                 }
  947.             }
  948.         }
  949.  
  950.         #endregion
  951.     }
  952. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement