Jump to content
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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×