Raised This Month: $12 Target: $400
 3% 

[CS:GO] Send user messages


Post New Thread Reply   
 
Thread Tools Display Modes
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 - 55 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
backwards
AlliedModders Donor
Join Date: Feb 2014
Location: USA
Old 12-13-2021 , 00:35   Re: [CS:GO] Send user messages
Reply With Quote #2

Quote:
Invalid field "hint_static" for message "CCSUsrMsg_Train"
Just supply valid arguments and read your error log files. Since the original function errors out and never continues to the EndMessage() call, you will always get that message when you call the function to start a new message if a previously started one never finishes. When you just call EndMessage without one being in progress it can lead to a server crash.
backwards is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:30.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode