Page 1 of 1

Combat from Hospital and Jail?

Posted: Mon Oct 05, 2015 2:21 pm
by cbsarge
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.

Re: Combat from Hospital and Jail?

Posted: Mon Oct 05, 2015 3:15 pm
by KyleMassacre
Then it is something with the CanFight function probably in the attack lib

Re: Combat from Hospital and Jail?

Posted: Mon Oct 05, 2015 8:56 pm
by cbsarge
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?

Posted: Mon Oct 05, 2015 10:32 pm
by KaL
Just put that script on top of the combat module. It will block it completely. No matter what other module trying to access it.

Re: Combat from Hospital and Jail?

Posted: Mon Oct 05, 2015 10:44 pm
by KyleMassacre
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;