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

help with error 147: new-style declarations are required


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
jeksot
Junior Member
Join Date: May 2019
Old 10-27-2020 , 15:14   help with error 147: new-style declarations are required
Reply With Quote #1

hello, first of all the main plugin from: https://forums.alliedmods.net/showthread.php?t=326093
Im trying to change color processor to simple chat processor, (insurgency trouble) so i want to do with scp. I have already done some corrects with errors, via spider.limetech .io/.

Code:
#include <sourcemod>
#include <scp>
#undef REQUIRE_PLUGIN
#include <discord_utilities>
#include <SWGM>


char g_sChatTagSteam[20], g_sChatTagDiscord[20];

ConVar g_cSteamMemberTag, 
g_cDiscordMemberTag, 
g_cSteamOrDiscord;

#pragma semicolon 1
#pragma newdecls required

public Plugin myinfo = 
{
	name = "MemberTag", 
	author = "Nano", 
	description = "Gives a custom chat tag for those who are in steam group or discord server.", 
	version = "1.2", 
	url = "https://steamcommunity.com/id/marianzet1/"
};

public void OnPluginStart()
{
	g_cSteamOrDiscord = CreateConVar("sm_member_tag_system", "1", "What do you want to use?. 1 = Steam Group | 2 = Discord. 1 Default");
	g_cSteamMemberTag = CreateConVar("sm_member_tag_steam", "[MEMBER]", "Prefix for those who are in steam group");
	g_cDiscordMemberTag = CreateConVar("sm_member_tag_discord", "[DISCORD-MEMBER]", "Prefix for those who are in a discord server");
	
	AutoExecConfig(true, "MemberTag");
}

public void OnMapStart()
{
	g_cSteamMemberTag.GetString(g_sChatTagSteam, sizeof(g_sChatTagSteam));
	g_cDiscordMemberTag.GetString(g_sChatTagDiscord, sizeof(g_sChatTagDiscord));
}

public Action OnChatMessage(&iClient, Handle:hRecipients, String:sName[], String:sMessage[])
{
	if (IsClientInGame(iClient))
	{
		if (!CheckCommandAccess(iClient, "sm_membertag_override", ADMFLAG_BAN))
		{
			if (g_cSteamOrDiscord.IntValue == 1)
			{
				if (SWGM_IsPlayerValidated(iClient) && SWGM_InGroup(iClient))
				{
					char sTag[40];
					Format(sTag, sizeof(sTag), "\x04%s\x03", g_sChatTagSteam);
					
					Format(sName, MAXLENGTH_MESSAGE, " %s %s", sTag, sName);
					return Plugin_Changed;
				}
			}
			else if (g_cSteamOrDiscord.IntValue == 2)
			{
				if (DU_IsMember(iClient))
				{
					char sTag[40];
					Format(sTag, sizeof(sTag), "\x04%s\x03", g_sChatTagDiscord);
					
					Format(sName, MAXLENGTH_MESSAGE, " %s %s", sTag, sName);
					return Plugin_Changed;
				}
			}
		}
	}
	
	return Plugin_Continue;
}
(41) : error 147: new-style declarations are required.
how to do work it correctly. HELP ME PLS.

sorry for eng.
jeksot is offline
SSheriFF
AlliedModders Donor
Join Date: May 2020
Location: Israel
Old 10-27-2020 , 15:54   Re: help with error 147: new-style declarations are required
Reply With Quote #2

Quote:
Originally Posted by jeksot View Post
hello, first of all the main plugin from: https://forums.alliedmods.net/showthread.php?t=326093
Im trying to change color processor to simple chat processor, (insurgency trouble) so i want to do with scp. I have already done some corrects with errors, via spider.limetech .io/.

Code:
#include <sourcemod>
#include <scp>
#undef REQUIRE_PLUGIN
#include <discord_utilities>
#include <SWGM>


char g_sChatTagSteam[20], g_sChatTagDiscord[20];

ConVar g_cSteamMemberTag, 
g_cDiscordMemberTag, 
g_cSteamOrDiscord;

#pragma semicolon 1
#pragma newdecls required

public Plugin myinfo = 
{
	name = "MemberTag", 
	author = "Nano", 
	description = "Gives a custom chat tag for those who are in steam group or discord server.", 
	version = "1.2", 
	url = "https://steamcommunity.com/id/marianzet1/"
};

public void OnPluginStart()
{
	g_cSteamOrDiscord = CreateConVar("sm_member_tag_system", "1", "What do you want to use?. 1 = Steam Group | 2 = Discord. 1 Default");
	g_cSteamMemberTag = CreateConVar("sm_member_tag_steam", "[MEMBER]", "Prefix for those who are in steam group");
	g_cDiscordMemberTag = CreateConVar("sm_member_tag_discord", "[DISCORD-MEMBER]", "Prefix for those who are in a discord server");
	
	AutoExecConfig(true, "MemberTag");
}

public void OnMapStart()
{
	g_cSteamMemberTag.GetString(g_sChatTagSteam, sizeof(g_sChatTagSteam));
	g_cDiscordMemberTag.GetString(g_sChatTagDiscord, sizeof(g_sChatTagDiscord));
}

public Action OnChatMessage(&iClient, Handle:hRecipients, String:sName[], String:sMessage[])
{
	if (IsClientInGame(iClient))
	{
		if (!CheckCommandAccess(iClient, "sm_membertag_override", ADMFLAG_BAN))
		{
			if (g_cSteamOrDiscord.IntValue == 1)
			{
				if (SWGM_IsPlayerValidated(iClient) && SWGM_InGroup(iClient))
				{
					char sTag[40];
					Format(sTag, sizeof(sTag), "\x04%s\x03", g_sChatTagSteam);
					
					Format(sName, MAXLENGTH_MESSAGE, " %s %s", sTag, sName);
					return Plugin_Changed;
				}
			}
			else if (g_cSteamOrDiscord.IntValue == 2)
			{
				if (DU_IsMember(iClient))
				{
					char sTag[40];
					Format(sTag, sizeof(sTag), "\x04%s\x03", g_sChatTagDiscord);
					
					Format(sName, MAXLENGTH_MESSAGE, " %s %s", sTag, sName);
					return Plugin_Changed;
				}
			}
		}
	}
	
	return Plugin_Continue;
}
(41) : error 147: new-style declarations are required.
how to do work it correctly. HELP ME PLS.

sorry for eng.
change
PHP Code:
public Action OnChatMessage(&iClientHandle:hRecipientsString:sName[], String:sMessage[]) 
to
PHP Code:
public Action OnChatMessage(int &iClientHandle hRecipientschar[]sNamechar[]sMessage
__________________
Taking small private requests (Free) and big private requests (Paid).
Contact me via Discord: WilDick#1524

My Plugins:
SSheriFF is offline
jeksot
Junior Member
Join Date: May 2019
Old 10-27-2020 , 16:26   Re: help with error 147: new-style declarations are required
Reply With Quote #3

Quote:
Originally Posted by ssheriff View Post
change
PHP Code:
public action onchatmessage(&iclienthandle:hrecipientsstring:sname[], string:smessage[]) 
to
PHP Code:
public action onchatmessage(int &iclienthandle hrecipientschar[]snamechar[]smessage
all works thank you!

Last edited by jeksot; 10-27-2020 at 16:33.
jeksot is offline
jeksot
Junior Member
Join Date: May 2019
Old 10-27-2020 , 16:52   Re: help with error 147: new-style declarations are required
Reply With Quote #4

[SM] Exception reported: Native is not bound, mean, i need to create native for it?
jeksot is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 10-27-2020 , 17:06   Re: help with error 147: new-style declarations are required
Reply With Quote #5

...hey. What if you go one step back.

and comment this line, compile
PHP Code:
//#pragma newdecls required 
*edit
or can you show whole error ?

Last edited by Bacardi; 10-27-2020 at 17:07.
Bacardi is offline
jeksot
Junior Member
Join Date: May 2019
Old 10-27-2020 , 17:24   Re: help with error 147: new-style declarations are required
Reply With Quote #6

Quote:
Originally Posted by Bacardi View Post
...hey. What if you go one step back.

and comment this line, compile
PHP Code:
//#pragma newdecls required 
*edit
or can you show whole error ?
Code:
2020 - 23:59:20: [SM] Exception reported: Native is not bound
L 10/27/2020 - 23:59:20: [SM] Blaming: MemberTag.smx
L 10/27/2020 - 23:59:20: [SM] Call stack trace:
L 10/27/2020 - 23:59:20: [SM]   [0] SWGM_IsPlayerValidated
L 10/27/2020 - 23:59:20: [SM]   [1] Line 50, plugin.sp::OnChatMessage
L 10/27/2020 - 23:59:20: [SM]   [3] Call_Finish
L 10/27/2020 - 23:59:20: [SM]   [4] Line 387, D:\Libraries\Documents\Repos\Simple Chat Processor\scripting\simple-chatprocessor.sp::OnSayText2
L 10/27/2020 - 23:59:49: Error log file session closed.
jeksot is offline
jeksot
Junior Member
Join Date: May 2019
Old 10-27-2020 , 17:33   Re: help with error 147: new-style declarations are required
Reply With Quote #7

Quote:
Originally Posted by Bacardi View Post

and comment this line, compile
PHP Code:
//#pragma newdecls required 
Comment or type pragma optional?
jeksot is offline
SSheriFF
AlliedModders Donor
Join Date: May 2020
Location: Israel
Old 10-27-2020 , 17:38   Re: help with error 147: new-style declarations are required
Reply With Quote #8

Quote:
Originally Posted by jeksot View Post
Code:
2020 - 23:59:20: [SM] Exception reported: Native is not bound
L 10/27/2020 - 23:59:20: [SM] Blaming: MemberTag.smx
L 10/27/2020 - 23:59:20: [SM] Call stack trace:
L 10/27/2020 - 23:59:20: [SM]   [0] SWGM_IsPlayerValidated
L 10/27/2020 - 23:59:20: [SM]   [1] Line 50, plugin.sp::OnChatMessage
L 10/27/2020 - 23:59:20: [SM]   [3] Call_Finish
L 10/27/2020 - 23:59:20: [SM]   [4] Line 387, D:\Libraries\Documents\Repos\Simple Chat Processor\scripting\simple-chatprocessor.sp::OnSayText2
L 10/27/2020 - 23:59:49: Error log file session closed.
Do you run this plugin on your server? https://forums.alliedmods.net/showthread.php?p=2542856
__________________
Taking small private requests (Free) and big private requests (Paid).
Contact me via Discord: WilDick#1524

My Plugins:
SSheriFF is offline
jeksot
Junior Member
Join Date: May 2019
Old 10-27-2020 , 17:39   Re: help with error 147: new-style declarations are required
Reply With Quote #9

Quote:
Originally Posted by SSheriFF View Post
Do you run this plugin on your server? https://forums.alliedmods.net/showthread.php?p=2542856
Yep
jeksot is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 10-27-2020 , 20:13   Re: help with error 147: new-style declarations are required
Reply With Quote #10

Quote:
Originally Posted by jeksot View Post
Comment or type pragma optional?
That could work too. I actually never tested or used whole line.
Bacardi is offline
Reply



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


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