Guest User

Profissao

a guest
Mar 2nd, 2017
639
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.81 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 C_Caminhao[8];
  15. new T_Caminhao[8];
  16. new Prof[MAX_PLAYERS][pProf];
  17. new respawntrailer;
  18. new carregado[MAX_PLAYERS] = 0;
  19. /*Profissao*/
  20. #define Caminhoneiro 0
  21. #define C_Caminhoneiro 0x089226FF
  22. /*DIALOGS*/
  23. #define DIALOG_CAMINHAO 22
  24. /*CORES*/
  25. #define COR_ERRO 0xFF0000FF
  26. #define Verde 0x31E045FF
  27. #define Azul 0x0091FFFF
  28. #if defined FILTERSCRIPT
  29.  
  30. public OnFilterScriptInit()
  31. {
  32. /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
  33. print("\n--------------------------------------");
  34. print(" Criado por: SmokiieGamer");
  35. print(" http://forum.sa-mp.com/member.php?u=282148 ");
  36. print("--------------------------------------\n");
  37. return 1;
  38. }
  39.  
  40. public OnFilterScriptExit()
  41. {
  42. return 1;
  43. }
  44.  
  45. #else
  46.  
  47. main()
  48. {
  49. print("\n----------------------------------");
  50. print(" Blank Gamemode by your name here");
  51. print("----------------------------------\n");
  52. }
  53.  
  54. #endif
  55.  
  56. public OnPlayerConnect(playerid)
  57. {
  58. /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
  59. RemoveBuildingForPlayer(playerid, 8118, 1343.6875, 1130.3906, 13.5313, 0.25);
  60. RemoveBuildingForPlayer(playerid, 1331, 1303.2188, 1102.7188, 10.6250, 0.25);
  61. RemoveBuildingForPlayer(playerid, 1338, 1303.2344, 1107.8906, 10.4922, 0.25);
  62. RemoveBuildingForPlayer(playerid, 1438, 1384.8828, 1101.3750, 9.8125, 0.25);
  63. RemoveBuildingForPlayer(playerid, 1420, 1384.0391, 1111.6250, 9.8203, 0.25);
  64. RemoveBuildingForPlayer(playerid, 1219, 1312.8906, 1128.3594, 10.0625, 0.25);
  65. RemoveBuildingForPlayer(playerid, 1420, 1384.0391, 1125.2891, 9.8203, 0.25);
  66. RemoveBuildingForPlayer(playerid, 1219, 1312.8906, 1134.0781, 10.0625, 0.25);
  67. RemoveBuildingForPlayer(playerid, 1219, 1312.8906, 1136.8984, 10.0625, 0.25);
  68. RemoveBuildingForPlayer(playerid, 1219, 1312.8906, 1131.1719, 10.0625, 0.25);
  69. RemoveBuildingForPlayer(playerid, 8065, 1343.6875, 1130.3906, 13.5313, 0.25);
  70. RemoveBuildingForPlayer(playerid, 1616, 1319.6719, 1152.8594, 14.8047, 0.25);
  71. RemoveBuildingForPlayer(playerid, 640, 1356.6484, 1152.9453, 10.5156, 0.25);
  72. RemoveBuildingForPlayer(playerid, 640, 1336.8672, 1158.6484, 10.5156, 0.25);
  73. RemoveBuildingForPlayer(playerid, 1420, 1384.0391, 1138.7891, 9.8203, 0.25);
  74. RemoveBuildingForPlayer(playerid, 1420, 1384.0391, 1151.9688, 9.8203, 0.25);
  75. RemoveBuildingForPlayer(playerid, 640, 1348.5547, 1163.9063, 10.5156, 0.25);
  76. RemoveBuildingForPlayer(playerid, 1334, 1338.8047, 1164.1563, 10.9297, 0.25);
  77. /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
  78. SetPlayerColor(playerid, 0xFFFFFFFF);
  79. /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
  80. C_Caminhao[0] = CreateVehicle(403, 1419.5896, 973.8277, 11.1205, 0.0000, -1, -1, 100);
  81. C_Caminhao[1] = CreateVehicle(403, 1414.6193, 973.9520, 11.1205, 0.0000, -1, -1, 100);
  82. C_Caminhao[2] = CreateVehicle(403, 1408.9634, 974.0184, 11.1205, 0.0000, -1, -1, 100);
  83. C_Caminhao[3] = CreateVehicle(403, 1404.2325, 974.1080, 11.1205, 0.0000, -1, -1, 100);
  84. C_Caminhao[4] = CreateVehicle(403, 1430.1726, 974.4286, 11.1205, 0.0000, -1, -1, 100);
  85. C_Caminhao[5] = CreateVehicle(403, 1435.1686, 974.4653, 11.1205, 0.0000, -1, -1, 100);
  86. C_Caminhao[6] = CreateVehicle(403, 1447.0651, 974.4630, 11.1205, 0.0000, -1, -1, 100);
  87. C_Caminhao[7] = CreateVehicle(403, 1441.2657, 974.7684, 11.1205, 0.0000, -1, -1, 100);
  88. /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
  89. T_Caminhao[0] = CreateVehicle(435, 1425.9762, 1024.6429, 11.1868, 90.0000, -1, -1, 100);
  90. T_Caminhao[1] = CreateVehicle(435, 1426.1826, 1018.0960, 11.1868, 90.0000, -1, -1, 100);
  91. T_Caminhao[2] = CreateVehicle(435, 1425.7996, 1044.3285, 11.1868, 90.0000, -1, -1, 100);
  92. T_Caminhao[3] = CreateVehicle(435, 1425.7688, 1050.0950, 11.1868, 90.0000, -1, -1, 100);
  93. T_Caminhao[4] = CreateVehicle(435, 1425.6958, 1055.3429, 11.1868, 90.0000, -1, -1, 100);
  94. T_Caminhao[5] = CreateVehicle(435, 1425.6078, 1060.7788, 11.1868, 90.0000, -1, -1, 100);
  95. T_Caminhao[6] = CreateVehicle(435, 1425.4144, 1071.6368, 11.1868, 90.0000, -1, -1, 100);
  96. T_Caminhao[7] = CreateVehicle(435, 1425.0706, 1081.7444, 11.1868, 90.0000, -1, -1, 100);
  97. /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
  98. CreateObject(3578, 1376.72400, 1095.58923, 10.42170, 0.00000, 0.00000, 89.00000);
  99. CreateObject(3578, 1376.98645, 1107.28748, 10.42170, 0.00000, 0.00000, 89.00000);
  100. CreateObject(3578, 1377.21985, 1118.91296, 10.42170, 0.00000, 0.00000, 89.00000);
  101. CreateObject(3578, 1377.46350, 1130.87292, 10.42170, 0.00000, 0.00000, 89.00000);
  102. CreateObject(3578, 1377.69263, 1142.42480, 10.42170, 0.00000, 0.00000, 89.00000);
  103. CreateObject(3578, 1364.22681, 1095.81897, 10.42170, 0.00000, 0.00000, 89.00000);
  104. CreateObject(3578, 1364.39746, 1107.87024, 10.42170, 0.00000, 0.00000, 89.00000);
  105. CreateObject(3578, 1364.53650, 1119.40710, 10.42170, 0.00000, 0.00000, 89.00000);
  106. CreateObject(3578, 1364.58936, 1131.00867, 10.42170, 0.00000, 0.00000, 89.00000);
  107. CreateObject(3578, 1364.81384, 1143.00842, 10.42170, 0.00000, 0.00000, 89.00000);
  108. /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
  109. Create3DTextLabel("Carregue\n{FF0000}Aqui !", 0xFFFFFFFF, 1370.212524, 1090.768676, 10.812978, 40.0, 0, 0);
  110. Create3DTextLabel("Descarregue\n{FF0000}Aqui !", 0xFFFFFFF, 1196.043090, -888.458740, 43.040676, 40, 0,0);
  111. return 1;
  112. }
  113.  
  114. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  115. {
  116. if(dialogid == DIALOG_CAMINHAO)
  117. {
  118. if(response)
  119. {
  120. switch(listitem)
  121. {
  122. case 0:
  123. {
  124. DisablePlayerCheckpoint(playerid);
  125. SetPlayerCheckpoint(playerid, 1196.043090, -888.458740, 43.040676, 0.0);
  126. carregado[playerid] = 1;
  127. SendClientMessage(playerid, Verde, "| CARREGAMENTO | Foi marcado um ponto vermelho no seu mapa. Siga-o para descarregar !");
  128. return 1;
  129. } // CASE QUISER FAZER OUTROS CARREGAMENTOS, FASSA IGUAL AO DE CIMA.
  130. }
  131. }
  132. }
  133. return 1;
  134. }
  135.  
  136. CMD:carregar(playerid)
  137. {
  138. if(Prof[playerid][Profissao] == Caminhoneiro)
  139. {
  140. if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  141. {
  142. if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 403)
  143. {
  144. if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
  145. {
  146. if(PlayerToPoint(playerid, 30.0, 1370.212524, 1090.768676, 10.812978))
  147. {
  148. if(carregado[playerid] == 0)
  149. {
  150. new StringCat[700];
  151. strcat(StringCat, "{FFFFFF}BurgerShot LS {D2691E}» {00FF00}R$800\n");
  152. ShowPlayerDialog(playerid, DIALOG_CAMINHAO, DIALOG_STYLE_LIST, "{FFFFFF}Carregamento", StringCat, "{FFFFFF}Carregar", "{FFFFFF}Cancelar");
  153. carregado[playerid] = 1;
  154. return 1;
  155. }
  156. else SendClientMessage(playerid, COR_ERRO, "Seu caminhão já está carregado!");
  157. return 1;
  158. }
  159. else SendClientMessage(playerid, COR_ERRO, "Você não está na Área de Carregamento!");
  160. return 1;
  161. }
  162. else SendClientMessage(playerid, COR_ERRO, "Você não pussui uma carga!");
  163. return 1;
  164. }
  165. else SendClientMessage(playerid, COR_ERRO, "Você não está em um Caminhão!");
  166. return 1;
  167. }
  168. else SendClientMessage(playerid, COR_ERRO, "Você não está dirigindo um veiculo!");
  169. return 1;
  170. }
  171. else SendClientMessage(playerid, COR_ERRO, "Você não tem permissão!");
  172. return 1;
  173. }
  174.  
  175. CMD:descarregar(playerid)
  176. {
  177. if(Prof[playerid][Profissao] == Caminhoneiro)
  178. {
  179. if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 403)
  180. {
  181. if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
  182. {
  183. if(carregado[playerid] == 0)
  184. {
  185. SendClientMessage(playerid, COR_ERRO, "O seu caminhão não está carregado!");
  186. return 1;
  187. }
  188. if(carregado[playerid] == 1)
  189. {
  190. if(PlayerToPoint(playerid, 10.0, 1196.043090, -888.458740, 43.040676))
  191. carregado[playerid] = 0;
  192. DisablePlayerCheckpoint(playerid);
  193. SendClientMessage(playerid, Verde, "Você descarregou o seu caminhão e ganhou R$800");
  194. GivePlayerMoney(playerid, 800);
  195. respawntrailer = (GetVehicleTrailer(GetPlayerVehicleID(playerid)));
  196. SetVehicleToRespawn(respawntrailer);
  197. return 1;
  198. }
  199. else SendClientMessage(playerid, COR_ERRO, "Você não está na área de descarregamento!");
  200. return 1;
  201. }
  202. else SendClientMessage(playerid, COR_ERRO, "Você não pussui uma carga!");
  203. return 1;
  204. }
  205. else SendClientMessage(playerid, COR_ERRO, "Você não esá em um veiculo!");
  206. return 1;
  207. }
  208. else SendClientMessage(playerid, COR_ERRO, "Você não tem permissão!");
  209. return 1;
  210. }
  211.  
  212. CMD:setprof(playerid, params[])
  213. {
  214. new id, string[500];
  215. new aname[24], pname[24];
  216. GetPlayerName(id, aname, sizeof(aname));
  217. GetPlayerName(playerid, pname, sizeof(pname));
  218. if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COR_ERRO, "| ERRO | Você não está logado na RCON.");
  219. if(sscanf(params, "d", id)) return SendClientMessage(playerid, COR_ERRO, "| ERRO | Uso Correto: /Setprof [id].");
  220. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COR_ERRO, "| ERRO | Player não conectado.");
  221. SendClientFormat(id, Verde, "O(A) admin %s tornou você um(a) caminhoneiro(a).", pname);
  222. SendClientFormat(playerid, Azul, "Você setou o(a) %s um(a) caminhoneiro(a).", aname);
  223. Prof[id][Profissao] = Caminhoneiro;
  224. SetPlayerPos(playerid, 1380.579589, 1021.882324, 10.820312);
  225. SetPlayerColor(id, C_Caminhoneiro);
  226. return 1;
  227. }
  228. CMD:jetpack(playerid){ SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK); return 1; }
  229. CMD:caminhao(playerid)
  230. {
  231. SetPlayerPos(playerid, 1380.579589, 1021.882324, 10.820312);
  232. return 1;
  233. }
  234.  
  235. stock PlayerToPoint(playerid, Float:radi, Float:x, Float:y, Float:z)
  236. {
  237. if(IsPlayerConnected(playerid))
  238. {
  239. new Float:oldposx, Float:oldposy, Float:oldposz;
  240. new Float:tempposx, Float:tempposy, Float:tempposz;
  241. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  242. tempposx = (oldposx -x);
  243. tempposy = (oldposy -y);
  244. tempposz = (oldposz -z);
  245. if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  246. {
  247. return 1;
  248. }
  249. }
  250. return 0;
  251. }
Advertisement
Add Comment
Please, Sign In to add comment