ItsMods

Full Version: HS Plugin
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is it possible to code a Plugin, which will check if someone do hs, or maybe ns?
*push* we really need something like that!! Smile
This is for instakill:
Code:
public override int OnPlayerDamaged(ServerClient Attacker, ServerClient Victim, string Weapon, int Damage, string DamageMod, HitLocations HitLocation)
        {
              if (Weapon.Contains("desert"))
                return 100;
            else
                return base.OnPlayerDamaged(Attacker, Victim, Weapon, Damage, DamageMod, HitLocation);
        }

Maybe we can modify a locations (I don't know if possible)
But I guess it's possible, I think if we find it, and modify this code i twill work
I can never quite get to grips of MW3 terms these days.. HS means HEADSHOT, or it could mean HARDSCOPE? and NS?

both of these would be easy. As 99Irock said, but since weapon is a string, i'd say:


Quote: if (Weapon == "desert")
return 100;
else
return base.OnPlayerDamaged(Attacker, Victim, Weapon, Damage, DamageMod, HitLocation);

To add head shot detection in there it's pretty damn easy..

Quote:if (Weapon == "desert" &&
HitLocation == HitLocations.Head &&
Damage >= Victim.Other.Health)
{
ServerSay(" OMERGERHD " + Attacker.Name + " got a headshot with a!" + weapon,true);
}

I'm not sure changing the location is actually possible because we can only return damage, so you can't force an instagib headshot without rewriting things.. If so, for instant headshots you'd have to do something like:

Quote:OnPlayerDamaged(...)
{

KillPlayer( Attacker.ClientNum, Victim.ClientNum, GetWeapon(Weapon), you'll need to find the sMOD);

}

As for a hardscope mod.. I'm not sure, you could do a:

Quote:Dictionary alreadyinAds = new Dictionary<string, TimeDate>

OnServerFrame

foreach (client in GetClients())
{
timedate now = TimeDate.Now.ToUniversalTime();
if (client.Other.isAds == true && !alreadyinAds.ContainsKey(client.XUID))
{
alreadyinAds[client.XUID] = now;
}
else if (client.Other.isAds == false && alreadyinAds.ContainsKey(client.XUID))
{
TimeSpan td = now - alreadyinAds[client.XUID];
SayServer(client.Name + " was scoped for " + td.TotalSeconds(), true);
}


}