Raised This Month: $350 Target: $400
 87%   Almost there!

Solved What does "error 092: number of arg..." mean?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
iskenderkebab33
Senior Member
Join Date: Jun 2018
Old 03-08-2019 , 16:36   What does "error 092: number of arg..." mean?
Reply With Quote #1

Hello, i have error in my code error 092: number of arguments does not match definition, for what is this error?

the plugin should add kills amount of player in players ClanTag, like: [12 Kills] and after other kills [13 Kills]...

PHP Code:
...

for (
int i 1<= MaxClientsi++)
{
     if (!
IsClientInGame(i))continue;
     
CS_SetClientClanTag(i"[%d Kills]"g_Kills[i]); // error here
}

... 

Last edited by iskenderkebab33; 03-08-2019 at 20:03.
iskenderkebab33 is offline
nosoop
Veteran Member
Join Date: Aug 2014
Old 03-08-2019 , 18:56   Re: What does "error 092: number of arg..." mean?
Reply With Quote #2

CS_SetClientClanTag only takes two arguments: the client index and a string for the tag.

It doesn't take format arguments.
__________________
I do TF2, TF2 servers, and TF2 plugins.
I don't do DMs over Discord -- PM me on the forums regarding inquiries.
AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)
nosoop is offline
iskenderkebab33
Senior Member
Join Date: Jun 2018
Old 03-08-2019 , 19:15   Re: What does "error 092: number of arg..." mean?
Reply With Quote #3

Quote:
Originally Posted by nosoop View Post
CS_SetClientClanTag only takes two arguments: the client index and a string for the tag.

It doesn't take format arguments.
so what is wrong in this code? dont understand it :/
iskenderkebab33 is offline
Vaggelis
Senior Member
Join Date: May 2017
Old 03-08-2019 , 19:23   Re: What does "error 092: number of arg..." mean?
Reply With Quote #4

It should be like this CS_SetClientClanTag(i, g_Kills[i]) but you cant use g_Kills[i] because its a integer variable, it needs to be a string
Vaggelis is offline
adma
Senior Member
Join Date: Oct 2015
Old 03-08-2019 , 19:47   Re: What does "error 092: number of arg..." mean?
Reply With Quote #5

Like nosoop said, CS_SetClientClanTag does not take format arguments, so you must build your string (using Format) and then pass the built string to CS_SetClientClanTag. Example below using your code:

PHP Code:
...

char sTag[64]; // Create tag buffer
for (int i 1<= MaxClientsi++)
{
     if (!
IsClientInGame(i)) continue;
     
Format(sTagsizeof(sTag), "[%d Kills]"g_Kills[i]); // Build the string using Format(), which takes format arguments
     
CS_SetClientClanTag(isTag); // Set the client tag to the built string
}

... 
adma is offline
iskenderkebab33
Senior Member
Join Date: Jun 2018
Old 03-08-2019 , 20:03   Re: What does "error 092: number of arg..." mean?
Reply With Quote #6

Quote:
Originally Posted by adma View Post
Like nosoop said, CS_SetClientClanTag does not take format arguments, so you must build your string (using Format) and then pass the built string to CS_SetClientClanTag. Example below using your code:

PHP Code:
...

char sTag[64]; // Create tag buffer
for (int i 1<= MaxClientsi++)
{
     if (!
IsClientInGame(i)) continue;
     
Format(sTagsizeof(sTag), "[%d Kills]"g_Kills[i]); // Build the string using Format(), which takes format arguments
     
CS_SetClientClanTag(isTag); // Set the client tag to the built string
}

... 
thanks, working!
iskenderkebab33 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 12:45.


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