21.03.2013, 08:26
Well, This is my code and the weapons dont hit the exact values that i want it hits the normal values
The max hp is 30000 for people who might get confused...
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;
}