fodev.net

FOnline Development => Questions and Answers => Topic started by: chenzo on November 01, 2022, 02:14:23 am

Title: question about anti pvp server setup
Post by: chenzo 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?
Title: Re: question about anti pvp server setup
Post by: kompreSor 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;
}

Title: Re: question about anti pvp server setup
Post by: chenzo on November 02, 2022, 11:19:09 pm
Thank you. really helped me figure this out :)