[ 208875] RgscStub::m_13
[ 208875] Exception thrown by a task: System.AggregateException: One or more errors occurred. ---> System.MethodAccessException: Error verifying BasicResourceClient.BasicResourceClient/<OnTick>d__1:MoveNext (): Method System.Array:Empty<object> () is not accessible at 0x0014
[ 208875] at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) [0x0002c] in <a4e3abdd630b4c98a9d6f31a99197de6>:0
[ 208875] at BasicResourceClient.BasicResourceClient.OnTick () [0x00026] in <ecc227357829482ab7dc92b9bb9a5ade>:0
[ 208875] at System.Threading.Tasks.Task`1[TResult].InnerInvoke () [0x0000f] in <a4e3abdd630b4c98a9d6f31a99197de6>:0
[ 208875] at System.Threading.Tasks.Task.Execute () [0x00010] in <a4e3abdd630b4c98a9d6f31a99197de6>:0
[ 208875] --- End of inner exception stack trace ---
[ 208875] ---> (Inner Exception #0) System.MethodAccessException: Error verifying BasicResourceClient.BasicResourceClient/<OnTick>d__1:MoveNext (): Method System.Array:Empty<object> () is not accessible at 0x0014
[ 208875] at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) [0x0002c] in <a4e3abdd630b4c98a9d6f31a99197de6>:0
[ 208875] at BasicResourceClient.BasicResourceClient.OnTick () [0x00026] in <ecc227357829482ab7dc92b9bb9a5ade>:0
[ 208875] at System.Threading.Tasks.Task`1[TResult].InnerInvoke () [0x0000f] in <a4e3abdd630b4c98a9d6f31a99197de6>:0
[ 208875] at System.Threading.Tasks.Task.Execute () [0x00010] in <a4e3abdd630b4c98a9d6f31a99197de6>:0 <---
[ 208875]
[ 208875] Failed to run a tick for BasicResourceClient: System.MethodAccessException: Error verifying BasicResourceClient.BasicResourceClient/<OnTick>d__1:MoveNext (): Method System.Array:Empty<object> () is not accessible at 0x0014
[ 208875] at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) [0x0002c] in <a4e3abdd630b4c98a9d6f31a99197de6>:0
[ 208875] at BasicResourceClient.BasicResourceClient.OnTick () [0x00026] in <ecc227357829482ab7dc92b9bb9a5ade>:0
[ 208875] at System.Threading.Tasks.Task`1[TResult].InnerInvoke () [0x0000f] in <a4e3abdd630b4c98a9d6f31a99197de6>:0
[ 208875] at System.Threading.Tasks.Task.Execute () [0x00010] in <a4e3abdd630b4c98a9d6f31a99197de6>:0
Client script code:
public BasicResourceClient()
{
//In the constructor we add
Tick += OnTick;
}
private async Task OnTick()
{
Debug.WriteLine("One second passed!");
await Delay(1000);
}
Hello All.
I am having the same issue as many others. Server code is fine, Client code is fine but Server to Client communication doesn’t work. I have even copy-pasted the code from this tut.
I have checked this thread and copy-pasted the code: Please post some c# code snippets
Even from there no Server to Client code works and “playerConnecting” seems to be the only Server Event that works.
Shared project are all the functions and data that are common between client and server. You can just have a server and client project without using a “shared” project.
Just a heads up, while the guide works for getting started someone actually following the guide will not yield a MOTD.
As mentioned before, player connecting is handled on initial server connection before chat box is available. Any attempts to replicate this code will not work because of this.
That being said, is there a way for the server to call an action on successful spawn? Or do i have to trigger a server event on spawn to get the MoTD, then trigger that message again on the client?
In the latter case, the mini guide should express that the user should request a server action, where the server action requests a user action providing the MoTD details.
Havent tested this code because i do not have succes starting up a C# project something is wrong on my side, not clear what it is, but i think this will get your player.
player = GetPlayerPed(PlayerId()).ToString();
i will try that out to night, i was mixing up common .lua method with this, i was putting the dll’s in server.lua and client.lua, i was too frustrated to realise it had to go in __resource.lua… i am playing around with SetTimeScale(0.3f) bullet time effect. i wonder what it will do with more players in it.