DennisWeiss 0 Posted November 14, 2018 (edited) Hello, so far I have figured out how to do server sided coding, like dealing damage to a player if he is outside of a specific zone or sending global chat messages. But if I'm not mistaken I need something client sided to for instance pop up a dialog or display a UI widget. Does anyone know how to do client sided scripting? Also the GetGame().ChatMP(player, "Text", "colorImportant"); function to send a chat message to a specific player didn't work for me. Edited November 14, 2018 by DennisWeiss Share this post Link to post Share on other sites
DennisWeiss 0 Posted November 14, 2018 Hello, so far I have figured out how to do server sided coding, like dealing damage to a player if he is outside of a specific zone or sending global chat messages. But if I'm not mistaken I need something client sided to for instance pop up a dialog or display a UI widget. Does anyone know how to do client sided scripting? Also the GetGame().ChatMP(player, "Text", "colorImportant"); function to send a chat message to a specific player didn't work for me. Share this post Link to post Share on other sites
kichilron 8550 Posted November 15, 2018 Merged. Please only open one topic - if you need something moved, have us moderators do it, thank you! Share this post Link to post Share on other sites
nico1122 0 Posted November 15, 2018 @code // example sending void Send() { ScriptRPC rpc = new ScriptRPC(); rpc.Write(645); rpc.Write("hello"); array<float> farray = {1.2, 5.6, 8.1}; rpc.Write(farray); rpc.Send(m_Player, ERPCs.RPC_TEST, true, m_Player.GetIdentity()); } // example receive void OnRPC(ParamsReadContext ctx) { int num; string text; array<float> farray; ctx.Read(num); ctx.Read(text); ctx.Read(farray); } @endcode You will need RPCs. ERPCs is an enum in 3_Game\Enum, you can just create your own. As far as I understand, to open a window for one specific player, this player has to sent an RPC to the server, which allows the player to open that window/menu/whatever. Search the script.pbo for RPCSingleParam() and and OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx) Share this post Link to post Share on other sites
DennisWeiss 0 Posted November 15, 2018 @nico1122 Thank you for your answer. Do you have a working example, cause I simply don't get the OnRPC function to be triggered? Share this post Link to post Share on other sites
nico1122 0 Posted November 16, 2018 (edited) You would have to override the corresponding OnRPC function. In DayZPlayerImplement is a debug version of autowalk inside the rpc function. Overriding this wont break something so go ahead and play around with it. override void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx) Edit: and dont put your custom RPC in the ERPCs, make a new file with your own naming it MyRPCs for example. Edited November 16, 2018 by nico1122 Share this post Link to post Share on other sites