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

String formatted incorrectly - parameter 5 (total 4)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
NucL3ra
Veteran Member
Join Date: Sep 2008
Location: Bucuresti , Romania
Old 10-25-2009 , 17:23   String formatted incorrectly - parameter 5 (total 4)
Reply With Quote #1

I am trying to edit one of Exolent's old HnS plugin to create a Hns war plugin.

I did the most of the plugin but when i try to make a simple command i get this error: "String formatted incorrectly - parameter 5 (total 4)"

The command is /runde (/rounds) and i want to be like this:

There are 10.....2 rounds left until the match finishes.
There is one round left until the match finishes.

the code is this:
Code:
        if(g_ScrimOn)
        {
            id = 0;
            new rounds;
            if(g_ScrimType == SCRIM_POINTS)
            {
                if(g_ScrimRounds <= 4)
                {
                    rounds = (g_MaxScrimRounds/2) - g_ScrimRounds;
                    if((g_MaxScrimRounds/2) - g_ScrimRounds != 1)
                        {
                        formatex(message, 191, "There are %s^x03%d rounds%^x01 before ^x03teams switch.", rounds);
                        ShowMsg_HnsMsg(id, message, scrim);
                        }
                    else
                        {
                        formatex(message, 191, "^x03 Last round before the teams will switch. %^x01 ");
                        ShowMsg_HnsMsg(id, message, scrim);
                        }
                }
                rounds = g_MaxScrimRounds - g_ScrimRounds;
                    if(g_MaxScrimRounds - g_ScrimRounds != 1)
                        formatex(message, 191, "There are %s^03%d rounds%^x01 before ^x03the match ends.", rounds);
                            else
                        formatex(message, 191, "^x03 Last round before the match ends. %^x01", rounds);
            }

        }
        else
            formatex(message, 191, "There isn't any match playing.");
The error i get is this:
Code:
L 10/25/2009 - 23:25:40: String formatted incorrectly - parameter 5 (total 4)
L 10/25/2009 - 23:25:40: [AMXX] Displaying debug trace (plugin "hide-n-seek.amxx")
L 10/25/2009 - 23:25:40: [AMXX] Run time error 25: parameter error 
L 10/25/2009 - 23:25:40: [AMXX]    [0] Hide-N-Seek.sma::clcmd_Say (line 583)
line 583 is
Code:
   formatex(message, 191, "There are %s^x03%d rounds%^x01 before ^x03teams will switch.", rounds);

Last edited by NucL3ra; 10-25-2009 at 19:24.
NucL3ra is offline
Send a message via Yahoo to NucL3ra
NucL3ra
Veteran Member
Join Date: Sep 2008
Location: Bucuresti , Romania
Old 10-25-2009 , 18:07   Re: String formatted incorrectly - parameter 5 (total 4)
Reply With Quote #2

I fixed it like this:

Code:
        if(g_ScrimOn)
        {
            id = 0;
            new rounds;
            if(g_ScrimType == SCRIM_POINTS)
            {
                if(g_ScrimRounds <= 4)
                {
                    rounds = (g_MaxScrimRounds/2) - g_ScrimRounds;
                    formatex(message, 191, "%s mai ramas^x03%d rund%s^x01 pana la ^x03schimbarea echipelor.", (rounds != 1) ? "Au" : "A", rounds, (rounds != 1) ? "e" : "a");
                    ShowMsg_HnsMsg(id, message, scrim);
                }
                rounds = g_MaxScrimRounds - g_ScrimRounds;
                formatex(message, 191, "%s mai ramas^03%d runde%^x01 pana la ^x03sfarsitul meciului.", (rounds != 1) ? "Au" : "A", rounds, (rounds != 1) ? "e" : "a");
            }

        }

But :d for my own intelligence if someone would fix the problem I'd thanks and I'd appreciate the effort with a karma.
NucL3ra is offline
Send a message via Yahoo to NucL3ra
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-25-2009 , 18:24   Re: String formatted incorrectly - parameter 5 (total 4)
Reply With Quote #3

runde%^x01

Try runde%%^x01 if you want show 1 %
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
NucL3ra
Veteran Member
Join Date: Sep 2008
Location: Bucuresti , Romania
Old 10-25-2009 , 19:22   Re: String formatted incorrectly - parameter 5 (total 4)
Reply With Quote #4

You didn't get it , yeah foreign language is hard. I translated it ...
NucL3ra is offline
Send a message via Yahoo to NucL3ra
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 10:44.


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