Amaroq7 / SPMod

SourcePawn Scripting Engine for Half-Life 1 based games
GNU General Public License v3.0
27 stars 12 forks source link

initial messages support #3

Closed Mistrick closed 6 years ago

Mistrick commented 6 years ago

copy from amxmodx

Description

Motivation and Context

How has this been tested?

#include <spmod>

public PluginInfo pluginInfo =
{
    name = "test2",
    version = "0.0.0",
    author = "author",
    url = "https://github.com/Amaroq7/SPMod"
};

public void OnPluginInit()
{
    int SayText = GetUserMsgId("SayText");
    printToServer("Message SayText = %d\n", SayText);
    char msgname[32];
    GetUserMsgName(SayText, msgname, sizeof msgname - 1);
    printToServer("Message %d = %s\n", SayText, msgname);
}

public void OnClientPutInServer(int client)
{
    int SayText = GetUserMsgId("SayText");
    MessageBegin(MSG_ALL, SayText, {0, 0, 0});
    WriteByte(client);
    WriteString("\1Test\3Hello");
    MessageEnd();
}

Other cases difficult to test without own cmd registration

Screenshots (if appropriate):

Types of changes

Checklist:

Amaroq7 commented 6 years ago

LGTM. Thanks!