1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Farming kills

Discussion in 'Development' started by BruhLol, Nov 21, 2017.

  1. BruhLol

    BruhLol Baby Zombie

    Messages:
    122
    Is it possible to stop players from farming kills by using two devices and killing again and again? Because that just makes faction power system useless...
     
  2. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Set up a table that logs the number of kills between every two players, e.g. in SQLite3:
    Code:
    CREATE TABLE kill_parties (
      killer TEXT COLLATE NOCASE, -- killer name
      victim TEXT COLLATE NOCASE, -- victim name
      kills INTEGER,
      PRIMARY KEY(killer, victim)
    );
    
    -- upon killing
    INSERT OR IGNORE INTO kill_parties (killer, victim, kills) VALUES (:killer, :victim, 0);
    UPDATE kill_parties SET kills = kills + 1 WHERE killer = :killer AND victim = :victim;
    
    -- then check the proportion
    SELECT (SELECT COUNT(*) FROM kill_parties kp2 WHERE kp2.killer = :killer AND kp2.victim = :victim) / COUNT(*) prop FROM kill_parties kp WHERE kp.killer = :killer;
    -- I'm not excellent in SQL, and I'm sure this query can be further optimized.
    
    You may disable rewards if the proportion is greater than a certain value, e.g. 20%. But avoid banning players for it, because maybe the victim just made the killer mad, and the killer is much stronger than the victim, and somehow the victim doesn't want to leave the server.
    Or, they two are the most active players on the server and often 1v1 each other.
     
  3. BruhLol

    BruhLol Baby Zombie

    Messages:
    122
    great, thanks!
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.