Advertisement
Guest User

az SHIP beta

a guest
May 12th, 2015
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.26 KB | None | 0 0
  1. // Az _ SHIP
  2.  
  3. // BY azula
  4. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  5. #include <a_samp>
  6. #include <zcmd>
  7. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  8.  
  9. main()
  10. {return 1;
  11. }
  12.  
  13. #define @error SendClientMessage(playerid,-1," {FF2EE1} [Az-Ship] : {FC0B0B}Error");
  14.  
  15.  
  16. enum AzInfo
  17. {
  18. bool:ID,
  19. AZVEH,
  20. Text3D:Text
  21. }
  22. new AzShip[MAX_PLAYERS][AzInfo];
  23. new AZOBJ[MAX_PLAYERS][8];
  24.  
  25.  
  26.  
  27.  
  28. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  29. public OnFilterScriptInit()
  30. {
  31. print("\n-----------Azula 2015 scripting------------------------");
  32. print(" Az _ SHIP By Azula");
  33. print("--------------------------------------\n");
  34. return 1;
  35. }
  36.  
  37. public OnFilterScriptExit()
  38. {
  39. return 1;
  40. }
  41. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  42.  
  43.  
  44. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  45.  
  46. ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  47. CMD:azship(playerid, params[]) {
  48.  
  49. if( AzShip[playerid] [ ID ] != false ) return @error
  50.  
  51. new Float:AZPOS[3];
  52.  
  53. GetPlayerPos(playerid,AZPOS[0],AZPOS[1],AZPOS[2]);
  54.  
  55. AZOBJ[playerid][0] = CreateObject(10231, 0.44450, 0.79290, 7.93500, 0.00000, 0.00000, -90.00000);
  56. AZOBJ[playerid][1] = CreateObject(10230, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000);
  57. AZOBJ[playerid][2] = CreateObject(0, -3.44911, -125.35394, 72.00260, 3.14160, 0.00000, 1.99840);
  58.  
  59. AZOBJ[playerid][3] = CreateObject(1506, 1.71283, -47.22900, 14.18948, 0.00000, 0.00000, 0.00000);
  60.  
  61.  
  62. AzShip[playerid] [ AZVEH ] = AddStaticVehicle(493, -34.4456, -2.4899, -10.9782, 90.0000, -1, -1);
  63.  
  64. AttachObjectToVehicle(AZOBJ[playerid][0], AzShip[playerid] [ AZVEH ], 0.44450, 0.79290, 8.93500, 0.00000, 0.00000, -90.00000);
  65. AttachObjectToVehicle(AZOBJ[playerid][1], AzShip[playerid] [ AZVEH ], 1.91470, 0.01930, 12.08500, 0.00000, 0.00000, -90.00000);
  66. AttachObjectToVehicle(AZOBJ[playerid][2], AzShip[playerid] [ AZVEH ], -3.44911, -125.35394, 72.00260, 3.14160, 0.00000, 1.99840);
  67. // addon v0.1
  68. AttachObjectToVehicle(AZOBJ[playerid][3], AzShip[playerid] [ AZVEH ], 1.71283, -47.22900, 14.18948, 0.00000, 0.00000, 0.00000);
  69.  
  70. SetObjectMaterial(AZOBJ[playerid][0], 0, 10140, "frieghter2sfe", "sf_ship_steps", 0xFFFFFFFF);
  71.  
  72. PutPlayerInVehicle(playerid, AzShip[playerid] [ AZVEH ], 0);
  73. SetVehiclePos(AzShip[playerid] [ AZVEH ] ,AZPOS[0],AZPOS[1],AZPOS[2] + 5 );
  74.  
  75. AttachCameraToObject(playerid, AZOBJ[playerid][2]);
  76.  
  77. AzShip[playerid] [ ID ] = true;
  78. return 1;
  79. }
  80.  
  81. CMD:horn(playerid, params[]) {
  82. if( AzShip[playerid] [ ID ] == false ) return @error
  83.  
  84. new Float:AZPOS[3];
  85.  
  86. GetPlayerPos(playerid,AZPOS[0],AZPOS[1],AZPOS[2]);
  87.  
  88.  
  89. for(new i = 0; i< MAX_PLAYERS;i++) {
  90. if(!IsPlayerInRangeOfPoint(i, 15.0, AZPOS[0],AZPOS[1],AZPOS[2] )) continue;
  91. PlayAudioStreamForPlayer(playerid, "http://www.soundsnap.com/files/tmp-stream/1431442020/89/transcode/tug-boat-horn.mp3");
  92. }
  93. return true;
  94. }
  95.  
  96.  
  97. CMD:dship(playerid, params[]) {
  98.  
  99. if( AzShip[playerid] [ ID ] == false ) return @error
  100. for(new i = 0; i!=8;i++) { DestroyObject(AZOBJ[playerid][i]); }
  101. DestroyVehicle(AzShip[playerid] [ AZVEH ]);
  102. SetCameraBehindPlayer(playerid);
  103. AzShip[playerid] [ ID ] = false;
  104. return true;
  105. }
  106.  
  107. CMD:drive(playerid, params[]) {
  108.  
  109. if( AzShip[playerid] [ ID ] == false ) return @error
  110. PutPlayerInVehicle(playerid, AzShip[playerid] [ AZVEH ], 0);
  111. AttachCameraToObject(playerid, AZOBJ[playerid][2]);
  112. return true;
  113. }
  114.  
  115. CMD:navigate(playerid, params[]) {
  116.  
  117. if( AzShip[playerid] [ ID ] == false ) return @error
  118. new Float:AZPOS[3];
  119.  
  120. GetPlayerPos(playerid,AZPOS[0],AZPOS[1],AZPOS[2]);
  121.  
  122. SetPlayerPos(playerid,AZPOS[0]+1.91470 ,AZPOS[1]+ 0.01930 ,AZPOS[2]+14.08500);
  123.  
  124. SetCameraBehindPlayer(playerid);
  125.  
  126. return true;
  127. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement