Advertisement
Guest User

My Ship

a guest
May 13th, 2015
322
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.04 KB | None | 0 0
  1. // Az _ SHIP
  2.  
  3. // BY azula
  4. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  5. #include <a_samp>
  6. #include <streamer>
  7. #include <zcmd>
  8. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  9.  
  10. main()
  11. {return 1;
  12. }
  13.  
  14. #define @error SendClientMessage(playerid,-1," {FF2EE1} [Az-MyShip] : {FC0B0B}Error");
  15. #define FLOAT_INFINITY (Float:0x7F800000)
  16.  
  17.  
  18. enum AzInfo
  19. {
  20. bool:ID,
  21. AZVEH
  22. }
  23. new AzShip[MAX_PLAYERS][AzInfo];
  24. new AZOBJ[MAX_PLAYERS][18];
  25. new Cam[MAX_PLAYERS];
  26. //new Float:health; just for debug view don
  27.  
  28. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  29. public OnFilterScriptInit()
  30. {
  31. print("\n-----------Azula 2015 scripting------------------------");
  32. print(" Az _My SHIP By Azula");
  33. print("--------------------------------------\n");
  34. return 1;
  35. }
  36.  
  37. public OnFilterScriptExit()
  38. {
  39. return 1;
  40. }
  41.  
  42. /*public OnPlayerUpdate(playerid) // debug update
  43. {
  44.  
  45. printf("health changes %f", GetVehicleHealth(AzShip[playerid] [ AZVEH ], health));
  46. return 1;
  47. }*/
  48.  
  49.  
  50. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  51.  
  52.  
  53. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  54.  
  55. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  56. CMD:myship(playerid, params[]) {
  57.  
  58. if( AzShip[playerid] [ ID ] != false ) return @error
  59.  
  60. new Float:AZPOS[3];
  61.  
  62. GetPlayerPos(playerid,AZPOS[0],AZPOS[1],AZPOS[2]);
  63.  
  64. AzShip[playerid] [ AZVEH ] = AddStaticVehicle(484, 0,0,0, 90.0000, -1, -1);
  65.  
  66. // object attach
  67. AZOBJ[playerid][0] = CreateObject(5166, 9.28260, -5.10100, 12.52660, 0.00000, 0.00000, 90.00000);
  68. AZOBJ[playerid][1] = CreateObject(5160, 9.26610, -4.38820, 12.53700, 0.00000, 0.00000, 90.00000);
  69. AZOBJ[playerid][2] = CreateObject(5167, 1.23210, -111.96890, 14.60670, 0.00000, 0.00000, 90.00000);
  70. AZOBJ[playerid][3] = CreateObject(5157, 1.23894, 48.11191, 24.25010, 0.00000, 0.00000, 90.00000);
  71. AZOBJ[playerid][4] = CreateObject(5156, 1.28523, -60.89987, 18.21230, 0.00000, 0.00000, 90.00000);
  72. AZOBJ[playerid][5] = CreateObject(5154, 1.84110, -36.40240, 22.98230, 0.00000, 0.00000, 91.00000);
  73. AZOBJ[playerid][6] = CreateObject(12911, 13.73760, -69.57770, 16.90660, 0.00000, 0.00000, 11.00000);
  74. AZOBJ[playerid][7] = CreateObject(5155, 2.88898, -124.71310, 28.41030, 0.00000, 0.00000, 90.00000);
  75. AZOBJ[playerid][8] = CreateObject(5158, 3.12849, -148.76134, 19.35090, 0.00000, 0.00000, 180.00000);
  76. AZOBJ[playerid][9] = CreateObject(12911, -11.30160, -72.64630, 16.05860, 0.00000, 0.00000, -164.00000);
  77. AZOBJ[playerid][10] = CreateObject(3934, 2.43130, -23.09680, 18.27420, 0.00000, 0.00000, 0.00000);
  78. AZOBJ[playerid][11] = CreateObject(3934, -5.77430, -15.58513, 18.27420, 0.00000, 0.00000, 0.00000);
  79. AZOBJ[playerid][12] = CreateObject(3934, 10.70086, -15.43115, 18.27420, 0.00000, 0.00000, 0.00000);
  80. AZOBJ[playerid][13] = CreateObject(3934, 2.70715, -7.90210, 18.27420, 0.00000, 0.00000, 0.00000);
  81.  
  82. AZOBJ[playerid][14] = CreateObject(0, 22.4578, -234.1633, 76.9828, 0.00000, 0.00000, 0.00000); // camera 1
  83. AZOBJ[playerid][15] = CreateObject(0, 22.4578, -234.1633, 76.9828, 0.00000, 0.00000, 0.00000); // camera 2
  84. AZOBJ[playerid][16] = CreateObject(0, 22.4578, -234.1633, 76.9828, 0.00000, 0.00000, 0.00000); // camera 3
  85. AZOBJ[playerid][17] = CreateObject(0, 22.4578, -234.1633, 76.9828, 0.00000, 0.00000, 0.00000); // camera 4
  86.  
  87.  
  88.  
  89. AttachObjectToVehicle(AZOBJ[playerid][0], AzShip[playerid] [ AZVEH ], 9.28260, -5.10100, 12.52660, 0.00000, 0.00000, 90.00000);
  90. AttachObjectToVehicle(AZOBJ[playerid][1], AzShip[playerid] [ AZVEH ], 9.26610, -4.38820, 12.53700, 0.00000, 0.00000, 90.00000);
  91. AttachObjectToVehicle(AZOBJ[playerid][2], AzShip[playerid] [ AZVEH ], 1.23210, -111.96890, 14.60670, 0.00000, 0.00000, 90.00000);
  92.  
  93. AttachObjectToVehicle(AZOBJ[playerid][3], AzShip[playerid] [ AZVEH ], 1.23894, 48.11191, 24.25010, 0.00000, 0.00000, 90.00000);
  94. AttachObjectToVehicle(AZOBJ[playerid][4], AzShip[playerid] [ AZVEH ], 1.28523, -60.89987, 18.21230, 0.00000, 0.00000, 90.00000);
  95. AttachObjectToVehicle(AZOBJ[playerid][5], AzShip[playerid] [ AZVEH ], 1.84110, -36.40240, 22.98230, 0.00000, 0.00000, 91.00000);
  96. AttachObjectToVehicle(AZOBJ[playerid][6], AzShip[playerid] [ AZVEH ], 13.73760, -69.57770, 16.90660, 0.00000, 0.00000, 11.00000);
  97. AttachObjectToVehicle(AZOBJ[playerid][7], AzShip[playerid] [ AZVEH ], 2.88898, -124.71310, 28.41030, 0.00000, 0.00000, 90.00000);
  98. AttachObjectToVehicle(AZOBJ[playerid][8], AzShip[playerid] [ AZVEH ], 3.12849, -148.76134, 19.35090, 0.00000, 0.00000, 180.00000);
  99. AttachObjectToVehicle(AZOBJ[playerid][9], AzShip[playerid] [ AZVEH ], -11.30160, -72.64630, 16.05860, 0.00000, 0.00000, -164.00000);
  100. AttachObjectToVehicle(AZOBJ[playerid][10], AzShip[playerid] [ AZVEH ], 2.43130, -23.09680, 18.27420, 0.00000, 0.00000, 0.00000);
  101. AttachObjectToVehicle(AZOBJ[playerid][11], AzShip[playerid] [ AZVEH ], -5.77430, -15.58513, 18.27420, 0.00000, 0.00000, 0.00000);
  102. AttachObjectToVehicle(AZOBJ[playerid][12], AzShip[playerid] [ AZVEH ], 10.70086, -15.43115, 18.27420, 0.00000, 0.00000, 0.00000);
  103. AttachObjectToVehicle(AZOBJ[playerid][13], AzShip[playerid] [ AZVEH ], 2.70715, -7.90210, 18.27420, 0.00000, 0.00000, 0.00000);
  104. AttachObjectToVehicle(AZOBJ[playerid][14], AzShip[playerid] [ AZVEH ], 5.1835, -104.7419, 76.9828, 0.00000, 0.00000, 0.00000); // main cam
  105. AttachObjectToVehicle(AZOBJ[playerid][15], AzShip[playerid] [ AZVEH ], -67.32504, -70.69270, 77.47660, 0.00000, 0.00000, 0.00000); //2 cam
  106. AttachObjectToVehicle(AZOBJ[playerid][16], AzShip[playerid] [ AZVEH ], 73.3556, 15.5611, 77.4766, 0.00000, 0.00000, 0.00000); // 3 cam
  107. AttachObjectToVehicle(AZOBJ[playerid][17], AzShip[playerid] [ AZVEH ], 68.6926, -114.2084, 77.4766, 0.00000, 0.00000, 0.00000); // 4 cam
  108.  
  109. SetVehiclePos(AzShip[playerid] [ AZVEH ] ,AZPOS[0],AZPOS[1],AZPOS[2] + 5 );
  110. PutPlayerInVehicle(playerid, AzShip[playerid] [ AZVEH ], 0);
  111. SetVehicleHealth(AzShip[playerid] [ AZVEH ], FLOAT_INFINITY);
  112.  
  113. AttachCameraToObject(playerid, AZOBJ[playerid][14]);
  114.  
  115.  
  116.  
  117. AzShip[playerid] [ ID ] = true;
  118. Cam[playerid] = 1;
  119. return 1;
  120. }
  121.  
  122.  
  123. CMD:dship(playerid, params[]) {
  124.  
  125. if( AzShip[playerid] [ ID ] == false ) return @error
  126. for(new i = 0; i!=15;i++) { DestroyObject(AZOBJ[playerid][i]); }
  127. DestroyVehicle(AzShip[playerid] [ AZVEH ]);
  128. SetCameraBehindPlayer(playerid);
  129. AzShip[playerid] [ ID ] = false;
  130. return true;
  131. }
  132.  
  133. CMD:drive(playerid, params[]) {
  134.  
  135. if( AzShip[playerid] [ ID ] == false ) return @error
  136. PutPlayerInVehicle(playerid, AzShip[playerid] [ AZVEH ], 0);
  137. AttachCameraToObject(playerid, AZOBJ[playerid][14]);
  138. return true;
  139. }
  140.  
  141. CMD:navigate(playerid, params[]) {
  142.  
  143. if( AzShip[playerid] [ ID ] == false ) return @error
  144. new Float:AZPOS[3];
  145.  
  146. GetVehiclePos(AzShip[playerid] [ AZVEH ],AZPOS[0],AZPOS[1],AZPOS[2]);
  147.  
  148. SetPlayerPos(playerid,AZPOS[0]+4.2498 ,AZPOS[1]+47.1940,AZPOS[2]+25.1967);
  149.  
  150. SetCameraBehindPlayer(playerid);
  151.  
  152. return true;
  153. }
  154.  
  155. CMD:cam(playerid, params[]) {
  156.  
  157. if( AzShip[playerid] [ ID ] == false ) return @error
  158. switch ( Cam[playerid] ) {
  159. case 0,1 : AttachCameraToObject(playerid, AZOBJ[playerid][15]),Cam[playerid]=1;
  160. case 2 : AttachCameraToObject(playerid, AZOBJ[playerid][16]);
  161. case 3 : AttachCameraToObject(playerid, AZOBJ[playerid][17]);
  162. case 4 : AttachCameraToObject(playerid, AZOBJ[playerid][14]),Cam[playerid]=0;
  163. }
  164. Cam[playerid] ++;
  165. return true;
  166. }
  167.  
  168. CMD:crash(playerid, params[]) {
  169.  
  170. SetVehicleHealth(AzShip[playerid] [ AZVEH ], 0);
  171. return true;
  172. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement