Raised This Month: $186 Target: $400
 46% 

Problem with float.inc


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TheiOne
Junior Member
Join Date: Mar 2017
Old 05-15-2018 , 07:46   Problem with float.inc
Reply With Quote #1

What does this error mean ?

Code:
L 05/15/2018 - 15:59:47: String formatted incorrectly - parameter 11 (total 10)
L 05/15/2018 - 15:59:47: [AMXX] Displaying debug trace (plugin "statsx_shell.amxx", version "1.8.3-dev+5154")
L 05/15/2018 - 15:59:47: [AMXX] Run time error 25: parameter error 
L 05/15/2018 - 15:59:47: [AMXX]    [0] float.inc::operator/(Float:,_:) (line 294)
L 05/15/2018 - 15:59:47: [AMXX]    [1] statsx_shell.sma::effec (line 923)
L 05/15/2018 - 15:59:47: [AMXX]    [2] statsx_shell.sma::cmdRank (line 2774)
This is "effec" :

Code:
Float:effec(izStats[8])
{
	if (!izStats[STATS_KILLS])
		return (0.0) // line 923
	
	return (100.0 * float(izStats[STATS_KILLS]) / float(izStats[STATS_KILLS] + izStats[STATS_DEATHS]))
}
And cmdRank:

Code:
public cmdRank(id)
{
	if (!SayRank)
	{
		client_print_color(id, print_team_red, "^3%L", id, "DISABLED_MSG")
		return PLUGIN_HANDLED
	}

	new izStats[8], izBody[8]
	new iRankPos, iRankMax
		
	iRankPos = get_user_stats(id, izStats, izBody)
	iRankMax = get_statsnum()
	
	client_print_color(id, id, "^4* %L", id, "YOUR_RANK_IS", iRankPos, iRankMax, izStats[STATS_KILLS], izStats[STATS_HITS], ((effec(izStats) + accuracy(izStats)) / 2))
	
	return PLUGIN_CONTINUE
}
As shown in the error message above I'm using AMXX 1.8.3.
TheiOne is offline
CrazY.
Veteran Member
Join Date: May 2015
Location: Brazil 🇧🇷
Old 05-15-2018 , 10:25   Re: Problem with float.inc
Reply With Quote #2

Hm, maybe:

Code:
Float:effec(izStats[8]) {     if (!izStats[STATS_KILLS])         return _:0.0 // line 923         return (100.0 * float(izStats[STATS_KILLS]) / float(izStats[STATS_KILLS] + izStats[STATS_DEATHS])) }

or also:

Code:
Float:effec(izStats[8]) {     if (!izStats[STATS_KILLS])         return _:0.0 // line 923         new result = 100 * izStats[STATS_KILLS] / (izStats[STATS_KILLS] + izStats[STATS_DEATHS]);     return float(result); }
__________________

I do private plugins, if interested, please contact ...


Last edited by CrazY.; 05-15-2018 at 10:30.
CrazY. is offline
Send a message via Skype™ to CrazY.
KliPPy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 05-15-2018 , 12:40   Re: Problem with float.inc
Reply With Quote #3

The stack trace is wrong for whatever reason, but this is the real error:
Code:
L 05/15/2018 - 15:59:47: String formatted incorrectly - parameter 11 (total 10)
You are missing one argument in client_print_color.
__________________
KliPPy is offline
TheiOne
Junior Member
Join Date: Mar 2017
Old 05-16-2018 , 10:44   Re: Problem with float.inc
Reply With Quote #4

Thanks guys for the replies.

@CrazY.

I tried both ways, but still it shows the same error.

@KliPPy

I think you're right, but I can't figure out what's the missing parameter.
This is from the lang file:

Code:
YOUR_RANK_IS = Your rank is ^3%d ^4of ^3%d ^4with ^3%d kill(s)^4, ^3%d hit(s)^4, skill level  ^3%0.0f%%^4.
Of course I modified the colour tags to match with the client_print_color. Here I see that it has 4 integers, and one float, also in client_print_color 5 parameters are entered after "YOUR_RANK_IS" as in my 1st post, but I can't quite make out what is the purpose of "id" before "YOUR_RANK_IS" in client_print_color.

Only the * character before %L is printed in the game so maybe the problem lies in the "YOUR_RANK_IS".

Here's the original statsx_shell:
Attached Files
File Type: zip StatsX Shell (Ultimate StatsX).zip (122.6 KB, 3 views)

Last edited by TheiOne; 05-16-2018 at 10:49. Reason: Added the attachment
TheiOne 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 17:26.


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