Jump to content

Forums Announcement

Read-Only Mode for Announcements & Changelogs

Dear Survivors, we'd like to inform you that this forum will transition to read-only mode. From now on, it will serve exclusively as a platform for official announcements and changelogs.

For all community discussions, debates, and engagement, we encourage you to join us on our social media platforms: Discord, Twitter/X, Facebook.

Thank you for being a valued part of our community. We look forward to connecting with you on our other channels!

Stay safe out there,
Your DayZ Team

Reaper13

help need with player connect

Recommended Posts

hi everybody, i was given this script to add to my init file

 

override void InvokeOnConnect(PlayerBase player, PlayerIdentity identity)
{
    super.InvokeOnConnect(player, identity);

    ScriptRPC rpc = new ScriptRPC();
    rpc.Write(identity.GetName() + "has joined the server");

    rpc.Send(null, RPC_USER_ACTION_MESSAGE, true);
}

override void InvokeOnDisconnect(PlayerBase player)
{
    super.InvokeOnDisconnect(player);

    ScriptRPC rpc = new ScriptRPC();
    rpc.Write(player.GetIdentity().GetName() + "has left the server");

    rpc.Send(null, RPC_USER_ACTION_MESSAGE, true);
}

but it doesnt work, i get a crash log saying

UK-W-2521-E, 08.03 2021 07:50:28
Can't compile mission init script'!
$CurrentDir:mpmissions\dayzOffline.chernarusplus\init.c(407): Can't find variable 'RPC_USER_ACTION_MESSAGE'
Runtime mode
CLI params: ip 51.195.242.18 port 2302 noPause  noSound  servermod

 

now im no expert at coding at all, and i cant find anything explaining to an idiot like me what a RPC_USER_ACTION_MESSAGE is or how to correct it or if im missing something?

any help would be greatly appreciated, thanks

Edited by Reaper13

Share this post


Link to post
Share on other sites

×