PDA

View Full Version : 1/x shot kill


szyma94
03-22-2015, 08:36
Hi how to do it in this code. (1/x shot kill)
public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype)
{
if(!IsValidClient(attacker))
return Plugin_Continue;

if(active[attacker]){
decl String:sWeapon[32];
GetClientWeapon(attacker, sWeapon, sizeof(sWeapon));
if(StrEqual(sWeapon, "weapon_awp")){
damage += 1024;
return Plugin_Changed;
}
}
return Plugin_Continue;
}

RedSword
03-22-2015, 16:58
The plugin should compile fine assuming you have active[] and IsValidClient defined somewhere. If you're asking how to remove AWP restriction and do it with all guns just change

[...]{
decl String:sWeapon[32];
GetClientWeapon(attacker, sWeapon, sizeof(sWeapon));
if(StrEqual(sWeapon, "weapon_awp")){
damage += 1024;
return Plugin_Changed;
}
by

damage += 1024.0;
return Plugin_Changed;