shourya90

Untitled

May 14th, 2018
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.10 KB | None | 0 0
  1. namespace crazycnr
  2. {
  3.     class StoresData
  4.     {
  5.  
  6.         public static List<Stores> LoadStores()
  7.         {
  8.  
  9.            
  10.  
  11.             Stores sData = new Stores();
  12.             sData.storeID = 0;
  13.             //sData.enterpointLoc = new Vector3();
  14.             sData.robpointLoc = new Vector3(-706.0094, -913.6223, 19.21559);
  15.             sData.storeName = "Store: 24/7";
  16.  
  17.             Stores sData1 = new Stores();
  18.             sData1.storeID = 1;
  19.             //sData1.enterpointLoc = new Vector3();
  20.             sData1.robpointLoc = new Vector3(-1221.863, -908.277, 12.32636);
  21.             sData1.storeName = "Store: Redwood Beer Shop";
  22.  
  23.             Stores sData2 = new Stores();
  24.             sData2.storeID = 2;
  25.             //sData2.enterpointLoc = new Vector3();
  26.             sData2.robpointLoc = new Vector3(-1486.191, -378.0268, 40.16339);
  27.             sData2.storeName = "Store: Redwood Beer Shop";
  28.  
  29.             Stores sData3 = new Stores();
  30.             sData3.storeID = 3;
  31.             //sData3.enterpointLoc = new Vector3();
  32.             sData3.robpointLoc = new Vector3(24.4151, -1344.89, 29.49703);
  33.             sData3.storeName = "Store: 24/7";
  34.  
  35.             Stores sData4 = new Stores();
  36.             sData4.storeID = 4;
  37.             //sData7.enterpointLoc = new Vector3();
  38.             sData4.robpointLoc = new Vector3(-46.69641, -1757.985, 29.42102);
  39.             sData4.storeName = "Store: 24/7";
  40.  
  41.             List<Stores> storeList = new List<Stores>();
  42.             storeList.Add(sData);
  43.             storeList.Add(sData1);
  44.             storeList.Add(sData2);
  45.             storeList.Add(sData3);
  46.             storeList.Add(sData4);
  47.             foreach (Stores stmodel in storeList)
  48.             {
  49.                
  50.  
  51.                 stmodel.storeLabelrob = NAPI.TextLabel.CreateTextLabel(stmodel.storeName, stmodel.robpointLoc, 20.0f, 0.75f, 1, new Color(255, 255, 255), false, 0);
  52.                 stmodel.storemarkrob = NAPI.Marker.CreateMarker(1, stmodel.robpointLoc, stmodel.robpointLoc, new Vector3(0.0, 0.0, 0.0), 1f, new Color(255, 255, 0, 155), true, 0);
  53.                 stmodel.coltelerob = NAPI.ColShape.CreateSphereColShape(stmodel.robpointLoc, 1.0f, 0);
  54.                 stmodel.mapicon = NAPI.Blip.CreateBlip(stmodel.robpointLoc);
  55.                 NAPI.Blip.SetBlipName(stmodel.mapicon, stmodel.storeName);
  56.                 NAPI.Blip.SetBlipSprite(stmodel.mapicon, 108);
  57.  
  58.             }
  59.             return storeList;
  60.  
  61.  
  62.         }
  63.         public static List<Stores> storeList;
  64.         [ServerEvent(Event.PlayerEnterColshape)]
  65.         public void OnPlayerEnterColshape(ColShape shape, Client player)
  66.         {
  67.  
  68.             storeList = StoresData.LoadStores();
  69.             foreach (Stores stmodel in storeList)
  70.             {
  71.                 if (shape == stmodel.coltelerob)
  72.                 {
  73.  
  74.                     NAPI.Notification.SendNotificationToPlayer(player, string.Format("{0}", stmodel.storeName), true);
  75.                     NAPI.Notification.SendNotificationToPlayer(player, "hello", true);
  76.                     break;
  77.                 }
  78.             }
  79.            
  80.            
  81.         }
  82.     }
  83. }
Add Comment
Please, Sign In to add comment