OnPlayerTakeDamage
#1

Well, This is my code and the weapons dont hit the exact values that i want it hits the normal values

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    new Float:HP;
    GetPlayerHealth(playerid, HP);
    if(issuerid != INVALID_PLAYER_ID && weaponid  == 30)
    {
         new x = 1 + random(2200);
         SetPlayerHealth(playerid, HP-x);

    }
        if(issuerid != INVALID_PLAYER_ID && weaponid  == 31)
    {
        new x = 1 + random(2600);
         SetPlayerHealth(playerid, HP-x);
    }
        if(issuerid != INVALID_PLAYER_ID && weaponid  == 24)
    {
        new x = 1 + random(1600);
         SetPlayerHealth(playerid, HP-x);
    }
        if(issuerid != INVALID_PLAYER_ID && weaponid  == 22)
    {

        new x = 1 + random(1200);
         SetPlayerHealth(playerid, HP-x);
    }
        if(issuerid != INVALID_PLAYER_ID && weaponid  == 4)
    {

        new x = 4000 + random(10000);
         SetPlayerHealth(playerid, HP-x);

    }
        if(issuerid != INVALID_PLAYER_ID && weaponid  == 8)
    {

        new x = 5000 + random(12000);
         SetPlayerHealth(playerid, HP-x);

    }
        if(issuerid != INVALID_PLAYER_ID && weaponid  == 27)
    {

        new x = 1 + random(5000);
         SetPlayerHealth(playerid, HP-x);

    }
        if(issuerid != INVALID_PLAYER_ID && weaponid  == 35)
    {

        new x = 5000 + random(6000);
         SetPlayerHealth(playerid, HP-x);

    }
        if(issuerid != INVALID_PLAYER_ID && weaponid  == 38)
    {

        new x = 4000 + random(5000);
         SetPlayerHealth(playerid, HP-x);

    }

   
    return 1;
}
The max hp is 30000 for people who might get confused...
Reply


Messages In This Thread
OnPlayerTakeDamage - by CROSS_Hunter - 21.03.2013, 08:26
Re: OnPlayerTakeDamage - by Denying - 21.03.2013, 09:58
Re: OnPlayerTakeDamage - by CROSS_Hunter - 21.03.2013, 10:30
Re: OnPlayerTakeDamage - by CROSS_Hunter - 22.03.2013, 01:23

Forum Jump:


Users browsing this thread: 2 Guest(s)