OnPlayerTakeDamage
#3

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    static
        Float: szHealth
    ;
   
    GetPlayerHealth(playerid,szHealth);
   
    if(StrategyArmy == 1)
    {
       
       
        switch(weaponid)
        {
            case 31: SetPlayerHealth(playerid,szHealth-30);
            case 24: SetPlayerHealth(playerid,szHealth-30);
            case 35: SetPlayerHealth(playerid,szHealth-40);
        }
    }
   
   
    if(StrategyArmy == 2)
    {
        switch(weaponid)
        {
            case 34: SetPlayerHealth(playerid,szHealth-60);
            case 25: SetPlayerHealth(playerid,szHealth-30);
            case 16: SetPlayerHealth(playerid,szHealth-70);
        }
     }

     if(StrategyTerror == 1)
     {
        switch(weaponid)
        {
            case 31: SetPlayerHealth(playerid,szHealth-30);
            case 24: SetPlayerHealth(playerid,szHealth-30);
            case 35: SetPlayerHealth(playerid,szHealth-40);
        }
    }
   
   
    if(StrategyTerror == 2)
    {
        switch(weaponid)
        {
            case 34: SetPlayerHealth(playerid,szHealth-60);
            case 25: SetPlayerHealth(playerid,szHealth-30);
            case 16: SetPlayerHealth(playerid,szHealth-70);
        }
    }
   
    if(issuerid != INVALID_PLAYER_ID && weaponid == 4)
    {
         //One shot to kill with knife
        SetPlayerHealth(playerid, 0.0);
    }
    return 1;
}
Try this.
Reply


Messages In This Thread
OnPlayerTakeDamage - by Tamer - 12.01.2013, 18:30
Re: OnPlayerTakeDamage - by ThePhenix - 12.01.2013, 18:41
Re: OnPlayerTakeDamage - by zSuYaNw - 12.01.2013, 18:43

Forum Jump:


Users browsing this thread: 1 Guest(s)