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

simple plugin won't load, says "bad header"


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
badlet
Junior Member
Join Date: May 2020
Old 05-26-2020 , 21:31   simple plugin won't load, says "bad header"
Reply With Quote #1

Hi all. I'm new to scripting but I'm trying to create a fairly simple script that swaps the classes of two players. However, I'm getting the above error message and don't know how to fix it. Any help is appreciated.

Code:
#pragma semicolon 1;

#include <sourcemod>
#include <tf2>
#include <tf2_stocks>

#define PLUGIN_VERSION "1.2"
 
new Handle:cs_enabled = INVALID_HANDLE;
new Handle:swapclass = INVALID_HANDLE;
 
public Plugin:myinfo =
{
	name = "Class Swap",
	author = "badlet",
	description = "you become their class, they become yours",
	version = PLUGIN_VERSION,
};

public OnPluginStart()
{

   new person1_id = GetEventInt(event, "userid1");
   new person2_id = GetEventInt(event, "userid2");

   new person1 = GetClientofUserID(person1_id);
   new person2 = GetClientofUserID(person2_id);
   
   RegAdminCmd("sm_cs_enable",Command_enable,ADMFLAG_SLAY,"Enable class swap");
   RegAdminCmd("sm_cs_disable",Command_disable,ADMFLAG_SLAY,"Disable class swap");
   RegAdminCmd("sm_swapclass",Command_Swapclass,ADMFLAG_SLAY,"Swap classes");
}

public Action:Command_Swapclass(client, args)
{
	if(args != 2)
	{
		ReplyToCommand(client, "[SM] Usage: sm_swapclass \"target1\" \"target2\"");
	}
	else
	{
		TF2_SetPlayerClass(person1, TFClassType:TF2_GetPlayerClass(person2, 0, 1);
		TF2_SetPlayerClass(person2, TFClassType:TF2_GetPlayerClass(person1, 0, 1);	
	
	}
}

public Action:Command_enable(client, args)
{
	cs_enabled=true;
	ReplyToCommand(client,"Class Swap Enabled");
}

public Action:Command_disable(client, args)
{
	cs_enabled=false;
	ReplyToCommand(client,"Class Swap Disabled");
}
badlet is offline
 



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:41.


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