Guest User

[FS] Sistema de Veículos Avançado

a guest
Jul 18th, 2011
300
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.44 KB | None | 0 0
  1. /*
  2. CRÉDITOS DO SISTEMA DE SHICKCARD,RYDER E JOSMA_CMD!
  3. WWW.KINGSOFSAMP.COM - VENHA CRESCER CONOSCO!
  4. */
  5.  
  6. #include <a_samp>
  7.  
  8. #define Branco 0xFFFFFFFF
  9. #define vermelho 0xE3191950
  10. #define AdminCor 0xE3191950
  11. #define amarelo 0xF6FF00AA
  12.  
  13. #if defined FILTERSCRIPT
  14.  
  15.  
  16. #if !defined SetSharingData
  17. #define SetSharingData(%0,%1) \
  18. setproperty(0, "", (%0), (%1))
  19. #endif
  20.  
  21.  
  22. public OnFilterScriptInit()
  23. {
  24. print("\n--------------------------------------");
  25. print(" [FS] Sistema de Veículo Avançado");
  26. print("Créditos a: [KoS]Shickcard, Josma_cmd e Ryder'");
  27. print("WWW.KINGSOFSAMP.COM - VENHA CRESCER CONOSCO!");
  28. print("--------------------------------------\n");
  29. return 1;
  30. }
  31.  
  32. #else
  33.  
  34. main()
  35. {
  36. print("\n----------------------------------");
  37. print(" [FS] Sistema de Veículo Avançado");
  38. print("Créditos a: [KoS]Shickcard, Josma_cmd e Ryder'");
  39. print("WWW.KINGSOFSAMP.COM - VENHA CRESCER CONOSCO!");
  40. print("----------------------------------\n");
  41. }
  42.  
  43. #endif
  44.  
  45. public OnPlayerConnect(playerid)
  46. {
  47. SendClientMessage(playerid, Branco, "[FS-SVA] Esse servidor usa o Sistema de Veículo Avançado do [KoS] Shickcard");
  48. return 1;
  49. }
  50.  
  51. public OnPlayerCommandText(playerid, cmdtext[])
  52. {
  53. new tmp[256],cmd[256],idx;
  54. if(strcmp(cmd, "/ComandosSVA", true) == 0)
  55. {
  56. SendClientMessage(playerid, Branco, "/Criarveiculo , /DestruirVeiculo, /VidaVeiculo, /AnguloVeiculo, /PosicaoVeiculo");
  57. SendClientMessage(playerid, Branco, "/VwVeiculo , /VeloVeiculo, /ModeloVeiculo, /StatusVeiculo, /CoresVeiculo");
  58. SendClientMessage(playerid, Branco, "/SetarPaintjob , /InfoVeiculo, /SpecVeiculo, /Creditos, /ComandosSVA");
  59. return 1;
  60. }
  61. if(strcmp(cmd, "/CriarVeiculo", true) == 0)
  62. {
  63. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, AdminCor, "Você não é um administrador para usar este comando");
  64. new modelo, cor1, cor2, string[95];
  65. tmp = strtok(cmdtext, idx);
  66. if(!strlen(tmp))return SendClientMessage(playerid, vermelho, "Uso correto:{FFFFFF} /CriarVeiculo [Modelo] [Cor1] [Cor2]");
  67. modelo = strval(tmp);
  68. tmp = strtok(cmdtext, idx);
  69. if(modelo < 400 || modelo > 611) return SendClientMessage(playerid, Branco, "O modelo não pode ser maior que {E31919}611{FFFFFF} ou menor que {E31919}400");
  70. if(!strlen(tmp)) return SendClientMessage(playerid, vermelho, "Uso correto:{FFFFFF} /CriarVeiculo [Modelo] [Cor1] [Cor2]");
  71. cor1 = strval(tmp);
  72. tmp = strtok(cmdtext, idx);
  73. if(!strlen(tmp)) return SendClientMessage(playerid, vermelho, "Uso correto:{FFFFFF} /CriarVeiculo [Modelo] [Cor1] [Cor2]");
  74. cor2 = strval(tmp);
  75. format(string, sizeof(string), "Você criou um veiculo modelo {E31919}[%d] {E31919}cor {E31919}[%d] {FFFFFF}e {E31919}[%d]", modelo, cor1, cor2);
  76. SendClientMessage(playerid, Branco, string);
  77. new Float:X, Float:Y, Float:Z, Float: angulo;
  78. GetPlayerPos(playerid, X, Y, Z);
  79. GetPlayerFacingAngle(playerid, angulo);
  80. CreateVehicle(modelo, X, Y, Z-1, angulo, cor1, cor2, 25000);
  81. return 1;
  82. }
  83. if(strcmp(cmd, "/DestruirVeiculo", true) == 0)
  84. {
  85. tmp = strtok(cmdtext, idx);
  86. new veiculo,string[33];
  87. if(!strlen(tmp)) return SendClientMessage(playerid, vermelho, "Uso correto:{FFFFFF} /DestruirVeiculo [ID]");
  88. veiculo = strval(tmp);
  89. DestroyVehicle(veiculo);
  90. format(string, sizeof(string), "Você destruiu o veículo [%d]", veiculo);
  91. SendClientMessage(playerid, Branco, string);
  92. return 1;
  93. }
  94. if(strcmp(cmd, "/VidaVeiculo", true) == 0)
  95. {
  96. new Float:health,string[15];
  97. format(string, sizeof(string), "Seu veículo possui [%d] de vida.", health);
  98. SendClientMessage(playerid, Branco, string);
  99. return 1;
  100. }
  101. if(strcmp(cmd, "/AnguloVeiculo", true) == 0)
  102. {
  103. new Float:z_rot,string[50];
  104. format(string, sizeof(string), "Seu veículo possui [%d] de rotação.", z_rot);
  105. SendClientMessage(playerid, Branco, string);
  106. return 1;
  107. }
  108. if(strcmp(cmd, "/PosicaoVeiculo", true) == 0)
  109. {
  110. new Float:vehx,Float:vehy,Float:vehz,string[50];
  111. format(string, sizeof(string), "[X]: %f - [Y]: %f - [Z]: %f.", vehx, vehy, vehz);
  112. SendClientMessage(playerid, Branco, string);
  113. return 1;
  114. }
  115. if(strcmp(cmd, "/VwVeiculo", true) == 0)
  116. {
  117. new veiculo = GetPlayerVehicleID(playerid),string[20];
  118. format(string, sizeof(string), "[Virtual World]: %d", GetVehicleVirtualWorld(veiculo));
  119. SendClientMessage(playerid, Branco, string);
  120. return 1;
  121. }
  122. if(strcmp(cmd, "/VeloVeiculo", true) == 0)
  123. {
  124. new Float:Velocity[3],string[50];
  125. format(string, sizeof(string), "[Velo Veiculo]: X - [%f] || Y - [%f] || [Z] - [%f]", Velocity[0], Velocity[1], Velocity[2]);
  126. SendClientMessage(playerid, Branco, string);
  127. return 1;
  128. }
  129. if(strcmp(cmd, "/ModeloVeiculo", true) == 0)
  130. {
  131. new veiculo = GetPlayerVehicleID(playerid),string[20];
  132. format(string, sizeof(string), "[Modelo Veículo]: [%d]", GetVehicleModel(veiculo));
  133. SendClientMessage(playerid, Branco, string);
  134. return 1;
  135. }
  136. if(strcmp(cmd, "/StatusVeiculo", true) == 0)
  137. {
  138. new panels,doors,lights,tires,string[128];
  139. format(string, sizeof(string), "[Status Veículo]: Paineis - [%d] || Portas - [%d] || Luzes - [%d] || Pneus - [%d]", panels,doors,lights,tires);
  140. SendClientMessage(playerid, Branco, string);
  141. return 1;
  142. }
  143. if(strcmp(cmd, "/CoresVeiculo", true) == 0)
  144. {
  145. new color1,color2,string[30];
  146. format(string, sizeof(string), "[Cores Veículo]: Cor 1 - [%d] || Cor 2 - [%d]", color1, color2);
  147. SendClientMessage(playerid, Branco, string);
  148. return 1;
  149. }
  150. if(strcmp(cmd, "/SetarPaintjob", true) == 0)
  151. {
  152. new veiculo = GetPlayerVehicleID(playerid),paintj,string[45];
  153. tmp = strtok(cmdtext, idx);
  154. if(!strlen(tmp)) return SendClientMessage(playerid, vermelho, "Uso correto:{FFFFFF} /SetarPaintJob [Numero]");
  155. paintj = strval(tmp);
  156. ChangeVehiclePaintjob(veiculo, paintj);
  157. format(string, sizeof(string), "Você setou a paintjob do veículo para: [%d]", paintj);
  158. SendClientMessage(playerid, -1, string);
  159. return 1;
  160. }
  161. if(strcmp(cmd, "/InfoVeiculo", true) == 0)
  162. {
  163. tmp = strtok(cmdtext, idx);
  164. new string[60],panels,doors,lights,tires,color1,color2;
  165. new Float:vehx, Float:vehy, Float:vehz,Float:z_rot,Float:Velocity[3],Float:health;
  166. new veiculo = GetPlayerVehicleID(playerid);
  167. if(!strlen(tmp)) return SendClientMessage(playerid, vermelho, "Uso correto:{FFFFFF} /InfoVeiculo [ID]");
  168. veiculo = strval(tmp);
  169. GetVehicleHealth(veiculo, health);
  170. GetVehicleZAngle(veiculo, z_rot);
  171. GetVehiclePos(veiculo, vehx, vehy, vehz);
  172. GetVehicleVirtualWorld(veiculo);
  173. GetVehicleVelocity(veiculo, Velocity[0], Velocity[1], Velocity[2]);
  174. GetVehicleModel(veiculo);
  175. GetVehicleDamageStatus(veiculo,panels,doors,lights,tires);
  176. GetVehicleColor(veiculo, color1, color2);
  177. format(string, sizeof(string), "[Vida]: %d || [Angulo] [Z] - %f || [Posição]: [X] - %f , [Y] - %f, [Z] - %f || [VW]: %d || [Velo]: [X] - %f, [Y] - %f, [Z] - %f || [Modelo]: %d || Status: [Paineis]: %d - [Portas]: %d - [Luzes]: %d - [Pneus]: %d || [Cor 1]: %d || [Cor 2]: %d", health, z_rot, vehx, vehy, vehz, GetVehicleVirtualWorld(veiculo), Velocity[0], Velocity[1], Velocity[2], GetVehicleModel(veiculo), panels,doors,lights,tires, color1, color2);
  178. SendClientMessage(playerid, Branco, string);
  179. return 1;
  180. }
  181. if(strcmp(cmd, "/SpecVeiculo", true) == 0)
  182. {
  183. tmp = strtok(cmdtext, idx);
  184. new string[60];
  185. new veiculo = GetPlayerVehicleID(playerid);
  186. if(!strlen(tmp)) return SendClientMessage(playerid, vermelho, "Uso correto:{FFFFFF} /SpecVeiculo [ID]");
  187. veiculo = strval(tmp);
  188. PlayerSpectateVehicle(playerid, veiculo);
  189. format(string, sizeof(string), "Você está de spec no veículo modelo [%d]", veiculo);
  190. SendClientMessage(playerid, -1, string);
  191. return 1;
  192. }
  193. if(strcmp(cmd, "/Creditos", true) == 0)
  194. {
  195. SendClientMessage(playerid, AdminCor, ".:: Créditos do Sistema de Veículo Avançado ::.");
  196. SendClientMessage(playerid, AdminCor, "[KoS]Shickcard - Criador do Sistema");
  197. SendClientMessage(playerid, AdminCor, "Ryder' - Getar cor veículo");
  198. SendClientMessage(playerid, AdminCor, "Josma_cmd - Idealizador do Sistema");
  199. SendClientMessage(playerid, Branco, ".:: www.kingsofsamp.com - Acesse agora mesmo e cadastre-se em nossa equipe! ::.");
  200. return 1;
  201. }
  202. return 0;
  203. }
  204.  
  205. #if !defined GetSharingData
  206. #define GetSharingData(%0,%1) \
  207. getproperty(0, "", (%0), (%1))
  208. #endif
  209.  
  210. stock GetVehicleColor(veiculo, &color1, &color2)
  211. {
  212. new
  213. stringData[24],
  214. stringColor[2][12],
  215. i
  216. ;
  217. GetSharingData(veiculo, stringData);
  218.  
  219. if((i = strfind(stringData, "-", true)) != -1)
  220. {
  221. strmid(stringColor[0], stringData, 0, i);
  222. strmid(stringColor[1], stringData, (i + 1), strlen(stringData));
  223.  
  224. color1 = strval(stringColor[0]);
  225. color2 = strval(stringColor[1]);
  226. return 1;
  227. }
  228. return 0;
  229. }
  230.  
  231. strtok(const string[], &index)
  232. {
  233. new length = strlen(string);
  234. while ((index < length) && (string[index] <= ' '))
  235. {
  236. index++;
  237. }
  238.  
  239. new offset = index;
  240. new result[20];
  241. while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  242. {
  243. result[index - offset] = string[index];
  244. index++;
  245. }
  246. result[index - offset] = EOS;
  247. return result;
  248. }
  249.  
  250. /*
  251. CRÉDITOS DO SISTEMA DE SHICKCARD,RYDER E JOSMA_CMD!
  252. WWW.KINGSOFSAMP.COM - VENHA CRESCER CONOSCO!
  253. */
Advertisement
Add Comment
Please, Sign In to add comment