Guest User

Piloto

a guest
Mar 5th, 2017
329
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.79 KB | None | 0 0
  1. /*Nao retire os Creditos :)*/
  2. #include <a_samp>
  3. #include <zcmd>
  4. #include <sscanf2>
  5.  
  6. /*MACROS*/
  7. #define SendClientFormat(%0,%1,%2,%3); format(string, sizeof(string), %2, %3); SendClientMessage(%0, %1, string);
  8. /*ENUMS*/
  9. enum pProf
  10. {
  11. Profissao
  12. }
  13. /*NEWS*/
  14. new A_Aviao[3];
  15. new Prof[MAX_PLAYERS][pProf];
  16. new carregado[MAX_PLAYERS] = 0;
  17. /*Profissao*/
  18. #define Piloto 0
  19. #define C_Piloto 0x0080C0AA
  20. /*DIALOGS*/
  21. #define DIALOG_PILOTO 22
  22. /*CORES*/
  23. #define COR_ERRO 0xFF0000FF
  24. #define Verde 0x31E045FF
  25. #define Azul 0x0091FFFF
  26.  
  27. public OnFilterScriptInit()
  28. {
  29. /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
  30. print("\n--------------------------------------");
  31. print(" Criado por: SmokiieGamer");
  32. print(" http://forum.sa-mp.com/member.php?u=282148 ");
  33. print("--------------------------------------\n");
  34. return 1;
  35. }
  36.  
  37.  
  38. public OnPlayerConnect(playerid)
  39. {
  40. /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
  41. A_Aviao[0] = CreateVehicle(592, 1966.7438, -2636.7927, 14.4717, 30.0000, -1, -1, 100);
  42. A_Aviao[1] = CreateVehicle(592, 2007.2888, -2633.1421, 14.4717, 30.0000, -1, -1, 100);
  43. A_Aviao[2] = CreateVehicle(592, 2051.5925, -2633.0779, 14.4717, 30.0000, -1, -1, 100);
  44. /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
  45. SetPlayerColor(playerid, 0xFFFFFFFF);
  46. /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
  47. return 1;
  48. }
  49.  
  50. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  51. {
  52. if(dialogid == DIALOG_PILOTO)
  53. {
  54. if(response)
  55. {
  56. switch(listitem)
  57. {
  58. case 0:
  59. {
  60. DisablePlayerCheckpoint(playerid);
  61. SetPlayerCheckpoint(playerid, 1476.443969, 1751.984863, 10.812500, 0.0);
  62. carregado[playerid] = 1;
  63. SendClientMessage(playerid, Verde, "| CARREGAMENTO | Foi marcado um ponto vermelho no seu mapa. Siga-o para entregar os passageiros !");
  64. return 1;
  65. } // CASE QUISER FAZER OUTROS CARREGAMENTOS, FASSA IGUAL AO DE CIMA.
  66. case 1:
  67. {
  68. DisablePlayerCheckpoint(playerid);
  69. SetPlayerCheckpoint(playerid, -1202.430541, -185.807723, 14.148437, 0.0);
  70. carregado[playerid] = 1;
  71. SendClientMessage(playerid, Verde, "| CARREGAMENTO | Foi marcado um ponto vermelho no seu mapa. Siga-o para entregar os passageiros !");
  72. return 1;
  73. }
  74. }
  75. }
  76. }
  77. return 1;
  78. }
  79.  
  80. CMD:carregar(playerid)
  81. {
  82. if(Prof[playerid][Profissao] == Piloto)
  83. {
  84. if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  85. {
  86. if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 592)
  87. {
  88. if(PlayerToPoint(playerid, 50.0, 2024.782226, -2603.623779, 13.546875) || PlayerToPoint(playerid, 50.0, 1979.591552, -2605.063720, 13.546875) || PlayerToPoint(playerid, 50.0, 1979.190063, -2584.598144, 13.546875))
  89. {
  90. if(carregado[playerid] == 0)
  91. {
  92. new StringCat[700];
  93. strcat(StringCat, "{FFFFFF}30 Passageiros LV{D2691E}» {00FF00}R$1500\n");
  94. strcat(StringCat, "{FFFFFF}50 Passageiros SF{D2D61E}» {00FF00}R$1500\n");
  95. ShowPlayerDialog(playerid, DIALOG_PILOTO, DIALOG_STYLE_LIST, "{FFFFFF}Carregamento", StringCat, "{FFFFFF}Carregar", "{FFFFFF}Cancelar");
  96. carregado[playerid] = 1;
  97. return 1;
  98. }
  99. else SendClientMessage(playerid, COR_ERRO, "Seu avião já está carregado!");
  100. return 1;
  101. }
  102. else SendClientMessage(playerid, COR_ERRO, "Você não está na Área de Carregamento!");
  103. return 1;
  104. }
  105. else SendClientMessage(playerid, COR_ERRO, "Você não está em um Avião");
  106. return 1;
  107. }
  108. else SendClientMessage(playerid, COR_ERRO, "Você não está dirigindo um avião!");
  109. return 1;
  110. }
  111. else SendClientMessage(playerid, COR_ERRO, "Você não tem permissão!");
  112. return 1;
  113. }
  114.  
  115. CMD:descarregar(playerid)
  116. {
  117. if(Prof[playerid][Profissao] == Piloto)
  118. {
  119. if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 592)
  120. {
  121. if(carregado[playerid] == 0)
  122. {
  123. SendClientMessage(playerid, COR_ERRO, "O seu avião não está carregado!");
  124. return 1;
  125. }
  126. if(carregado[playerid] == 1)
  127. {
  128. if(PlayerToPoint(playerid, 50.0, 1476.443969, 1751.984863, 10.812500) || PlayerToPoint(playerid, 50.0, 1476.443969, 1751.984863, 10.812500) || PlayerToPoint(playerid, 50.0, -1202.430541, -185.807723, 14.148437))
  129. carregado[playerid] = 0;
  130. DisablePlayerCheckpoint(playerid);
  131. SendClientMessage(playerid, Verde, "Você entrou os passageiros e ganhou R$1500");
  132. GivePlayerMoney(playerid, 1500);
  133. return 1;
  134. }
  135. else SendClientMessage(playerid, COR_ERRO, "Você não está na área de descarregamento!");
  136. return 1;
  137. }
  138. else SendClientMessage(playerid, COR_ERRO, "Você não está em um avião!");
  139. return 1;
  140. }
  141. else SendClientMessage(playerid, COR_ERRO, "Você não tem permissão!");
  142. return 1;
  143. }
  144.  
  145. CMD:setprof(playerid, params[])
  146. {
  147. new id, string[500];
  148. new aname[24], pname[24];
  149. GetPlayerName(id, aname, sizeof(aname));
  150. GetPlayerName(playerid, pname, sizeof(pname));
  151. if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COR_ERRO, "| ERRO | Você não está logado na RCON.");
  152. if(sscanf(params, "d", id)) return SendClientMessage(playerid, COR_ERRO, "| ERRO | Uso Correto: /Setprof [id].");
  153. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COR_ERRO, "| ERRO | Player não conectado.");
  154. SendClientFormat(id, Verde, "O(A) admin %s tornou você um(a) piloto(a).", pname);
  155. SendClientFormat(playerid, Azul, "Você setou o(a) %s um(a) piloto(a).", aname);
  156. Prof[id][Profissao] = Piloto;
  157. SetPlayerPos(playerid, 1917.070556, -2645.118408, 13.546875);
  158. SetPlayerColor(id, C_Piloto);
  159. return 1;
  160. }
  161. CMD:jetpack(playerid){ SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK); return 1; }
  162. CMD:piloto(playerid)
  163. {
  164. SetPlayerPos(playerid, 1917.070556, -2645.118408, 13.546875);
  165. return 1;
  166. }
  167.  
  168. stock PlayerToPoint(playerid, Float:radi, Float:x, Float:y, Float:z)
  169. {
  170. if(IsPlayerConnected(playerid))
  171. {
  172. new Float:oldposx, Float:oldposy, Float:oldposz;
  173. new Float:tempposx, Float:tempposy, Float:tempposz;
  174. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  175. tempposx = (oldposx -x);
  176. tempposy = (oldposy -y);
  177. tempposz = (oldposz -z);
  178. if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  179. {
  180. return 1;
  181. }
  182. }
  183. return 0;
  184. }
Advertisement
Add Comment
Please, Sign In to add comment