Advertisement
Gamer_Z

Untitled

Oct 31st, 2011
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.92 KB | None | 0 0
  1.  
  2. #if defined UZYJ_KATANA
  3. stock HCPWK(playerid){
  4. #if defined SD
  5. printf("#0173#");
  6. #endif
  7. new damage,tempdamage;
  8. for(new i = 0; i < MAX_PLAYERS; i++){
  9. if(IsPlayerConnected(i) && i != playerid && KatanaMoc[playerid] != 0 && KatOmin[playerid][i] == 0){
  10. if(GetDistanceBetweenPlayers(playerid, i) <= KatanaDistance[playerid] && !IsPlayerInAnyVehicle(playerid) && !IsZW[i] && (GetPlayerState(i) != PLAYER_STATE_SPECTATING)){
  11. if(!IsPlayerInAnyVehicle(i)){
  12. TurnPlayerFaceToPlayer2(playerid, i);
  13. new Float:h;
  14. GetPlayerHealth(i, h);
  15. tempdamage = GetPlayerLevel(playerid)/250;
  16. damage = tempdamage*KatanaMoc[playerid];
  17. if(Attacked[playerid] == 0){
  18. if(damage >= h){
  19. Attacked[playerid] = 1;
  20. OnPlayerDeath(i,playerid,8);
  21. SetPlayerHealth(i,0);
  22. }else
  23. if(damage < h){
  24. SetPlayerHealth(i, h-damage);
  25. Attacked[playerid] = 1;
  26. }
  27. if(KatanaBomba[playerid] == 1){
  28. new Float:explozjaX,Float:explozjaY,Float:explozjaZ;
  29. GetPlayerPos(i,explozjaX,explozjaY,explozjaZ);
  30. CreateExplosion(explozjaX, explozjaY, explozjaZ, 6, 3);
  31. CreateExplosion(explozjaX, explozjaY, explozjaZ+1, 6, 3);
  32. CreateExplosion(explozjaX, explozjaY, explozjaZ+2, 6, 3);
  33. CreateExplosion(explozjaX+1, explozjaY, explozjaZ, 6, 3);
  34. CreateExplosion(explozjaX, explozjaY+1, explozjaZ, 6, 3);
  35. CreateExplosion(explozjaX, explozjaY+2, explozjaZ, 6, 3);
  36. CreateExplosion(explozjaX+1, explozjaY+1, explozjaZ, 6, 3);
  37. CreateExplosion(explozjaX-2, explozjaY-1, explozjaZ, 6, 3);
  38. CreateExplosion(explozjaX, explozjaY+3, explozjaZ, 6, 3);
  39. CreateExplosion(explozjaX+1, explozjaY+1, explozjaZ+1, 6, 3);
  40. }
  41. }
  42. }else
  43. if(IsPlayerInAnyVehicle(i)){
  44. TurnPlayerFaceToPlayer2(playerid, i);
  45. new Float:h,vehidk,randomval;
  46. randomval = random(21);
  47. vehidk = GetPlayerVehicleID(i);
  48. GetVehicleHealth(vehidk, h);
  49. tempdamage = GetPlayerLevel(playerid)/5;
  50. damage = tempdamage*KatanaMoc[playerid];
  51. if(!IsSamolot(vehidk)){
  52. new Float:uderzenie;
  53. uderzenie = 0.12*KatanaMoc[playerid];
  54. if(randomval == 0)SetVehicleVelocity(vehidk, 0.0, uderzenie, 0.2);else
  55. if(randomval == 1)SetVehicleVelocity(vehidk, 0.0, uderzenie, 0.0);else
  56. if(randomval == 2)SetVehicleVelocity(vehidk, uderzenie, 0.0, 0.0);else
  57. if(randomval == 3)SetVehicleVelocity(vehidk, 0.0, uderzenie, 0.1);else
  58. if(randomval == 4)SetVehicleVelocity(vehidk, uderzenie, uderzenie, 0.0);else
  59. if(randomval == 5)SetVehicleVelocity(vehidk, uderzenie, 0.0, 0.1);else
  60. if(randomval == 6)SetVehicleVelocity(vehidk, uderzenie, uderzenie, 0.1);else
  61.  
  62. if(randomval == 7)SetVehicleVelocity(vehidk, 0.0, 0.0, -0.1);else
  63. if(randomval == 8)SetVehicleVelocity(vehidk, 0.0, 0-uderzenie, 0.0);else
  64. if(randomval == 9)SetVehicleVelocity(vehidk, 0-uderzenie, 0.0, 0.0);else
  65. if(randomval == 10)SetVehicleVelocity(vehidk, 0.0, 0-uderzenie, -0.1);else
  66. if(randomval == 11)SetVehicleVelocity(vehidk, 0-uderzenie, 0-uderzenie, 0.0);else
  67. if(randomval == 12)SetVehicleVelocity(vehidk, 0-uderzenie, 0.0, -0.2);else
  68. if(randomval == 13)SetVehicleVelocity(vehidk, 0-uderzenie, 0-uderzenie, -0.2);else
  69.  
  70. if(randomval == 14)SetVehicleVelocity(vehidk, 0.0, 0-uderzenie, 0.1);else
  71. if(randomval == 15)SetVehicleVelocity(vehidk, uderzenie, 0-uderzenie, 0.0);else
  72. if(randomval == 16)SetVehicleVelocity(vehidk, 0-uderzenie, 0.0, 0.1);else
  73. if(randomval == 17)SetVehicleVelocity(vehidk, 0.0, 0-uderzenie, 0.0);else
  74. if(randomval == 18)SetVehicleVelocity(vehidk, 0-uderzenie, uderzenie, 0.0);else
  75. if(randomval == 19)SetVehicleVelocity(vehidk, uderzenie, 0.0, -0.2);else
  76. if(randomval == 20)SetVehicleVelocity(vehidk, 0-uderzenie, uderzenie, -0.3);
  77. }else if(IsSamolot(vehidk)){
  78. new Float:VehVX,Float:VehVY,Float:VehVZ;
  79. GetVehicleVelocity(vehidk,VehVX,VehVY,VehVZ);
  80. SetVehicleVelocity(vehidk,VehVX,VehVY,VehVZ-0.17*KatanaMoc[playerid]);
  81. }
  82.  
  83. if(damage >= h && Attacked[playerid] == 0){
  84. Attacked[playerid] = 1;
  85. SetVehicleHealth(vehidk,0);
  86. }else
  87. if(damage < h && Attacked[playerid] == 0){
  88. SetVehicleHealth(i, h-damage);
  89. Attacked[playerid] = 1;
  90. }
  91. }
  92. }
  93. }
  94. }
  95. #if defined SD
  96. printf("#0174#");
  97. #endif
  98. return 1;
  99. }
  100.  
  101. stock TurnPlayerFaceToPlayer2(playerid, facingtoid)
  102. {
  103. #if defined SD
  104. printf("#0175#");
  105. #endif
  106. new Float:angle;
  107. new Float:misc = 5.0;
  108. new Float:x, Float:y, Float:z;
  109. new Float:ix, Float:iy, Float:iz;
  110. GetPlayerPos(facingtoid, x, y, z);
  111. GetPlayerPos(playerid, ix, iy, iz);
  112. angle = 180.0-atan2(ix-x,iy-y);
  113. angle += misc;
  114. misc *= -1;
  115. SetPlayerFacingAngle(playerid, angle+misc);
  116. #if defined SD
  117. printf("#0176#");
  118. #endif
  119. }
  120. #endif
  121.  
  122.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement