Jump to content

How to make interactable action with other players in the world?


SantilliouS

Recommended Posts

There is a mod to make syringes with cure and you can inject it to yourself and heal. It was intended as single-player mod. I'd like to upgrade it and make it possible to inject cure to other players and heal them.

 

To do this I need a way to get other player's data. Something like otherPlayer:getPlayer(). But I don't know how to do it and could not find any example on how to do it. I know there is a "Perform medical check" action which allows to interact with other player... But again i can't find it's realization code...
Can anyone give me example on how to get other's player data from context menu?

 

 

Link to comment
Share on other sites

  • 9 months later...

Believe it or not I'm currently working on trying to implement that same feature and it took me 3 weeks to make absolutely 0 progress.
I tried MedicalCheck.. ApplyBandage... TheOnlyCure mod.. TradeAction.. nothing lead to me making a functioning code.
I even asked 10 times till now in the modding pz discord channel.. nothing

I've successfully created an UI-button that can be interacted with and is located in the HealthPanelUI-- but when I do a code with getPlayer():getBodyDamage():setInfected(false) it only does that for the one that clicks the button but not for the player whose Health Panel is opened. How do I use otherPlayer/patient/clickedPlayer/playerObj or whatever to change body stats? 
Anyone?

I just want to vaccinate others-- please :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...