Advertisement
Guest User

Untitled

a guest
Nov 17th, 2012
2,668
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.17 KB | None | 0 0
  1. //sistema de elevador
  2. #include <a_samp>
  3.  
  4.  
  5. #define ElevadorAptos 1
  6. new ElevadorApartamentos;
  7. forward ElevadorApartamentosAndando();
  8. public ElevadorApartamentosAndando()
  9. {
  10. MoveObject(ElevadorApartamentos,1786.62,-1303.28,14.54, 2);
  11. return true;
  12. }
  13. forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
  14. public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
  15. {
  16. if(IsPlayerConnected(playerid))
  17. {
  18. new Float:oldposx, Float:oldposy, Float:oldposz;
  19. new Float:tempposx, Float:tempposy, Float:tempposz;
  20. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  21. tempposx = (oldposx -x);
  22. tempposy = (oldposy -y);
  23. tempposz = (oldposz -z);
  24. //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
  25. if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  26. {
  27. return true;
  28. }
  29. }
  30. return 0;
  31. }
  32.  
  33. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  34. {
  35. if (dialogid == ElevadorAptos)
  36. {
  37. if (response)
  38. {
  39. if (listitem == 0)
  40. {
  41. MoveObject( ElevadorApartamentos, 1786.62, -1303.28, 14.54,3);
  42. }
  43. if (listitem == 1)
  44. {
  45. MoveObject( ElevadorApartamentos, 1786.67, -1303.31, 23.22,3);
  46. }
  47. if (listitem == 2)
  48. {
  49. MoveObject( ElevadorApartamentos, 1786.67, -1303.31, 28.62,3);
  50. }
  51. if (listitem == 3)
  52. {
  53. MoveObject( ElevadorApartamentos, 1786.67, -1303.31, 34.07,3);
  54. }
  55. if (listitem == 4)
  56. {
  57. MoveObject( ElevadorApartamentos, 1786.67, -1303.31, 39.49,3);
  58. }
  59. if (listitem == 5)
  60. {
  61. MoveObject( ElevadorApartamentos, 1786.67, -1303.31, 44.97,3);
  62. }
  63. if (listitem == 6)
  64. {
  65. MoveObject( ElevadorApartamentos, 1786.67, -1303.31, 50.36,3);
  66. }
  67. if (listitem == 7)
  68. {
  69. MoveObject( ElevadorApartamentos, 1786.67, -1303.31, 55.85,3);
  70. }
  71. if (listitem == 8)
  72. {
  73. MoveObject( ElevadorApartamentos, 1786.67, -1303.31, 61.33,3);
  74. }
  75. if (listitem == 9)
  76. {
  77. MoveObject( ElevadorApartamentos, 1786.67, -1303.31, 66.78,3);
  78. }
  79. if (listitem == 10)
  80. {
  81. MoveObject( ElevadorApartamentos, 1786.67, -1303.31, 72.20,3);
  82. }
  83. if (listitem == 11)
  84. {
  85. MoveObject( ElevadorApartamentos, 1786.67, -1303.31, 77.65,3);
  86. }
  87. if (listitem == 12)
  88. {
  89. MoveObject( ElevadorApartamentos, 1786.67, -1303.31, 83.09,3);
  90. }
  91. if (listitem == 13)
  92. {
  93. MoveObject( ElevadorApartamentos, 1786.67, -1303.31, 88.54,3);
  94. }
  95. if (listitem == 14)
  96. {
  97. MoveObject( ElevadorApartamentos, 1786.67, -1303.31, 93.96,3);
  98. }
  99. if (listitem == 15)
  100. {
  101. MoveObject( ElevadorApartamentos, 1786.67, -1303.31, 99.51,3);
  102. }
  103. if (listitem == 16)
  104. {
  105. MoveObject( ElevadorApartamentos, 1786.67, -1303.31, 104.81,3);
  106. }
  107. if (listitem == 17)
  108. {
  109. MoveObject( ElevadorApartamentos, 1786.67, -1303.31, 110.31,3);
  110. }
  111. if (listitem == 18)
  112. {
  113. MoveObject( ElevadorApartamentos, 1786.67, -1303.31, 115.79,3);
  114. }
  115. if (listitem == 19)
  116. {
  117. MoveObject( ElevadorApartamentos, 1786.67, -1303.31, 121.18,3);
  118. }
  119. }
  120. else
  121. {
  122. }
  123. }
  124. }
  125. public OnFilterScriptInit()
  126. {
  127. print("\nFilterScript de elevador carregado");
  128. print(">>>> Créditos a Vinicius (Não retire os creditos)<<<<\n");
  129. ElevadorApartamentos = CreateObject(18755, 1786.62, -1303.28, 14.54, 0.00, 0.00, 270.35);
  130. return 1;
  131. }
  132. public OnFilterScriptExit()
  133. {
  134. return 1;
  135. }
  136. public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
  137. {
  138. if(newkeys == 16 && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
  139. {
  140. OnPlayerCommandText(playerid,"/elevador");
  141. }
  142. return true;
  143. }
  144. public OnPlayerCommandText(playerid, cmdtext[])
  145. {
  146. new cmd[128];
  147. if (strcmp(cmd, "/apartamentos", true) == 0)
  148. {
  149. SetPlayerPos(playerid, 1788.8251,-1292.3501,13.6023);
  150. return true;
  151. }
  152. if (strcmp(cmd, "/elevador", true) == 0)
  153. {
  154. if(IsPlayerConnected(playerid))
  155. {
  156. if(PlayerToPoint(1.5,playerid, 1785.3308,-1302.5597,13.5789) || PlayerToPoint(1.5,playerid, 1785.1156,-1302.5652,120.3800) || PlayerToPoint(1.5,playerid, 1785.1299,-1302.8934,22.4200) || PlayerToPoint(1.5,playerid, 1785.1149,-1302.1145,27.8200) || PlayerToPoint(1.5,playerid, 1785.1139,-1302.2268,38.6900) || PlayerToPoint(1.5,playerid, 1785.1130,-1302.0863,44.1700) || PlayerToPoint(1.5,playerid, 1785.1128,-1302.0325,49.5600) ||
  157. PlayerToPoint(1.5,playerid, 1785.1123,-1301.9784,55.0500) || PlayerToPoint(1.5,playerid, 1785.1178,-1302.9601,60.5300) || PlayerToPoint(1.5,playerid, 1785.1176,-1302.6318,65.9800) || PlayerToPoint(1.5,playerid, 1785.1169,-1302.6899,71.4000) || PlayerToPoint(1.5,playerid, 1785.1168,-1302.6820,76.8500) || PlayerToPoint(1.5,playerid, 1785.1189,-1302.8367,82.2900) || PlayerToPoint(1.5,playerid, 1785.1213,-1303.3326,87.7400) ||
  158. PlayerToPoint(1.5,playerid, 1785.0488,-1301.9581,99.9473) || PlayerToPoint(1.5,playerid, 1786.67, -1303.31, 104.81) || PlayerToPoint(1.5,playerid, 1786.67, -1303.31, 110.31) || PlayerToPoint(1.5,playerid, 1786.4457,-1303.0217,93.1600) || PlayerToPoint(1.5,playerid, 1786.67, -1303.31, 110.31) || PlayerToPoint(1.5,playerid, 1786.67, -1303.31, 115.79) || PlayerToPoint(1.5,playerid, 1785.1173,-1302.5492,33.2700))
  159. {
  160. ShowPlayerDialog(playerid,ElevadorAptos,DIALOG_STYLE_LIST,"Elevador","Térreo\n1º Andar\n2º Andar\n3º Andar\n4º Andar\n5º Andar\n6º Andar\n7º Andar\n8º Andar\n9ºAndar\n10º Andar\n11º Andar\n12º Andar\n13º Andar\n14º Andar\n15º Andar\n16º Andar\n17º Andar\n18º Andar\nUltimo Andar","Ir","Cancelar");
  161. }
  162. }
  163. return true;
  164. }
  165. return 1;
  166. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement