Advertisement
TheRouletteBoi

iFruit feature

Feb 11th, 2016
684
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.80 KB | None | 0 0
  1. //camxxcore
  2. //work in progress
  3. int scaleFormPhoneApp;
  4. int Index;
  5. bool _shouldDraw = false;
  6. int index = -1;
  7. void AddPhoneContact(char * contactName, int slot)
  8. {
  9.     //request ifruit handle
  10.     scaleFormPhoneApp = REQUEST_SCALEFORM_MOVIE("cellphone_ifruit");
  11.     //push function to the stack to change the data
  12.     _PUSH_SCALEFORM_MOVIE_FUNCTION(scaleFormPhoneApp, "SET_DATA_SLOT");
  13.     //not sure
  14.     _PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_FLOAT((float)2);
  15.     //set data slot index
  16.     _PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_FLOAT((float)slot);
  17.     //not sure
  18.     _PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_FLOAT(0.0f);
  19.     _BEGIN_TEXT_COMPONENT("STRING");
  20.     //add our text
  21.     _ADD_TEXT_COMPONENT_STRING(contactName);
  22.     _END_TEXT_COMPONENT();
  23.     _BEGIN_TEXT_COMPONENT("CELL_MP_999");
  24.     _END_TEXT_COMPONENT();
  25.     _BEGIN_TEXT_COMPONENT("CELL_MP_999");
  26.     _END_TEXT_COMPONENT();
  27.     //pop and call on the stack
  28.     _POP_SCALEFORM_MOVIE_FUNCTION_VOID();
  29.     //increment index for next item
  30.     //Index += 1;
  31. }
  32. void DisplayCallUI(char * contactName, char * picName = "CELL_300")
  33. {
  34.     scaleFormPhoneApp = REQUEST_SCALEFORM_MOVIE("cellphone_ifruit");
  35.     _PUSH_SCALEFORM_MOVIE_FUNCTION(scaleFormPhoneApp, "SET_DATA_SLOT");
  36.     _PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(4);
  37.     _PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(0);
  38.     _PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(3);
  39.  
  40.     _BEGIN_TEXT_COMPONENT("STRING");
  41.     _0x65E1D404(contactName, -1);
  42.     _END_TEXT_COMPONENT();
  43.  
  44.     _BEGIN_TEXT_COMPONENT("CELL_319");
  45.     _END_TEXT_COMPONENT();
  46.  
  47.     _BEGIN_TEXT_COMPONENT("STRING");
  48.     _0x65E1D404("DIALING...", -1);
  49.     _END_TEXT_COMPONENT();
  50.  
  51.     _POP_SCALEFORM_MOVIE_FUNCTION_VOID();
  52.  
  53.     _PUSH_SCALEFORM_MOVIE_FUNCTION(scaleFormPhoneApp, "DISPLAY_VIEW");
  54.     _PUSH_SCALEFORM_MOVIE_FUNCTION_PARAMETER_INT(4);
  55.     _POP_SCALEFORM_MOVIE_FUNCTION_VOID();
  56. }
  57. int GetSelectedIndex()
  58. {
  59.     int data;
  60.     _PUSH_SCALEFORM_MOVIE_FUNCTION(scaleFormPhoneApp, "GET_CURRENT_SELECTION");
  61.     int result = _POP_SCALEFORM_MOVIE_FUNCTION();
  62.     if (!_0x5CD7C3C0(result))
  63.         data = _0x2CFB0E6D(result);
  64.     return data;
  65. }
  66. void UpdateiFruitApp() { //21 + b/c 16 players + 4 mission apps and + friends online 1 in my case
  67.     if (_GET_NUMBER_OF_INSTANCES_OF_STREAMED_SCRIPT(3073930887) > 0)
  68.     {
  69.         _shouldDraw = true;
  70.         if (IS_CONTROL_PRESSED(2, INPUT_FRONTEND_RDOWN))
  71.         {
  72.             index = GetSelectedIndex();
  73.         }
  74.     }
  75.     else
  76.         _shouldDraw = false;
  77.  
  78.     if (_shouldDraw)
  79.     {
  80.         AddPhoneContact("Spawn Adder", Index = 21);
  81.         AddPhoneContact("Teleport To Airport", Index = 22);
  82.     }
  83.     if (index != -1 && index == Index)
  84.     {
  85.         DisplayCallUI("Spawn Adder");
  86.     }
  87.     switch (Index)
  88.     {
  89.     case 21: //CreateVehicleM(VEHICLE_ADDER, -1027.7180f, -3013.5890f, 49.0911f);
  90.         printf("adder spawned\n");
  91.         break;
  92.     case 22: //SET_ENTITY_COORDS_NO_OFFSET(PLAYER_PED_ID(), -1027.7180f, -3013.5890f, 49.0911f, 0, 0, 1);
  93.         printf("tp to airport\n");
  94.         break;
  95.     }
  96. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement