View Single Post
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 09-17-2021 , 04:58   Re: Error detected in plugin startup
Reply With Quote #4

In server console, try command: meta game
Code:
meta game
GameDLL Information
  Description: Counter-Strike: Source
  Mod Path: G:\server\counter-strike source\cstrike
  DLL Path: g:\server\counter-strike source\cstrike\bin\server.dll
  Interface: ServerGameDLL010
  Engine: Counter-Strike: Source (Valve Orange Box)
  User Messages:  Name                              Index  Size
                  Geiger                            0      1
                  Train                             1      1
                  HudText                           2      -1
                  SayText                           3      -1
                  SayText2                          4      -1
                  TextMsg                           5      -1
                  HudMsg                            6      -1
                  ResetHUD                          7      1
                  GameTitle                         8      0
                  ItemPickup                        9      -1
                  ShowMenu                          10     -1
                  Shake                             11     13
                  Fade                              12     10
                  VGUIMenu                          13     -1
                  Rumble                            14     3
                  CloseCaption                      15     -1
                  SendAudio                         16     -1
                  RawAudio                          17     -1
                  VoiceMask                         18     25
                  RequestState                      19     0
                  BarTime                           20     -1
                  Damage                            21     -1
                  RadioText                         22     -1
                  HintText                          23     -1
                  KeyHintText                       24     -1
                  ReloadEffect                      25     2
                  PlayerAnimEvent                   26     -1
                  AmmoDenied                        27     2
                  UpdateRadar                       28     -1
                  KillCam                           29     -1
                  MarkAchievement                   30     -1
                  CallVoteFailed                    31     -1
                  VoteStart                         32     -1
                  VotePass                          33     -1
                  VoteFailed                        34     2
                  VoteSetup                         35     -1
                  SPHapWeapEvent                    36     4
                  HapDmg                            37     -1
                  HapPunch                          38     -1
                  HapSetDrag                        39     -1
                  HapSetConst                       40     -1
                  HapMeleeContact                   41     0
                  PlayerStatsUpdate_DEPRECATED      42     -1
                  AchievementEvent                  43     -1
                  MatchEndConditions                44     -1
                  MatchStatsUpdate                  45     -1
                  PlayerStatsUpdate                 46     -1
  47 user messages in total

You could expand your code to check error.
Code:
public void OnPluginStart() {
    EngineVersion g_Game = GetEngineVersion();
    if(g_Game != Engine_Left4Dead && g_Game != Engine_Left4Dead2)
    {
        SetFailState("This plugin is for L4D/L4D2 only.");    
    }
    AddCommandListener(VoteStart, "callvote");

	UserMsg messageid;
	messageid = GetUserMessageId("VotePass");
	
	if( messageid == INVALID_MESSAGE_ID)
	{
		LogError("Game don't have User Message called - VotePass");
	}
	else
	{
		HookUserMessage(messageid, VotePassFail);
	}

	messageid = GetUserMessageId("VoteFail");

	if( messageid == INVALID_MESSAGE_ID)
	{
		LogError("Game don't have User Message called - VoteFail");
	}
	else
	{
		HookUserMessage(messageid, VotePassFail);
	}

    forceKickFFThreshold = CreateConVar("sm_votekick_force_threshold","0","The threshold of damage where the offending player is just immediately kicked. 0 -> Any attempted damage, -1 -> No auto kick.", FCVAR_NONE, true, -1.0);
__________________
Do not Private Message @me
Bacardi is offline