Guest User

Profissão motorista do correio

a guest
Sep 29th, 2020
1,069
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.14 KB | None | 0 0
  1. #include a_samp
  2. #include zcmd
  3.  
  4. #define Dinheiro_Mi 1500
  5. #define Dinheiro_Max 5500
  6. #define Motorista do Correio 1
  7. #define Vermelho 0xFF0000AA
  8. #define Amarelo 0xFFFF00AA
  9. //--------------------------- Variaveis ------------------------
  10. new Correio;
  11. new Emprego[MAX_PLAYERS];
  12. new Mercadoria[MAX_PLAYERS];
  13. new TempoPickupX[MAX_PLAYERS] = 0;
  14. new Bilhete[MAX_PLAYERS];
  15.  
  16. new Float: EntregaP[4][]=
  17. {
  18. {1298.4347,-800.3129,84.1406},
  19. {2127.6431,2377.9688,10.8203},
  20. {-2720.2776,-318.9388,7.8438},
  21. {1124.3198,-2037.0066,69.8845}
  22. };
  23. //--------------------------- Variaveis ------------------------
  24.  
  25.  
  26. //----------------------------------Publics-------------------------------------------
  27. public OnGameModeInit()
  28. {
  29. AddStaticVehicle(482,95.8216,-172.0899,2.6949,268.5031,6,6); // carro1
  30. AddStaticVehicle(482,116.5521,-150.3481,1.6917,178.9269,6,6); // carro2
  31. AddStaticVehicle(482,110.6535,-150.3582,1.7800,179.9409,6,6); // carro4
  32. Correio = CreatePickup(1239, 23, 92.7077,-164.8840,2.5938); // Pickup Correio
  33. CreatePickup(1210, 23, 1153.9417,-1771.2805,16.5992);
  34. return 1;
  35. }
  36.  
  37.  
  38. public OnPlayerEnterCheckpoint(playerid)
  39. {
  40. new string[150];
  41. DisablePlayerCheckpoint(playerid);
  42. if(IsPlayerInRangeOfPoint(playerid, 3.0, 102.3935,-164.8320,2.3893)) return SendClientMessage(playerid, Amarelo, "Você chegou na Hq do Correio!");
  43. Mercadoria[playerid] = 0;
  44. new Float:Pos[4];
  45. GetPlayerPos(playerid,Pos[0], Pos[1], Pos[2]);
  46. GetPlayerFacingAngle(playerid, Pos[3]);
  47. CreateObject(1221, Pos[0], Pos[1], Pos[2], Pos[3], 0.00, 0.00);
  48. Bilhete[playerid] = 1;
  49. format(string, sizeof(string), "Mercadoria entregue com sucesso, e recebeu um comprovante pra pegar seu dinheiro no Correio!");
  50. SendClientMessage(playerid,0xFFA500AA, string);
  51. return 1;
  52. }
  53.  
  54. public OnPlayerPickUpPickup(playerid, pickupid)
  55. {
  56. if(pickupid == Correio)
  57. {
  58. SendClientMessage(playerid, Amarelo, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Correio ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
  59. SendClientMessage(playerid, -1, "Bem vindo(a) ao correio");
  60. SendClientMessage(playerid, -1, "Aqui você pega suas mercadorias e pega seu dinheiro por entrega!");
  61. SendClientMessage(playerid, -1, "Funciona 24h por dias!");
  62. SendClientMessage(playerid, Amarelo, "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Correio ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
  63. TempoPickupX[playerid] = 30;
  64. }
  65. return 1;
  66. }
  67. public OnPlayerSpawn(playerid)
  68. {
  69. SetPlayerPos(playerid,1152.2280,-1725.6045,13.8887);
  70. return 1;
  71. }
  72. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  73. {
  74. if(dialogid == 1)
  75. {
  76. if(response)
  77. {
  78. SendClientMessage(playerid, Amarelo, "Localização de entrega setada com sucesso!");
  79. }
  80. else
  81. {
  82. DisablePlayerCheckpoint(playerid);
  83. }
  84. }
  85. return 1;
  86. }
  87. public OnPlayerStateChange(playerid, newstate, oldstate)
  88. {
  89. new modelo;
  90. modelo = GetVehicleModel(GetPlayerVehicleID(playerid));
  91. if(modelo == 482)
  92. {
  93. if(Emprego[playerid] <=0)
  94. {
  95. SendClientMessage(playerid, Vermelho, "Você não pode entrar neste veículo");
  96. RemovePlayerFromVehicle(playerid);
  97. return 1;
  98. }
  99. }
  100. return 1;
  101. }
  102. //----------------------------------Publics-------------------------------------------
  103.  
  104.  
  105. //----------------------------------Stock-------------------------------------------
  106. stock randomEspecial(minimo,maximo)
  107. {
  108. new valor = random(maximo-minimo)+minimo;
  109. return valor;
  110. }
  111. //----------------------------------Stock-------------------------------------------
  112.  
  113.  
  114. //------------------------------Comandos-------------------------------------------------
  115. CMD:pegarprof(playerid)
  116. {
  117. if(IsPlayerInRangeOfPoint(playerid, 2.0,1153.9417,-1771.2805,16.5992))
  118. {
  119. Emprego[playerid] = 1;
  120. SetPlayerSkin(playerid, 61);
  121. SetPlayerCheckpoint(playerid, 102.3935,-164.8320,2.3893, 3.0);
  122. SendClientMessage(playerid, Amarelo, "Você pegou a profissão de entregador do Correio, foi marcado no seu mini mapa a localização exata.");
  123. }
  124. else
  125. {
  126. SendClientMessage(playerid, Vermelho, "Você não está na agência de empregos!");
  127. }
  128. return 1;
  129. }
  130. CMD:entregar(playerid)
  131. {
  132. if(!IsPlayerInAnyVehicle(playerid))
  133. return SendClientMessage(playerid, Vermelho, "Você não está Dentro do veiculo do Correio!");
  134. if(Emprego[playerid] <=0) return SendClientMessage(playerid, Vermelho, "Você não trabalha para o Correio!");
  135. if(Mercadoria[playerid] <= 0)
  136. {
  137. SendClientMessage(playerid,Vermelho,"Você não pode entregar algo que não tem!");
  138. return 1;
  139. }
  140. new string[250];
  141. new rand = random(sizeof(EntregaP));
  142. new Float: Distancia = GetPlayerDistanceFromPoint(playerid,EntregaP[rand][0],EntregaP[rand][1],EntregaP[rand][2]);
  143. SetPlayerCheckpoint(playerid, EntregaP[rand][0],EntregaP[rand][1],EntregaP[rand][2],3.0);
  144. format(string,sizeof(string),"{FFFFFF}Você tem um produto pra ser entregue na distância de {30F72D}%0.2f {FFFFFF}metros, siga o checkpoint para entrega-la",Distancia);
  145. ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "{FFA500}Correio", string, "Ir", "Cancelar");
  146. return 1;
  147. }
  148. CMD:pegarmercadorias(playerid, params[])
  149. {
  150. if(Emprego[playerid] <=0) return SendClientMessage(playerid, Vermelho, "Você não trabalha para o Correio!");
  151. if(IsPlayerInRangeOfPoint(playerid, 2.0,92.7077,-164.8840,2.5938))
  152. {
  153. Mercadoria[playerid] = 1;
  154. SendClientMessage(playerid, Amarelo, "Você pegou a caixa com produtos, coloque no veiculo e vá entregar!");
  155. }
  156. else
  157. {
  158. SendClientMessage(playerid, Vermelho, "Você não está no correio!");
  159. }
  160. return 1;
  161. }
  162.  
  163. CMD:pegardinheiro(playerid)
  164. {
  165. if(IsPlayerInRangeOfPoint(playerid, 2.0,92.7077,-164.8840,2.5938))
  166. {
  167. if(Bilhete[playerid] <=0) return SendClientMessage(playerid, Vermelho, "Você não tem bilhete de comprovação!");
  168. GivePlayerMoney(playerid, randomEspecial(Dinheiro_Mi, Dinheiro_Max));
  169. Bilhete[playerid] = 0;
  170. SendClientMessage(playerid, Amarelo, "Você recebeu seu dinheiro!");
  171. }
  172. else
  173. {
  174. SendClientMessage(playerid, Vermelho, "Você não está no correio!");
  175. }
  176. return 1;
  177. }
  178.  
  179. CMD:comandos(playerid)
  180. {
  181. SendClientMessage(playerid, Amarelo,"/pegarmercadorias, /entregar, /pegardinheiro e /pegarprof");
  182. return 1;
  183. }
  184. //------------------------------Comandos-------------------------------------------------
Add Comment
Please, Sign In to add comment