Advertisement
EnzoMetlc

[FS] SA-MP 0.3z.

Jan 16th, 2014
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.31 KB | None | 0 0
  1. #include <a_samp>
  2. #undef MAX_PLAYERS
  3. #define MAX_PLAYERS 5
  4. #include <sscanf2>
  5. #include <ZCMD>
  6.  
  7. new Type[MAX_PLAYERS];
  8.  
  9.  
  10. CMD:arma(playerid, params[])
  11. {
  12. if(sscanf(params, "i", params[0])) return SendClientMessage(playerid, -1, "* /Arma [WeaponID].");
  13. else
  14. {
  15. GivePlayerWeapon(playerid, params[0], 5000);
  16. }
  17. return 1;
  18. }
  19.  
  20.  
  21. CMD:v(playerid, params[])
  22. {
  23. new string[40];
  24. new Version[40];
  25. GetPlayerVersion(playerid, Version, sizeof(Version));
  26. format(string, sizeof(string), "* Versión: {00FFFF}%s{FFFFFF}.", Version);
  27. SendClientMessage(playerid, -1, string);
  28. return 1;
  29. }
  30.  
  31.  
  32. CMD:t(playerid, params[])
  33. {
  34. Type[playerid] = 1;
  35. SendClientMessage(playerid, -1, "* Telenstransportaciones activadas.");
  36. return 1;
  37. }
  38.  
  39.  
  40. CMD:e(playerid, params[])
  41. {
  42. Type[playerid] = 2;
  43. SendClientMessage(playerid, -1, "* Explosiones activadas.");
  44. return 1;
  45. }
  46.  
  47.  
  48. CMD:n(playerid, params[])
  49. {
  50. Type[playerid] = 0;
  51. SendClientMessage(playerid, -1, "* Nada activado.");
  52. return 1;
  53. }
  54.  
  55. public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
  56. {
  57. switch(Type[playerid])
  58. {
  59. case 0:
  60. {
  61. new string[200];
  62. format(string, sizeof(string), "{FF0000}[Arma: %i] - [Cosa: %s] - [Golpeo: %i] - [X: %f, Y: %f, Z: %f].", weaponid, HitType(hittype), hitid, fX, fY, fZ);
  63. SendClientMessage(playerid, -1, string);
  64. }
  65. case 1:
  66. {
  67. new string[200];
  68. new Float:distance = GetPlayerDistanceFromPoint(playerid, fX, fY, fZ);
  69. format(string, sizeof(string), "* Telenstransportado a: {FF0000}X: %f, Y: %f, Z: %f.{FFFFFF} Distancia: {FF0000}%0.2f{FFFFFF}.", fX, fY, fZ, distance);
  70. SendClientMessage(playerid, -1, string);
  71. SetPlayerPos(playerid, fX, fY, fZ+2);
  72. }
  73. case 2:
  74. {
  75. CreateExplosion(fX, fY, fZ, 6, 30.0);
  76. new string[200];
  77. new Float:distance = GetPlayerDistanceFromPoint(playerid, fX, fY, fZ);
  78. format(string, sizeof(string), "* Explosión creada en {FF0000}%f, %f, %f{FFFFFF}. Distancia: {FF0000}%0.2f{FFFFFF}.", fX, fY, fZ, distance);
  79. SendClientMessage(playerid, -1, string);
  80. }
  81. }
  82. return 1;
  83. }
  84.  
  85.  
  86.  
  87. stock HitType(type)
  88. {
  89. new string[10];
  90. switch(type)
  91. {
  92. case 0: string = "Nada";
  93. case 1: string = "Jugador";
  94. case 2: string = "Vehículo";
  95. case 3: string = "Objeto";
  96. }
  97. return string;
  98. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement