Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #if defined UZYJ_KATANA
- stock HCPWK(playerid){
- #if defined SD
- printf("#0173#");
- #endif
- new damage,tempdamage;
- for(new i = 0; i < MAX_PLAYERS; i++){
- if(IsPlayerConnected(i) && i != playerid && KatanaMoc[playerid] != 0 && KatOmin[playerid][i] == 0){
- if(GetDistanceBetweenPlayers(playerid, i) <= KatanaDistance[playerid] && !IsPlayerInAnyVehicle(playerid) && !IsZW[i] && (GetPlayerState(i) != PLAYER_STATE_SPECTATING)){
- if(!IsPlayerInAnyVehicle(i)){
- TurnPlayerFaceToPlayer2(playerid, i);
- new Float:h;
- GetPlayerHealth(i, h);
- tempdamage = GetPlayerLevel(playerid)/250;
- damage = tempdamage*KatanaMoc[playerid];
- if(Attacked[playerid] == 0){
- if(damage >= h){
- Attacked[playerid] = 1;
- OnPlayerDeath(i,playerid,8);
- SetPlayerHealth(i,0);
- }else
- if(damage < h){
- SetPlayerHealth(i, h-damage);
- Attacked[playerid] = 1;
- }
- if(KatanaBomba[playerid] == 1){
- new Float:explozjaX,Float:explozjaY,Float:explozjaZ;
- GetPlayerPos(i,explozjaX,explozjaY,explozjaZ);
- CreateExplosion(explozjaX, explozjaY, explozjaZ, 6, 3);
- CreateExplosion(explozjaX, explozjaY, explozjaZ+1, 6, 3);
- CreateExplosion(explozjaX, explozjaY, explozjaZ+2, 6, 3);
- CreateExplosion(explozjaX+1, explozjaY, explozjaZ, 6, 3);
- CreateExplosion(explozjaX, explozjaY+1, explozjaZ, 6, 3);
- CreateExplosion(explozjaX, explozjaY+2, explozjaZ, 6, 3);
- CreateExplosion(explozjaX+1, explozjaY+1, explozjaZ, 6, 3);
- CreateExplosion(explozjaX-2, explozjaY-1, explozjaZ, 6, 3);
- CreateExplosion(explozjaX, explozjaY+3, explozjaZ, 6, 3);
- CreateExplosion(explozjaX+1, explozjaY+1, explozjaZ+1, 6, 3);
- }
- }
- }else
- if(IsPlayerInAnyVehicle(i)){
- TurnPlayerFaceToPlayer2(playerid, i);
- new Float:h,vehidk,randomval;
- randomval = random(21);
- vehidk = GetPlayerVehicleID(i);
- GetVehicleHealth(vehidk, h);
- tempdamage = GetPlayerLevel(playerid)/5;
- damage = tempdamage*KatanaMoc[playerid];
- if(!IsSamolot(vehidk)){
- new Float:uderzenie;
- uderzenie = 0.12*KatanaMoc[playerid];
- if(randomval == 0)SetVehicleVelocity(vehidk, 0.0, uderzenie, 0.2);else
- if(randomval == 1)SetVehicleVelocity(vehidk, 0.0, uderzenie, 0.0);else
- if(randomval == 2)SetVehicleVelocity(vehidk, uderzenie, 0.0, 0.0);else
- if(randomval == 3)SetVehicleVelocity(vehidk, 0.0, uderzenie, 0.1);else
- if(randomval == 4)SetVehicleVelocity(vehidk, uderzenie, uderzenie, 0.0);else
- if(randomval == 5)SetVehicleVelocity(vehidk, uderzenie, 0.0, 0.1);else
- if(randomval == 6)SetVehicleVelocity(vehidk, uderzenie, uderzenie, 0.1);else
- if(randomval == 7)SetVehicleVelocity(vehidk, 0.0, 0.0, -0.1);else
- if(randomval == 8)SetVehicleVelocity(vehidk, 0.0, 0-uderzenie, 0.0);else
- if(randomval == 9)SetVehicleVelocity(vehidk, 0-uderzenie, 0.0, 0.0);else
- if(randomval == 10)SetVehicleVelocity(vehidk, 0.0, 0-uderzenie, -0.1);else
- if(randomval == 11)SetVehicleVelocity(vehidk, 0-uderzenie, 0-uderzenie, 0.0);else
- if(randomval == 12)SetVehicleVelocity(vehidk, 0-uderzenie, 0.0, -0.2);else
- if(randomval == 13)SetVehicleVelocity(vehidk, 0-uderzenie, 0-uderzenie, -0.2);else
- if(randomval == 14)SetVehicleVelocity(vehidk, 0.0, 0-uderzenie, 0.1);else
- if(randomval == 15)SetVehicleVelocity(vehidk, uderzenie, 0-uderzenie, 0.0);else
- if(randomval == 16)SetVehicleVelocity(vehidk, 0-uderzenie, 0.0, 0.1);else
- if(randomval == 17)SetVehicleVelocity(vehidk, 0.0, 0-uderzenie, 0.0);else
- if(randomval == 18)SetVehicleVelocity(vehidk, 0-uderzenie, uderzenie, 0.0);else
- if(randomval == 19)SetVehicleVelocity(vehidk, uderzenie, 0.0, -0.2);else
- if(randomval == 20)SetVehicleVelocity(vehidk, 0-uderzenie, uderzenie, -0.3);
- }else if(IsSamolot(vehidk)){
- new Float:VehVX,Float:VehVY,Float:VehVZ;
- GetVehicleVelocity(vehidk,VehVX,VehVY,VehVZ);
- SetVehicleVelocity(vehidk,VehVX,VehVY,VehVZ-0.17*KatanaMoc[playerid]);
- }
- if(damage >= h && Attacked[playerid] == 0){
- Attacked[playerid] = 1;
- SetVehicleHealth(vehidk,0);
- }else
- if(damage < h && Attacked[playerid] == 0){
- SetVehicleHealth(i, h-damage);
- Attacked[playerid] = 1;
- }
- }
- }
- }
- }
- #if defined SD
- printf("#0174#");
- #endif
- return 1;
- }
- stock TurnPlayerFaceToPlayer2(playerid, facingtoid)
- {
- #if defined SD
- printf("#0175#");
- #endif
- new Float:angle;
- new Float:misc = 5.0;
- new Float:x, Float:y, Float:z;
- new Float:ix, Float:iy, Float:iz;
- GetPlayerPos(facingtoid, x, y, z);
- GetPlayerPos(playerid, ix, iy, iz);
- angle = 180.0-atan2(ix-x,iy-y);
- angle += misc;
- misc *= -1;
- SetPlayerFacingAngle(playerid, angle+misc);
- #if defined SD
- printf("#0176#");
- #endif
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement