Raised This Month: $442 Target: $400
 110% 

Basechat - Native "Panel.Style.get" was not found


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HiddenConn1
AlliedModders Donor
Join Date: Aug 2009
Location: Cambridge, UK
Old 04-07-2018 , 14:26   Basechat - Native "Panel.Style.get" was not found
Reply With Quote #1

Strange that I am getting this error from SM.
Quote:
L 04/07/2018 - 19:22:48: [SM] Unable to load plugin "basechat.smx": Native "Panel.Style.get" was not found
PHP Code:
/**
 * vim: set ts=4 :
 * =============================================================================
 * SourceMod Basic Chat Plugin
 * Implements basic communication commands.
 *
 * SourceMod (C)2004-2008 AlliedModders LLC.  All rights reserved.
 * =============================================================================
 *
 * This program is free software; you can redistribute it and/or modify it under
 * the terms of the GNU General Public License, version 3.0, as published by the
 * Free Software Foundation.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * As a special exception, AlliedModders LLC gives you permission to link the
 * code of this program (as well as its derivative works) to "Half-Life 2," the
 * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
 * by the Valve Corporation.  You must obey the GNU General Public License in
 * all respects for all other code used.  Additionally, AlliedModders LLC grants
 * this exception to all derivative works.  AlliedModders LLC defines further
 * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
 * or <http://www.sourcemod.net/license.php>.
 *
 * Version: $Id$
 */

#pragma semicolon 1

#include <sourcemod>

#pragma newdecls required

public Plugin myinfo 
{
    
name "Basic Chat",
    
author "AlliedModders LLC",
    
description "Basic Communication Commands",
    
version SOURCEMOD_VERSION,
    
url "http://www.sourcemod.net/"
};

#define CHAT_SYMBOL '@'

char g_ColorNames[13][10] = {"White""Red""Green""Blue""Yellow""Purple""Cyan""Orange""Pink""Olive""Lime""Violet""Lightblue"};
int g_Colors[13][3] = {{255,255,255},{255,0,0},{0,255,0},{0,0,255},{255,255,0},{255,0,255},{0,255,255},{255,128,0},{255,0,128},{128,255,0},{0,255,128},{128,0,255},{0,128,255}};

ConVar g_Cvar_Chatmode;

EngineVersion g_GameEngine Engine_Unknown;

public 
void OnPluginStart()
{
    
LoadTranslations("common.phrases");
    
    
g_GameEngine GetEngineVersion();

    
g_Cvar_Chatmode CreateConVar("sm_chat_mode""1""Allows player's to send messages to admin chat."0true0.0true1.0);

    
RegAdminCmd("sm_say"Command_SmSayADMFLAG_CHAT"sm_say <message> - sends message to all players");
    
RegAdminCmd("sm_csay"Command_SmCsayADMFLAG_CHAT"sm_csay <message> - sends centered message to all players");
    
    
/* HintText does not work on Dark Messiah */
    
if (g_GameEngine != Engine_DarkMessiah)
    {
        
RegAdminCmd("sm_hsay"Command_SmHsayADMFLAG_CHAT"sm_hsay <message> - sends hint message to all players");    
    }
    
    
RegAdminCmd("sm_tsay"Command_SmTsayADMFLAG_CHAT"sm_tsay [color] <message> - sends top-left message to all players");
    
RegAdminCmd("sm_chat"Command_SmChatADMFLAG_CHAT"sm_chat <message> - sends message to admins");
    
RegAdminCmd("sm_psay"Command_SmPsayADMFLAG_CHAT"sm_psay <name or #userid> <message> - sends private message");
    
RegAdminCmd("sm_msay"Command_SmMsayADMFLAG_CHAT"sm_msay <message> - sends message as a menu panel");
}

public 
Action OnClientSayCommand(int client, const char[] command, const char[] sArgs)
{
    
int startidx;
    if (
sArgs[startidx] != CHAT_SYMBOL)
        return 
Plugin_Continue;
    
    
startidx++;
    
    if (
strcmp(command"say"false) == 0)
    {
        if (
sArgs[startidx] != CHAT_SYMBOL// sm_say alias
        
{
            if (!
CheckCommandAccess(client"sm_say"ADMFLAG_CHAT))
            {
                return 
Plugin_Continue;
            }
            
            
SendChatToAll(clientsArgs[startidx]);
            
LogAction(client, -1"\"%L\" triggered sm_say (text %s)"clientsArgs[startidx]);
            
            return 
Plugin_Stop;
        }
        
        
startidx++;

        if (
sArgs[startidx] != CHAT_SYMBOL// sm_psay alias
        
{
            if (!
CheckCommandAccess(client"sm_psay"ADMFLAG_CHAT))
            {
                return 
Plugin_Continue;
            }
            
            
char arg[64];
            
            
int len BreakString(sArgs[startidx], argsizeof(arg));
            
int target FindTarget(clientargtruefalse);
            
            if (
target == -|| len == -1)
                return 
Plugin_Stop;
            
            
SendPrivateChat(clienttargetsArgs[startidx+len]);
            
            return 
Plugin_Stop;
        }
        
        
startidx++;
        
        
// sm_csay alias
        
if (!CheckCommandAccess(client"sm_csay"ADMFLAG_CHAT))
        {
            return 
Plugin_Continue;
        }
        
        
DisplayCenterTextToAll(clientsArgs[startidx]);
        
LogAction(client, -1"\"%L\" triggered sm_csay (text %s)"clientsArgs[startidx]);
        
        return 
Plugin_Stop;
    }
    else if (
strcmp(command"say_team"false) == || strcmp(command"say_squad"false) == 0)
    {
        if (!
CheckCommandAccess(client"sm_chat"ADMFLAG_CHAT) && !g_Cvar_Chatmode.BoolValue)
        {
            return 
Plugin_Continue;
        }
        
        
SendChatToAdmins(clientsArgs[startidx]);
        
LogAction(client, -1"\"%L\" triggered sm_chat (text %s)"clientsArgs[startidx]);
        
        return 
Plugin_Stop;
    }
    
    return 
Plugin_Continue;
}

public 
Action Command_SmSay(int clientint args)
{
    if (
args 1)
    {
        
ReplyToCommand(client"[SM] Usage: sm_say <message>");
        return 
Plugin_Handled;    
    }
    
    
char text[192];
    
GetCmdArgString(textsizeof(text));

    
SendChatToAll(clienttext);
    
LogAction(client, -1"\"%L\" triggered sm_say (text %s)"clienttext);
    
    return 
Plugin_Handled;        
}

public 
Action Command_SmCsay(int clientint args)
{
    if (
args 1)
    {
        
ReplyToCommand(client"[SM] Usage: sm_csay <message>");
        return 
Plugin_Handled;    
    }
    
    
char text[192];
    
GetCmdArgString(textsizeof(text));
    
    
DisplayCenterTextToAll(clienttext);
    
    
LogAction(client, -1"\"%L\" triggered sm_csay (text %s)"clienttext);
    
    return 
Plugin_Handled;        
}

public 
Action Command_SmHsay(int clientint args)
{
    if (
args 1)
    {
        
ReplyToCommand(client"[SM] Usage: sm_hsay <message>");
        return 
Plugin_Handled;  
    }
    
    
char text[192];
    
GetCmdArgString(textsizeof(text));
 
    
char nameBuf[MAX_NAME_LENGTH];
    
    for (
int i 1<= MaxClientsi++)
    {
        if (!
IsClientInGame(i) || IsFakeClient(i))
        {
            continue;
        }
        
FormatActivitySource(clientinameBufsizeof(nameBuf));
        
PrintHintText(i"%s: %s"nameBuftext);
    }
    
    
LogAction(client, -1"\"%L\" triggered sm_hsay (text %s)"clienttext);
    
    return 
Plugin_Handled;    
}

public 
Action Command_SmTsay(int clientint args)
{
    if (
args 1)
    {
        
ReplyToCommand(client"[SM] Usage: sm_tsay <message>");
        return 
Plugin_Handled;  
    }
    
    
char text[192], colorStr[16];
    
GetCmdArgString(textsizeof(text));
    
    
int len BreakString(textcolorStr16);
        
    
int color FindColor(colorStr);
    
char nameBuf[MAX_NAME_LENGTH];
    
    if (
color == -1)
    {
        
color 0;
        
len 0;
    }
    
    for (
int i 1<= MaxClientsi++)
    {
        if (!
IsClientInGame(i) || IsFakeClient(i))
        {
            continue;
        }
        
FormatActivitySource(clientinameBufsizeof(nameBuf));
        
SendDialogToOne(icolor"%s: %s"nameBuftext[len]);
    }

    
LogAction(client, -1"\"%L\" triggered sm_tsay (text %s)"clienttext);
    
    return 
Plugin_Handled;    
}

public 
Action Command_SmChat(int clientint args)
{
    if (
args 1)
    {
        
ReplyToCommand(client"[SM] Usage: sm_chat <message>");
        return 
Plugin_Handled;    
    }    
    
    
char text[192];
    
GetCmdArgString(textsizeof(text));

    
SendChatToAdmins(clienttext);
    
LogAction(client, -1"\"%L\" triggered sm_chat (text %s)"clienttext);
    
    return 
Plugin_Handled;    
}

public 
Action Command_SmPsay(int clientint args)
{
    if (
args 2)
    {
        
ReplyToCommand(client"[SM] Usage: sm_psay <name or #userid> <message>");
        return 
Plugin_Handled;    
    }    
    
    
char text[192], arg[64], message[192];
    
GetCmdArgString(textsizeof(text));

    
int len BreakString(textargsizeof(arg));
    
BreakString(text[len], messagesizeof(message));
    
    
int target FindTarget(clientargtruefalse);
        
    if (
target == -1)
        return 
Plugin_Handled;    
    
    
SendPrivateChat(clienttargetmessage);
    
    return 
Plugin_Handled;    
}

public 
Action Command_SmMsay(int clientint args)
{
    if (
args 1)
    {
        
ReplyToCommand(client"[SM] Usage: sm_msay <message>");
        return 
Plugin_Handled;    
    }
    
    
char text[192];
    
GetCmdArgString(textsizeof(text));

    
SendPanelToAll(clienttext);

    
LogAction(client, -1"\"%L\" triggered sm_msay (text %s)"clienttext);
    
    return 
Plugin_Handled;        
}

int FindColor(const char[] color)
{
    for (
int i 0sizeof(g_ColorNames); i++)
    {
        if (
strcmp(colorg_ColorNames[i], false) == 0)
            return 
i;
    }
    
    return -
1;
}

void SendChatToAll(int client, const char[] message)
{
    
char nameBuf[MAX_NAME_LENGTH];
    
    for (
int i 1<= MaxClientsi++)
    {
        if (!
IsClientInGame(i) || IsFakeClient(i))
        {
            continue;
        }
        
FormatActivitySource(clientinameBufsizeof(nameBuf));
        
        
PrintToChat(i"\x03(ADMIN) %s: \x01%s"nameBufmessage);
    }
}

void DisplayCenterTextToAll(int client, const char[] message)
{
    
char nameBuf[MAX_NAME_LENGTH];
    
    for (
int i 1<= MaxClientsi++)
    {
        if (!
IsClientInGame(i) || IsFakeClient(i))
        {
            continue;
        }
        
FormatActivitySource(clientinameBufsizeof(nameBuf));
        
PrintCenterText(i"%s: %s"nameBufmessage);
    }
}

void SendChatToAdmins(int from, const char[] message)
{
    
int fromAdmin CheckCommandAccess(from"sm_chat"ADMFLAG_CHAT);
    for (
int i 1<= MaxClientsi++)
    {
        if (
IsClientInGame(i) && (from == || CheckCommandAccess(i"sm_chat"ADMFLAG_CHAT)))
        {
            
PrintToChat(i"\x04(%sADMIN CHAT) %N: \x01%s"fromAdmin "" "TO "frommessage);
        }    
    }
}

void SendDialogToOne(int clientint color, const char[] textany ...)
{
    
char message[100];
    
VFormat(messagesizeof(message), text4);    
    
    
KeyValues kv = new KeyValues("Stuff""title"message);
    
kv.SetColor("color"g_Colors[color][0], g_Colors[color][1], g_Colors[color][2], 255);
    
kv.SetNum("level"1);
    
kv.SetNum("time"10);
    
    
CreateDialog(clientkvDialogType_Msg);

    
delete kv;
}

void SendPrivateChat(int clientint target, const char[] message)
{
    if (!
client)
    {
        
PrintToServer("(server) PM to %N %N: %s"targetclientmessage);
    }
    else if (
target != client)
    {
        
PrintToChat(client"\x04(server) PM to %N %N: \x01%s"targetclientmessage);
    }

    
PrintToChat(target"\x04(server) PM from %N) %N: \x01%s"targetclientmessage);
    
LogAction(client, -1"\"%L\" triggered sm_psay to \"%L\" (text %s)"clienttargetmessage);
}

void SendPanelToAll(int fromchar[] message)
{
    
char title[100];
    
Format(title64"%N:"from);
    
    
ReplaceString(message192"\\n""\n");
    
    
Panel mSayPanel = new Panel();
    
mSayPanel.SetTitle(title);
    
mSayPanel.DrawItem(""ITEMDRAW_SPACER);
    
mSayPanel.DrawText(message);
    
mSayPanel.DrawItem(""ITEMDRAW_SPACER);

    
mSayPanel.CurrentKey GetMaxPageItems(mSayPanel.Style);
    
mSayPanel.DrawItem("Exit"ITEMDRAW_CONTROL);

    for(
int i 1<= MaxClientsi++)
    {
        if(
IsClientInGame(i) && !IsFakeClient(i))
        {
            
mSayPanel.Send(iHandler_DoNothing10);
        }
    }

    
delete mSayPanel;
}

public 
int Handler_DoNothing(Menu menuMenuAction actionint param1int param2)
{
    
/* Do nothing */

__________________

Last edited by HiddenConn1; 04-07-2018 at 14:27.
HiddenConn1 is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 04-07-2018 , 14:38   Re: Basechat - Native "Panel.Style.get" was not found
Reply With Quote #2

You're apparently using a very old version of SM with a more recent version of basechat. This change was made in December 2016.
Fyren is offline
HiddenConn1
AlliedModders Donor
Join Date: Aug 2009
Location: Cambridge, UK
Old 04-07-2018 , 15:11   Re: Basechat - Native "Panel.Style.get" was not found
Reply With Quote #3

This version is directly from the stable plugins part of the downloads section of AM. O.o
__________________
HiddenConn1 is offline
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 04-08-2018 , 08:30   Re: Basechat - Native "Panel.Style.get" was not found
Reply With Quote #4

Make sure the sourcemod version on your server is up to date too, not only the plugin you downloaded.
__________________
Peace-Maker is offline
HiddenConn1
AlliedModders Donor
Join Date: Aug 2009
Location: Cambridge, UK
Old 04-08-2018 , 11:23   Re: Basechat - Native "Panel.Style.get" was not found
Reply With Quote #5

Quote:
Originally Posted by Peace-Maker View Post
Make sure the sourcemod version on your server is up to date too, not only the plugin you downloaded.
Thanks. I reuploaded the new SM version and replaced the old ones and it's fine now.
__________________
HiddenConn1 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 17:44.


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