13.02.2013, 05:21
This is the whole callback:
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
{
new points;
new string[128];
new Float:armour;
GetPlayerArmour(playerid, armour);
if(issuerid == INVALID_PLAYER_ID)
{
return 1;
}
if(GetPVarInt(playerid, "IsInArena") == 0)
{
if(GetPVarInt(playerid, "EventToken") == 0)
{
if(weaponid == 24) //deagle
{
if(armour > 0)
{
pDamage[playerid] += 15;
}
else
{
pDamage[playerid] += 30;
}
}
else if(weaponid == 23) //sdpistol
{
if(armour > 0)
{
pDamage[playerid] += 5;
}
else
{
pDamage[playerid] += 10;
}
}
else if(weaponid == 29) //MP5
{
if(armour > 0)
{
pDamage[playerid] += 10;
}
else
{
pDamage[playerid] += 15;
}
}
else if(weaponid == 30 || weaponid == 31) //M4 - AK47
{
if(armour > 0)
{
pDamage[playerid] += 10;
}
else
{
pDamage[playerid] += 20;
}
}
else if(weaponid == 25 || weaponid == 27) //Shotgun + SPAS12
{
if(armour > 0)
{
if(ProxDetectorS(12.0, playerid, issuerid))
{
pDamage[playerid] += 25;
}
else
{
pDamage[playerid] += 15;
}
}
else
{
if(ProxDetectorS(12.0, playerid, issuerid))
{
pDamage[playerid] += 35;
}
else
{
pDamage[playerid] += 20;
}
}
}
else if(weaponid == 34) //Sniper
{
if(ProxDetectorS(60.0, playerid, issuerid))
{
pDamage[playerid] += 50;
}
else
{
pDamage[playerid] += 0;
}
}
else if(weaponid == 33) //Rifle
{
pDamage[playerid] += 15;
}
if(pDamage[playerid] > 0)
{
pDamageTimer[playerid] = 120;
GameTextForPlayer(playerid, "~r~You've been hit!", 1500, 1);
if(pDamage[playerid] >= 100)
{
format(string, sizeof(string), "* %s falls to the ground due to the bullet injuries.", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
ApplyAnimation(playerid, "KNIFE", "KILL_Knife_Ped_Die", 4.0, 0, 1, 1, 1, 0, 1);
}
}
}
}
return 1;
}