Combat from Hospital and Jail?
Combat from Hospital and Jail?
I've gotten reports that my players are able to attack other players while they themselves are in jail or hospitalized? Is this supposed to be possible? They can't attack players already in jail or the hospital and I'd like the same to be the case when they themselves are in either facility.
- KyleMassacre
- Posts: 573
- Joined: Wed Nov 27, 2013 12:42 pm
Re: Combat from Hospital and Jail?
Then it is something with the CanFight function probably in the attack lib
Re: Combat from Hospital and Jail?
I ended up adding the 2 isinjail and isinhospital functions to the top of the view player content.php file. Now the players just receive a message saying "You can't view other players while in a Hsospital bed!" if they try to view players while in the Hospital. This prevent's the player view from even loading.
Re: Combat from Hospital and Jail?
Just put that script on top of the combat module. It will block it completely. No matter what other module trying to access it.
- KyleMassacre
- Posts: 573
- Joined: Wed Nov 27, 2013 12:42 pm
Re: Combat from Hospital and Jail?
There is not a check for it in the combat lib. Maybe gmoore can add in there:
Code: Select all
if (function_exists("IsInHospital") && (IsInHospital($otherPlayer) || IsInHospital()))
return false;
if (function_exists("IsInJail") && (IsInJail($otherPlayer)) || IsInJail())
return false;