Combat from Hospital and Jail?

General Chat, Comments
Post Reply
User avatar
cbsarge
Posts: 195
Joined: Mon Sep 14, 2015 3:20 pm

Combat from Hospital and Jail?

Post 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.
User avatar
KyleMassacre
Posts: 573
Joined: Wed Nov 27, 2013 12:42 pm

Re: Combat from Hospital and Jail?

Post by KyleMassacre »

Then it is something with the CanFight function probably in the attack lib
User avatar
cbsarge
Posts: 195
Joined: Mon Sep 14, 2015 3:20 pm

Re: Combat from Hospital and Jail?

Post 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.
KaL
Posts: 344
Joined: Mon Jan 13, 2014 5:44 am

Re: Combat from Hospital and Jail?

Post 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.
User avatar
KyleMassacre
Posts: 573
Joined: Wed Nov 27, 2013 12:42 pm

Re: Combat from Hospital and Jail?

Post 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;
Post Reply

Return to “General”