Advertisement
Guest User

Untitled

a guest
Apr 27th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 10.35 KB | None | 0 0
  1.         public static bool ActionService(cPlayerInfo player, cOrganisationInfo orga)
  2.         {
  3.             if (player.OrganisationList.Contains(orga))
  4.             {
  5.                 player.OnDutyOrgaType3 = !player.OnDutyOrgaType3;
  6.                 if (player.OnDutyOrgaType3)
  7.                 {
  8.                     var random = new Random();
  9.                     Vector3 position = sPosition.Mineur2.Position + new Vector3(random.Next(-45, 45), random.Next(-45, 45), -75);
  10.                     //TextLabel label = mGlobal.API.createTextLabel("~g~ Appuyez sur latouche  ~r~ /E ~w~ afin de commencer à miner.", position, 10f, 0.5f, false, mWorld.WorldDimension);
  11.                     PlayerListVectorMineur.Add(player, new MineurCheckpoint(null, position));
  12.                     mGlobal.API.triggerClientEvent(player.Handle, "job_create_pickup2", "Mineur", position - new Vector3(0, 0, 1.5f), 2.5f);
  13.  
  14.                     mGlobal.API.sendNotificationToPlayer(player.Handle, "Vous venez correctement de vous mettre en ~y~service !~w~");
  15.                     if (player.Sexe)
  16.                     {
  17.  
  18.                         if ((PedHash)player.Skin == PedHash.FreemodeFemale01)
  19.                         {
  20.                             mGlobal.API.setPlayerSkin(player.Handle, (PedHash)player.Skin);
  21.                             Task.Run(async () =>
  22.                             {
  23.                                 mGlobal.API.setPlayerDefaultClothes(player.Handle);
  24.                                 await dClothing.LoadPlayerBlendData(player);
  25.                                 await dClothing.LoadPlayerComponent(player);
  26.  
  27.                                 switch (new Random().Next(1, 3)) // Random pour varier les vêtements - Draneus
  28.                                 {
  29.                                     case 1:
  30.                                         mGlobal.API.setPlayerClothes(player.Handle, 0, 0, 0);
  31.                                         mGlobal.API.setPlayerClothes(player.Handle, 1, 0, 0);
  32.                                         mGlobal.API.setPlayerClothes(player.Handle, 3, 0, 0);
  33.                                         mGlobal.API.setPlayerClothes(player.Handle, 4, 27, 8);
  34.                                         mGlobal.API.setPlayerClothes(player.Handle, 5, 0, 0);
  35.                                         mGlobal.API.setPlayerClothes(player.Handle, 6, 27, 0);
  36.                                         mGlobal.API.setPlayerClothes(player.Handle, 7, 0, 0);
  37.                                         mGlobal.API.setPlayerClothes(player.Handle, 8, 59, 0);
  38.                                         mGlobal.API.setPlayerClothes(player.Handle, 9, 0, 0);
  39.                                         mGlobal.API.setPlayerClothes(player.Handle, 10, 0, 0);
  40.                                         mGlobal.API.setPlayerClothes(player.Handle, 11, 16, 0);
  41.                                         break;
  42.  
  43.                                     case 2:
  44.                                         mGlobal.API.setPlayerClothes(player.Handle, 0, 0, 0);
  45.                                         mGlobal.API.setPlayerClothes(player.Handle, 1, 0, 0);
  46.                                         mGlobal.API.setPlayerClothes(player.Handle, 3, 0, 0);
  47.                                         mGlobal.API.setPlayerClothes(player.Handle, 4, 27, 3);
  48.                                         mGlobal.API.setPlayerClothes(player.Handle, 5, 0, 0);
  49.                                         mGlobal.API.setPlayerClothes(player.Handle, 6, 27, 0);
  50.                                         mGlobal.API.setPlayerClothes(player.Handle, 7, 0, 0);
  51.                                         mGlobal.API.setPlayerClothes(player.Handle, 8, 59, 0);
  52.                                         mGlobal.API.setPlayerClothes(player.Handle, 9, 0, 0);
  53.                                         mGlobal.API.setPlayerClothes(player.Handle, 10, 0, 0);
  54.                                         mGlobal.API.setPlayerClothes(player.Handle, 11, 1, 0);
  55.                                         break;
  56.  
  57.                                     case 3:
  58.                                         mGlobal.API.setPlayerClothes(player.Handle, 0, 0, 0);
  59.                                         mGlobal.API.setPlayerClothes(player.Handle, 1, 0, 0);
  60.                                         mGlobal.API.setPlayerClothes(player.Handle, 3, 0, 0);
  61.                                         mGlobal.API.setPlayerClothes(player.Handle, 4, 27, 2);
  62.                                         mGlobal.API.setPlayerClothes(player.Handle, 5, 0, 0);
  63.                                         mGlobal.API.setPlayerClothes(player.Handle, 6, 27, 0);
  64.                                         mGlobal.API.setPlayerClothes(player.Handle, 7, 0, 0);
  65.                                         mGlobal.API.setPlayerClothes(player.Handle, 8, 59, 0);
  66.                                         mGlobal.API.setPlayerClothes(player.Handle, 9, 0, 0);
  67.                                         mGlobal.API.setPlayerClothes(player.Handle, 10, 0, 0);
  68.                                         mGlobal.API.setPlayerClothes(player.Handle, 11, 1, 0);
  69.                                         break;
  70.                                 }
  71.                             });
  72.                         }
  73.                         else
  74.                         {
  75.                             mGlobal.API.setPlayerSkin(player.Handle, PedHash.Cop01SFY);
  76.                         }
  77.                     }
  78.                     else if (!player.Sexe)
  79.                     {
  80.  
  81.                         if ((PedHash)player.Skin == PedHash.FreemodeMale01)
  82.                         {
  83.                             mGlobal.API.setPlayerSkin(player.Handle, (PedHash)player.Skin);
  84.                             Task.Run(async () =>
  85.                             {
  86.                                 mGlobal.API.setPlayerDefaultClothes(player.Handle);
  87.                                 await dClothing.LoadPlayerBlendData(player);
  88.                                 await dClothing.LoadPlayerComponent(player);
  89.  
  90.                                 switch (new Random().Next(1, 3)) // Random pour varier les vêtements - Draneus
  91.                                 {
  92.                                     case 1:
  93.                                         mGlobal.API.setPlayerClothes(player.Handle, 0, 0, 0);
  94.                                         mGlobal.API.setPlayerClothes(player.Handle, 1, 0, 0);
  95.                                         mGlobal.API.setPlayerClothes(player.Handle, 3, 0, 0);
  96.                                         mGlobal.API.setPlayerClothes(player.Handle, 4, 27, 8);
  97.                                         mGlobal.API.setPlayerClothes(player.Handle, 5, 0, 0);
  98.                                         mGlobal.API.setPlayerClothes(player.Handle, 6, 27, 0);
  99.                                         mGlobal.API.setPlayerClothes(player.Handle, 7, 0, 0);
  100.                                         mGlobal.API.setPlayerClothes(player.Handle, 8, 59, 0);
  101.                                         mGlobal.API.setPlayerClothes(player.Handle, 9, 0, 0);
  102.                                         mGlobal.API.setPlayerClothes(player.Handle, 10, 0, 0);
  103.                                         mGlobal.API.setPlayerClothes(player.Handle, 11, 16, 0);
  104.                                     break;
  105.  
  106.                                     case 2:
  107.                                         mGlobal.API.setPlayerClothes(player.Handle, 0, 0, 0);
  108.                                         mGlobal.API.setPlayerClothes(player.Handle, 1, 0, 0);
  109.                                         mGlobal.API.setPlayerClothes(player.Handle, 3, 0, 0);
  110.                                         mGlobal.API.setPlayerClothes(player.Handle, 4, 27, 2);
  111.                                         mGlobal.API.setPlayerClothes(player.Handle, 5, 0, 0);
  112.                                         mGlobal.API.setPlayerClothes(player.Handle, 6, 27, 0);
  113.                                         mGlobal.API.setPlayerClothes(player.Handle, 7, 0, 0);
  114.                                         mGlobal.API.setPlayerClothes(player.Handle, 8, 59, 1);
  115.                                         mGlobal.API.setPlayerClothes(player.Handle, 9, 0, 0);
  116.                                         mGlobal.API.setPlayerClothes(player.Handle, 10, 0, 0);
  117.                                         mGlobal.API.setPlayerClothes(player.Handle, 11, 1, 0);
  118.                                     break;
  119.  
  120.                                     case 3:
  121.                                         mGlobal.API.setPlayerClothes(player.Handle, 0, 0, 0);
  122.                                         mGlobal.API.setPlayerClothes(player.Handle, 1, 0, 0);
  123.                                         mGlobal.API.setPlayerClothes(player.Handle, 3, 0, 0);
  124.                                         mGlobal.API.setPlayerClothes(player.Handle, 4, 27, 3);
  125.                                         mGlobal.API.setPlayerClothes(player.Handle, 5, 0, 0);
  126.                                         mGlobal.API.setPlayerClothes(player.Handle, 6, 27, 0);
  127.                                         mGlobal.API.setPlayerClothes(player.Handle, 7, 0, 0);
  128.                                         mGlobal.API.setPlayerClothes(player.Handle, 8, 59, 0);
  129.                                         mGlobal.API.setPlayerClothes(player.Handle, 9, 0, 0);
  130.                                         mGlobal.API.setPlayerClothes(player.Handle, 10, 0, 0);
  131.                                         mGlobal.API.setPlayerClothes(player.Handle, 11, 1, 0);
  132.                                     break;
  133.                                 }
  134.                             });
  135.                         }
  136.                         else
  137.                         {
  138.                             mGlobal.API.setPlayerSkin(player.Handle, PedHash.Cop01SMY);
  139.                         }
  140.                     }
  141.                     cWeaponInfo.GiveAllPlayerWeapon(player);
  142.                 }
  143.                 else if (!player.OnDutyOrgaType3)
  144.                 {
  145.                     mGlobal.API.sendNotificationToPlayer(player.Handle, "Vous venez de ~y~sortir~w~ de votre service !");
  146.                     mGlobal.API.setPlayerSkin(player.Handle, (PedHash)player.Skin);
  147.                     dPlayer.DefinePlayerSkin(player);
  148.                     mGlobal.API.setPlayerArmor(player.Handle, 0);
  149.                     player.RemoveAllPlayerWeaponService();
  150.                 }
  151.                 return true;
  152.             }
  153.             return false;
  154.         }
  155.     }
  156. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement