Author Topic: question about anti pvp server setup  (Read 193 times)

question about anti pvp server setup
« on: November 01, 2022, 02:14:23 am »
Me and a couple of mates have been messing around with our own server using aftertimes as a base. Not doing any serious changes.. just adding missions and a few maps.

We have run into an issue though and cant get our heads around it. We wanted to disable PVP in random encounters and make it so the only place pvp can happen is town control towns... alternatively, make it so players cant randomly bump into eachother whilst traveling. Can anyone shed any light on ways to do either of these things?

Offline kompreSor

  • FOnline 3
Re: question about anti pvp server setup
« Reply #1 on: November 01, 2022, 10:31:51 pm »
maybe just add to combat.fos@CombatAttack something like that
 
Code: [Select]
if(loc.IsEncounter() && target.IsPlayer() && cr.IsPlayer())
return;
or
Code: [Select]
import bool IsTCTown(Map@ map) from "town";

if(!IsTCTown(map) && target.IsPlayer() && cr.IsPlayer())
{
        cr.Say(SAY_NETMSG, "Can't Attack here.");
        return;
}

« Last Edit: November 01, 2022, 10:38:31 pm by kompreSor »

Re: question about anti pvp server setup
« Reply #2 on: November 02, 2022, 11:19:09 pm »
Thank you. really helped me figure this out :)