damage based on body part doesnt lower hp!
#9

I have the system code, but it's in Spanish, it's was put down by me. I will pass it to you so that you take a look and look to see that.

PHP Code:
#include <a_samp>
#include <fader>
#include <foreach>
#include <sscanf2>
#include <zcmd>
new Fuerza[MAX_PLAYERS];
public 
OnFilterScriptInit()
{
    foreach(new 
iPlayer)
    {
        
SetPlayerTeam(i1);
     }
    return 
1;
}
public 
OnFilterScriptExit()
{
    foreach(new 
iPlayer)
    {
        
SetPlayerTeam(i, -1);
     }
     
Seifader_OnExit();
    return 
1;
}
public 
OnPlayerConnect(playerid)
{
    
SetPlayerTeam(playerid1);
    
Fuerza[playerid] = 1;
    return 
1;
}
public 
OnPlayerTakeDamage(playeridissueridFloatamountweaponidbodypart)
{
    new 
Float:danioFloat:vidaFloat:chalecostring[256];
    new 
fuerza Fuerza[issuerid];
    if(
issuerid != INVALID_PLAYER_ID)
    {
        if(
amount == 2.64)
        {
            if(
GetPlayerWeapon(issuerid) > 21 && GetPlayerWeapon(issuerid) < 34)
            {
                switch(
fuerza)
                {
                    case 
0..10danio 11.5;
                      case 
11..20danio 12.0;
                    case 
21..30danio 12.5;
                      case 
31..40danio 13.0;
                    case 
41..50danio 13.5;
                    case 
51..60danio 14.0;
                    case 
61..70danio 14.5;
                       case 
71..80danio 15.0;
                      case 
81..90danio 15.5;
                    case 
91..100danio 16.0;
                }
            }
        }
        else
        {
            if(
weaponid >= && weaponid 16)
            {
                switch(
weaponid)
                {
                    case 
0:
                    {
                         switch(
bodypart)
                         {
                             case 
3:
                             {
                                switch(
fuerza)
                                {
                                       case 
0..10danio 3.0;
                                    case 
11..20danio 3.5;
                                    case 
21..30danio 4.0;
                                    case 
31..40danio 4.5;
                                    case 
41..50danio 5.0;
                                    case 
51..60danio 5.5;
                                    case 
61..70danio 6.0;
                                    case 
71..80danio 6.5;
                                    case 
81..90danio 7.0;
                                    case 
91..100danio 7.5;
                                }
                            }
                            case 
4:
                             {
                                switch(
fuerza)
                                {
                                       case 
0..10danio 4.5;
                                    case 
11..20danio 5.0;
                                    case 
21..30danio 5.5;
                                    case 
31..40danio 6.0;
                                    case 
41..50danio 6.5;
                                    case 
51..60danio 7.0;
                                    case 
61..70danio 7.5;
                                    case 
71..80danio 8.0;
                                    case 
81..90danio 8.5;
                                    case 
91..100danio 9.0;
                                }
                            }
                            case 
5..8:
                             {
                                switch(
fuerza)
                                {
                                       case 
0..10danio 2.0;
                                    case 
11..20danio 2.5;
                                    case 
21..30danio 3.0;
                                    case 
31..40danio 3.5;
                                    case 
41..50danio 4.0;
                                    case 
51..60danio 4.5;
                                    case 
61..70danio 5.0;
                                    case 
71..80danio 5.5;
                                    case 
81..90danio 6.0;
                                    case 
91..100danio 6.5;
                                }
                            }
                             case 
9:
                             {
                                switch(
fuerza)
                                {
                                       case 
0..10danio 4.0;
                                    case 
11..20danio 4.5;
                                    case 
21..30danio 5.0;
                                    case 
31..40danio 5.5;
                                    case 
41..50danio 6.0;
                                    case 
51..60danio 6.5;
                                    case 
61..70danio 7.0;
                                    case 
71..80danio 7.5;
                                    case 
81..90danio 8.0;
                                    case 
91..100danio 8.5;
                                }
                            }
                        }
                    }
                     case 
1:
                     {
                         switch(
bodypart)
                         {
                             case 
3:
                             {
                                switch(
fuerza)
                                {
                                       case 
0..10danio 4.0;
                                    case 
11..20danio 4.5;
                                    case 
21..30danio 5.0;
                                    case 
31..40danio 5.5;
                                    case 
41..50danio 6.0;
                                    case 
51..60danio 6.5;
                                    case 
61..70danio 7.0;
                                    case 
71..80danio 7.5;
                                    case 
81..90danio 8.0;
                                    case 
91..100danio 8.5;
                                }
                            }
                            case 
4:
                             {
                                switch(
fuerza)
                                {
                                       case 
0..10danio 5.5;
                                    case 
11..20danio 6.0;
                                    case 
21..30danio 6.5;
                                    case 
31..40danio 7.0;
                                    case 
41..50danio 7.5;
                                    case 
51..60danio 8.0;
                                    case 
61..70danio 8.5;
                                    case 
71..80danio 9.0;
                                    case 
81..90danio 9.5;
                                    case 
91..100danio 10.0;
                                }
                            }
                            case 
5..8:
                             {
                                switch(
fuerza)
                                {
                                       case 
0..10danio 3.0;
                                    case 
11..20danio 3.5;
                                    case 
21..30danio 4.0;
                                    case 
31..40danio 4.5;
                                    case 
41..50danio 5.0;
                                    case 
51..60danio 5.5;
                                    case 
61..70danio 6.0;
                                    case 
71..80danio 6.5;
                                    case 
81..90danio 7.0;
                                    case 
91..100danio 7.5;
                                }
                            }
                             case 
9:
                             {
                                switch(
fuerza)
                                {
                                       case 
0..10danio 5.0;
                                    case 
11..20danio 5.5;
                                    case 
21..30danio 6.0;
                                    case 
31..40danio 6.5;
                                    case 
41..50danio 7.0;
                                    case 
51..60danio 7.5;
                                    case 
61..70danio 8.0;
                                    case 
71..80danio 8.5;
                                    case 
81..90danio 9.0;
                                    case 
91..100danio 9.5;
                                }
                            }
                        }
                    }
                     case 
2,3,5,6,7,15:
                     {
                         switch(
bodypart)
                         {
                             case 
3:
                             {
                                switch(
fuerza)
                                {
                                       case 
0..10danio 6.0;
                                    case 
11..20danio 6.5;
                                    case 
21..30danio 7.0;
                                    case 
31..40danio 7.5;
                                    case 
41..50danio 8.0;
                                    case 
51..60danio 8.5;
                                    case 
61..70danio 9.0;
                                    case 
71..80danio 9.5;
                                    case 
81..90danio 10.0;
                                    case 
91..100danio 10.5;
                                }
                            }
                            case 
4:
                             {
                                switch(
fuerza)
                                {
                                       case 
0..10danio 10.5;
                                    case 
11..20danio 11.0;
                                    case 
21..30danio 11.5;
                                    case 
31..40danio 12.0;
                                    case 
41..50danio 12.5;
                                    case 
51..60danio 13.0;
                                    case 
61..70danio 13.5;
                                    case 
71..80danio 14.0;
                                    case 
81..90danio 14.5;
                                    case 
91..100danio 15.0;
                                }
                            }
                            case 
5..8:
                             {
                                switch(
fuerza)
                                {
                                       case 
0..10danio 5.0;
                                    case 
11..20danio 5.5;
                                    case 
21..30danio 6.0;
                                    case 
31..40danio 6.5;
                                    case 
41..50danio 7.0;
                                    case 
51..60danio 7.5;
                                    case 
61..70danio 8.0;
                                    case 
71..80danio 8.5;
                                    case 
81..90danio 9.0;
                                    case 
91..100danio 9.5;
                                }
                            }
                             case 
9:
                             {
                                switch(
fuerza)
                                {
                                       case 
0..10danio 10.0;
                                    case 
11..20danio 10.5;
                                    case 
21..30danio 11.0;
                                    case 
31..40danio 11.5;
                                    case 
41..50danio 12.0;
                                    case 
51..60danio 12.5;
                                    case 
61..70danio 13.0;
                                    case 
71..80danio 13.5;
                                    case 
81..90danio 14.0;
                                    case 
91..100danio 14.5;
                                }
                            }
                        }
                    }
                     case 
4:
                     {
                         switch(
bodypart)
                         {
                             case 
3:
                             {
                                switch(
fuerza)
                                {
                                       case 
0..10danio 10.0;
                                    case 
11..20danio 10.5;
                                    case 
21..30danio 11.0;
                                    case 
31..40danio 11.5;
                                    case 
41..50danio 12.0;
                                    case 
51..60danio 12.5;
                                    case 
61..70danio 13.0;
                                    case 
71..80danio 13.5;
                                    case 
81..90danio 14.0;
                                    case 
91..100danio 14.5;
                                }
                            }
                            case 
4:
                             {
                                switch(
fuerza)
                                {
                                       case 
0..10danio 12.5;
                                    case 
11..20danio 13.0;
                                    case 
21..30danio 13.5;
                                    case 
31..40danio 14.0;
                                    case 
41..50danio 14.5;
                                    case 
51..60danio 15.0;
                                    case 
61..70danio 15.5;
                                    case 
71..80danio 16.0;
                                    case 
81..90danio 16.5;
                                    case 
91..100danio 17.0;
                                }
                            }
                            case 
5..8:
                             {
                                switch(
fuerza)
                                {
                                       case 
0..10danio 6.0;
                                    case 
11..20danio 6.5;
                                    case 
21..30danio 7.0;
                                    case 
31..40danio 7.5;
                                    case 
41..50danio 8.0;
                                    case 
51..60danio 8.5;
                                    case 
61..70danio 9.0;
                                    case 
71..80danio 9.5;
                                    case 
81..90danio 10.0;
                                    case 
91..100danio 10.5;
                                }
                            }
                             case 
9:
                             {
                                switch(
fuerza)
                                {
                                       case 
0..10danio 12.0;
                                    case 
11..20danio 12.5;
                                    case 
21..30danio 13.0;
                                    case 
31..40danio 13.5;
                                    case 
41..50danio 14.0;
                                    case 
51..60danio 14.5;
                                    case 
61..70danio 15.0;
                                    case 
71..80danio 15.5;
                                    case 
81..90danio 16.0;
                                    case 
91..100danio 16.5;
                                }
                            }
                        }
                    }
                     case 
8:
                     {
                         switch(
bodypart)
                         {
                             case 
3,4:
                             {
                                switch(
fuerza)
                                {
                                       case 
0..10danio 15.0;
                                    case 
11..20danio 15.5;
                                    case 
21..30danio 16.0;
                                    case 
31..40danio 16.5;
                                    case 
41..50danio 17.0;
                                    case 
51..60danio 17.5;
                                    case 
61..70danio 18.0;
                                    case 
71..80danio 18.5;
                                    case 
81..90danio 19.0;
                                    case 
91..100danio 19.5;
                                }
                            }
                            case 
5..8:
                             {
                                switch(
fuerza)
                                {
                                       case 
0..10danio 12.0;
                                    case 
11..20danio 12.5;
                                    case 
21..30danio 13.0;
                                    case 
31..40danio 13.5;
                                    case 
41..50danio 14.0;
                                    case 
51..60danio 14.5;
                                    case 
61..70danio 15.0;
                                    case 
71..80danio 15.5;
                                    case 
81..90danio 16.0;
                                    case 
91..100danio 16.5;
                                }
                            }
                             case 
9danio 200;
                        }
                    }
                    default: 
danio amount;
                 }
                 
format(stringsizeof(string), "Daсo que has recibido por el golpe/corte: %f | Fuerza del agresor: %d"daniofuerza);
                
SendClientMessage(-1playeridstring);
                
format(stringsizeof(string), "Daсo que has efectuado con el golpe/corte: %f"danio);
                
SendClientMessage(-1issueridstring);
            }
            if(
weaponid 21 && weaponid 52)
            {
                 switch(
weaponid)
                 {
                    case 
22,23:
                    {
                        switch(
bodypart)
                         {
                            case 
3,4danio 45.0;
                            case 
5..8danio 20.0;
                            case 
9danio 200.0;
                        }
                    }
                    case 
24:
                     {
                        switch(
bodypart)
                         {
                            case 
3,4danio 70.0;
                            case 
5..8danio 35.0;
                            case 
9danio 200.0;
                        }
                    }
                       case 
25..27:
                       {
                         switch(
bodypart)
                         {
                            case 
3,4danio 90.0;
                            case 
5..8danio 50.0;
                            case 
9danio 200.0;
                        }
                     }
                     case 
28,32:
                      {
                        switch(
bodypart)
                         {
                            case 
3,4danio 45.0;
                            case 
5..8danio 20.0;
                            case 
9danio 200.0;
                        }
                    }
                      case 
29:
                      {
                        switch(
bodypart)
                         {
                            case 
3,4danio 55.0;
                            case 
5..8danio 30.0;
                            case 
9danio 200.0;
                        }
                    }
                     case 
30:
                     {
                         switch(
bodypart)
                         {
                            case 
3,4danio 65.0;
                            case 
5..8danio 40.0;
                            case 
9danio 200.0;
                        }
                    }
                     case 
31:
                     {
                        switch(
bodypart)
                         {
                            case 
3,4danio 60.0;
                            case 
5..8danio 35.0;
                            case 
9danio 200.0;
                        }
                    }
                     case 
33:
                     {
                        switch(
bodypart)
                         {
                            case 
3,4danio 80.0;
                            case 
5..8danio 40.0;
                            case 
9danio 200.0;
                        }
                    }
                     case 
34:
                     {
                        switch(
bodypart)
                         {
                            case 
3,4danio 100.0;
                            case 
5..8danio 60.0;
                            case 
9danio 200.0;
                        }
                    }
                    default: 
danio amount;
                   }
                   
format(stringsizeof(string), "Daсo que has recibido por disparo: %f"danio);
                
SendClientMessage(-1playeridstring);
                
format(stringsizeof(string), "Daсo que has efectuado con el disparo: %f"danio);
                
SendClientMessage(-1issueridstring);
                   
FadePlayerScreen(playerid0xE20000FF25);
            }
        }
        
GetPlayerHealth(playeridvida);
          
GetPlayerArmour(playeridchaleco);
           if(
chaleco)
          {
            if(
chaleco danioSetPlayerArmour(playeridchaleco-danio);
             else
             {
                  
SetPlayerArmour(playerid0.0);
                
chaleco danio-chaleco;
                 if(
chaleco >= vidaSetPlayerHealth(playerid0.0);
                  else 
SetPlayerHealth(playeridvida-chaleco);
            }
        }
        else
        {
            if(
vida danioSetPlayerHealth(playeridvida-danio);
             else 
SetPlayerHealth(playerid0.0);
        }
    }
    return 
1;
}
stock Nombre(playerid)
{
    new 
nombre[32];
    
GetPlayerName(playeridnombre32);
    return 
nombre;
}
COMMAND:darfuerza(playeridparams[])
{
    if(!
sscanf(params"ui"params[0], params[1]))
    {
         if(
params[0] != INVALID_PLAYER_ID)
         {
             if(
params[1] < || params[1] > 100) return SendClientMessage(playerid, -1"[ERROR] Sуlo puedes dar entre 1 y 100 de fuerza.");
              
Fuerza[params[0]] = params[1];
              new 
string[128];
            
format(stringsizeof(string), "%s te ha dado %d de fuerza."Nombre(playerid), params[1]);
            
SendClientMessage(params[0], -1string);
        }
        else 
SendClientMessage(playerid, -1"[ERROR] El jugador seleccionado no se encuentra conectado.");
    }
    else 
SendClientMessage(playerid, -1"[USO] '/darfuerza' [ID Jugador] [Fuerza 1-100]");
      return 
1;
}
COMMAND:fuerza(playeridparams[])
{
    new 
string[128];
    
format(stringsizeof(string), "Tienes %d de fuerza."Fuerza[playerid]);
    
SendClientMessage(playerid, -1string);
      return 
1;

Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)