Casino

Cosy/Neons

Nov 2nd, 2012
462
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.54 KB | None | 0 0
  1. Object NeonLight, NeonLight1, neons, neons1;
  2. float neonheight;
  3. Vehicle myveh;
  4. uint BM_air_landlites03 = 0xD20167BE;
  5. int neonheight;
  6.  
  7. void PrintText(char *text)
  8. {
  9.     PRINT_STRING_WITH_LITERAL_STRING_NOW("string", text, 5000, 1);
  10. }
  11.  
  12. void Neon(void)
  13. {
  14.     if ( IS_CHAR_IN_ANY_CAR(GetPlayerPed()) )
  15.     {
  16.         if ( DOES_OBJECT_EXIST(neons) && DOES_OBJECT_EXIST(neons1) )
  17.         {
  18.             DELETE_OBJECT(&neons);
  19.             DELETE_OBJECT(&neons1);
  20.             PrintText("Neon Lights Off");
  21.         }
  22.         else
  23.         {
  24.             GET_CAR_CHAR_IS_USING(GetPlayerPed(), &myveh);
  25.             Ped Pped = GetPlayerPed();
  26.             if ( !IS_CHAR_ON_ANY_BIKE(Pped) && (!IS_CHAR_IN_ANY_BOAT(Pped)) && (!IS_CHAR_IN_ANY_HELI(Pped)) && (!IS_BIG_VEHICLE(myveh)) )
  27.             {
  28.                 REQUEST_MODEL(BM_air_landlites03);
  29.                 while ( !HAS_MODEL_LOADED(BM_air_landlites03) ) WAIT(10);
  30.  
  31.                 if ( HAS_MODEL_LOADED(BM_air_landlites03) )
  32.                 {
  33.                     CREATE_OBJECT(BM_air_landlites03 ,0,0,0,&NeonLight,1);
  34.                     WAIT(10);
  35.                     CREATE_OBJECT(BM_air_landlites03 ,0,0,0,&NeonLight1,1);
  36.                     WAIT(10);
  37.                     MARK_MODEL_AS_NO_LONGER_NEEDED(BM_air_landlites03);
  38.  
  39.                     neonheight = -0.18;
  40.                     if ( IS_CAR_MODEL(myveh, MODEL_SULTAN) ) neonheight = -0.10;
  41.                     else if ( IS_CAR_MODEL(myveh, MODEL_PEYOTE) ) neonheight = -0.07;
  42.  
  43.                     //ATTACH_OBJECT_TO_CAR(Object obj, Vehicle v, uint unknown0_0, float pX, float pY, float pZ, float rX, float rY, float rZ);
  44.                     ATTACH_OBJECT_TO_CAR(NeonLight, myveh, 0, 0, -0.35, neonheight, 1.58, 0, 0);// rear neon
  45.                     ATTACH_OBJECT_TO_CAR(NeonLight1, myveh, 0, 0, 0.35, neonheight, -1.58, 0, 0);// front neon
  46.                     FREEZE_OBJECT_POSITION(NeonLight, true);
  47.                     FREEZE_OBJECT_POSITION(NeonLight1, true);
  48.                     SET_OBJECT_VISIBLE(NeonLight, true);
  49.                     SET_OBJECT_VISIBLE(NeonLight1, true);
  50.                     neons = NeonLight;
  51.                     neons1 = NeonLight1;
  52.                     MARK_OBJECT_AS_NO_LONGER_NEEDED(&NeonLight);
  53.                     MARK_OBJECT_AS_NO_LONGER_NEEDED(&NeonLight1);
  54.                     PrintText("Neon Lights On");
  55.                 }
  56.                 else PrintText("Unable to load object");
  57.             }
  58.             else PrintText("Neons only work with Cars");
  59.         }
  60.     }
  61.     else PrintText("Not in a Car");
  62. }
Advertisement
Add Comment
Please, Sign In to add comment