Raised This Month: $ Target: $400
 0% 

Solved I need Fast Help, i can't compiler


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Danielej1
Senior Member
Join Date: Jul 2022
Location: Poland
Old 12-30-2022 , 16:16   I need Fast Help, i can't compiler
Reply With Quote #1

error 147 new-style declarations are required

Code:
plugin:
public Action:OnCommandStealth(int client)
{
    PrintToChatAll(client, "VIP - \x10[%s] \x01Wyszedl z Serwera \x10RamdomSkills\x01. ");
}
what's is problem?

Last edited by Danielej1; 01-01-2023 at 09:36.
Danielej1 is offline
alasfourom
Senior Member
Join Date: Feb 2022
Location: Saudi Arabia
Old 12-30-2022 , 19:21   Re: I need Fast Help, i can't compiler
Reply With Quote #2

You can't PrintToChatAll then specify client
Second issue, this string [%s], will not display anything to you

Anyway, You can either do this (Text will be dispalyed to everyone):
Code:
PrintToChatAll("VIP - \x10[%s] \x01Wyszedl z Serwera \x10RamdomSkills\x01. ");
or this (Text will be shown to you only):
Code:
PrintToChat(client, "VIP - \x10[%s] \x01Wyszedl z Serwera \x10RamdomSkills\x01. ");
__________________
alasfourom is offline
boink
Member
Join Date: May 2021
Location: Australia
Old 12-31-2022 , 01:21   Re: I need Fast Help, i can't compiler
Reply With Quote #3

Following this guide: https://wiki.alliedmods.net/SourcePa...itional_Syntax

Your code should be:

Code:
public Action OnCommandStealth(int client)
{
    PrintToChatAll("VIP - \x10[%s] \x01Wyszedl z Serwera \x10RamdomSkills\x01. ");
}
__________________
@.boink. on Discord | DM for Plugin Requests | Tip Jar
boink is offline
Danielej1
Senior Member
Join Date: Jul 2022
Location: Poland
Old 12-31-2022 , 07:16   Re: I need Fast Help, i can't compiler
Reply With Quote #4

Then how can I make it so that when I type this command the nickname is displayed in "[%s]"? of every Player who types this command? and At the top, this solution does not work, pops up errors such as:


Code:
L 12/31/2022 - 14:24:30: [SM] Exception reported: String formatted incorrectly - parameter 2 (total 1)
L 12/31/2022 - 14:24:30: [SM] Blaming: stealth-msg.smx
L 12/31/2022 - 14:24:30: [SM] Call stack trace:
L 12/31/2022 - 14:24:30: [SM] [0] VFormat
L 12/31/2022 - 14:24:30: [SM] [1] Line 388, halflife::PrintToChatAll
L 12/31/2022 - 14:24:30: [SM] [2] Line 19, C:\Users\danie\OneDrive\Pulpit\Nowy folder\stealth-msg.sp::STEALTH

Last edited by Danielej1; 12-31-2022 at 08:41.
Danielej1 is offline
Lantejoula
Senior Member
Join Date: Mar 2021
Location: Portugal
Old 12-31-2022 , 09:48   Re: I need Fast Help, i can't compiler
Reply With Quote #5

Quote:
Originally Posted by Danielej1 View Post
Then how can I make it so that when I type this command the nickname is displayed in "[%s]"? of every Player who types this command? and At the top, this solution does not work, pops up errors such as:


Code:
L 12/31/2022 - 14:24:30: [SM] Exception reported: String formatted incorrectly - parameter 2 (total 1)
L 12/31/2022 - 14:24:30: [SM] Blaming: stealth-msg.smx
L 12/31/2022 - 14:24:30: [SM] Call stack trace:
L 12/31/2022 - 14:24:30: [SM] [0] VFormat
L 12/31/2022 - 14:24:30: [SM] [1] Line 388, halflife::PrintToChatAll
L 12/31/2022 - 14:24:30: [SM] [2] Line 19, C:\Users\danie\OneDrive\Pulpit\Nowy folder\stealth-msg.sp::STEALTH

You need to put in "%s" the name of the player. Try the code below:
Quote:
public Action OnCommandStealth(int client)
{
char name[MAX_NAME_LENGTH];
GetClientName(client, name, sizeof(name));
PrintToChatAll("VIP - \x10[%s] \x01Wyszedl z Serwera \x10RamdomSkills\x01.", name);
}
__________________
Discord ➜ Lantejoula#0064 | Steam | Want Help? Add Me!!

Last edited by Lantejoula; 12-31-2022 at 09:49.
Lantejoula is offline
Danielej1
Senior Member
Join Date: Jul 2022
Location: Poland
Old 12-31-2022 , 10:05   Re: I need Fast Help, i can't compiler
Reply With Quote #6

stealth-msg.sp(14) : error 100: function prototypes do not match
Attached Files
File Type: sp Get Plugin or Get Source (stealth-msg.sp - 158 views - 453 Bytes)

Last edited by Danielej1; 12-31-2022 at 11:37.
Danielej1 is offline
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 12-31-2022 , 12:51   Re: I need Fast Help, i can't compiler
Reply With Quote #7

Quote:
Originally Posted by Danielej1 View Post
stealth-msg.sp(14) : error 100: function prototypes do not match
PHP Code:
public void OnPluginStart()
{
    
RegConsoleCmd("sm_stealth"OnCommandStealth);
}

public 
Action OnCommandStealth(int clientint args)
{
    if(
clientPrintToChatAll("VIP - \x10[%N] \x01Wyszedl z Serwera \x10RamdomSkills\x01."client);
    return 
Plugin_Handled;

__________________
Grey83 is offline
Lantejoula
Senior Member
Join Date: Mar 2021
Location: Portugal
Old 01-01-2023 , 09:09   Re: I need Fast Help, i can't compiler
Reply With Quote #8

Quote:
Originally Posted by Danielej1 View Post
stealth-msg.sp(14) : error 100: function prototypes do not match
You forgot to put "int args" in the line "public Action OnCommandStealth(int client, int args)"
Test this version!
Attached Files
File Type: sp Get Plugin or Get Source (stealth-msg.sp - 184 views - 471 Bytes)
File Type: smx stealth-msg.smx (3.1 KB, 168 views)
__________________
Discord ➜ Lantejoula#0064 | Steam | Want Help? Add Me!!
Lantejoula is offline
Danielej1
Senior Member
Join Date: Jul 2022
Location: Poland
Old 01-01-2023 , 09:35   Re: I need Fast Help, i can't compiler
Reply With Quote #9

Quote:
Originally Posted by Lantejoula View Post
You forgot to put "int args" in the line "public Action OnCommandStealth(int client, int args)"
Test this version!
Thanks u this plugin work !!
Danielej1 is offline
Lantejoula
Senior Member
Join Date: Mar 2021
Location: Portugal
Old 01-02-2023 , 11:55   Re: I need Fast Help, i can't compiler
Reply With Quote #10

You're welcome. If you need anything, contact me on discord. Thanks
__________________
Discord ➜ Lantejoula#0064 | Steam | Want Help? Add Me!!
Lantejoula 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 01:25.


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