Raised This Month: $32 Target: $400
 8% 

number of arguments does not match definition


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
szogun
Senior Member
Join Date: Apr 2016
Old 01-21-2023 , 17:57   number of arguments does not match definition
Reply With Quote #1

Hey, can someone help me correct this

PHP Code:
#include <sourcemod>

public void OnPluginStart()
{
    
RegConsoleCmd("sm_code"Command_Test);
}

public 
Action Command_Test(int clientint args)
{
    
char sBuffer[512];
    
Format(sBuffersizeof(sBuffer), "%s\n "sBuffer);

    
Event eEvent CreateEvent("cs_win_panel_round"true);
    
eEvent.SetString("funfact_token""<b><font color='#ffa500' class='fontSize-xl'>TEXT</font></b> %s\n TEXT TEXT"sBuffer);  
    
eEvent.SetInt("hint_timeout"10); 
    
eEvent.SetInt("userid", -1);
    
eEvent.FireToClient(client);
    
eEvent.Cancel();

HTML Code:
error 092: number of arguments does not match definition
szogun is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 01-21-2023 , 20:30   Re: number of arguments does not match definition
Reply With Quote #2

You should not ignore the number before the error (14)

Code:
.sp(14) : error 092: number of arguments does not match definition
Means that your error is on line 14, which is:

PHP Code:
eEvent.SetString("funfact_token""<b><font color='#ffa500' class='fontSize-xl'>TEXT</font></b> %s\n TEXT TEXT"sBuffer); 
https://sm.alliedmods.net/new-api/ev...vent/SetString

SetString only receives two parameters and you are passing three.


Try:

PHP Code:
#include <sourcemod>

public void OnPluginStart()
{
    
RegConsoleCmd("sm_code"Command_Test);
}

public 
Action Command_Test(int clientint args)
{
    
char sBuffer[512];
    
FormatEx(sBuffersizeof(sBuffer), "<b><font color='#ffa500' class='fontSize-xl'>TEXT</font></b> %s\n TEXT TEXT"sBuffer);

    
Event eEvent CreateEvent("cs_win_panel_round"true);
    
eEvent.SetString("funfact_token"sBuffer);
    
eEvent.SetInt("hint_timeout"10);
    
eEvent.SetInt("userid", -1);
    
eEvent.FireToClient(client);
    
eEvent.Cancel();

    return 
Plugin_Handled;

__________________
Marttt 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 02:08.


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