View Single Post
Author Message
kadet.89
Veteran Member
Join Date: Nov 2012
Location: Serbia
Old 12-12-2021 , 15:10   [CS:GO] Send user messages
Reply With Quote #1

When I want to send a proto message I get this error:

PHP Code:
L 12/12/2021 12:02:52: [SMException reportedUnable to execute a new messagethere is already one in progress
L 12
/12/2021 12:02:52: [SMBlaminginstructortest.smx
L 12
/12/2021 12:02:52: [SMCall stack trace:
L 12/12/2021 12:02:52: [SM]   [0StartMessageEx
L 12
/12/2021 12:02:52: [SM]   [1Line 35instructortest.sp::LoadStuff 
I tried to change the time offset in the timer, but it appears that there is always a message which blocks mine. I tried to call EndMessage() prior to sending my message, but it only crashes the server.
How can I catch the moment when there is no processing message so I could send mine?

PHP Code:
UserMsg g_FadeUserMsgId;

public 
OnPluginStart()
{
    
HookEvent("player_spawn"SpawnEvent);
}

public 
Action:SpawnEvent(Handle:event,const String:name[],bool:dontBroadcast)
{
    new 
client_id GetEventInt(event"userid");
    new 
client GetClientOfUserId(client_id);
    
g_FadeUserMsgId GetUserMessageId("Train");
    
CreateTimer(1.0LoadStuffclient);
}

public 
Action LoadStuff(Handle timerint client)
{
    
int clients[2];
    
clients[0] = client;

    
Handle message StartMessageEx(g_FadeUserMsgIdclients1);
    if(
message != INVALID_HANDLE)
    {
        
Protobuf pb UserMessageToProtobuf(message);
        
PbSetInt(pb"hint_static"1);
        
PbSetFloat(pb"hint_timeout"0.1);
        
PbSetString(pb"hint_icon_onscreen""use_binding");
        
PbSetString(pb"hint_icon_offscreen""use_binding");
        
PbSetString(pb"hint_binding""use");
        
PbSetString(pb"hint_caption""Hello");
    }
    
EndMessage();

Attached Files
File Type: sp Get Plugin or Get Source (instructortest.sp - 56 views - 1.1 KB)

Last edited by kadet.89; 12-12-2021 at 15:24.
kadet.89 is offline
Send a message via Skype™ to kadet.89